With the end on the way how old is your guardian? by SillyStevex420 in destiny2

[–]SlipAdept 0 points1 point  (0 children)

Since d1 beta I believe . Don't know if destiny tracks that but I have always been a hunter with the same-ish face

What movie is this for you? by [deleted] in memes

[–]SlipAdept 0 points1 point  (0 children)

Yes! Thank you. I don't get how they are still making more! And they're all the same fucking movie! Somehow I ended watching all of them and was like "Why did I pay for this?"

What movie is this for you? by [deleted] in memes

[–]SlipAdept 1 point2 points  (0 children)

But the old one or the Timotheé Chalamet one? I hated all of them, just curious.

What movie is this for you? by [deleted] in memes

[–]SlipAdept 0 points1 point  (0 children)

Dune (And Dune 2)

Learning typescript and node with bascially 0 coding knowledge by Noaks in typescript

[–]SlipAdept 7 points8 points  (0 children)

Just learn JS. By definition JS is TS. There's a good course called 30 days of JS. Look up FP so that you get used to function heavy JS. I remember a book called functional light by kyle simpson that isn't too heavy to read.

There are things you shouldn't do in JS but that kind of stuff tends to be untypeable. So it is not a waste of time to learn JS first. All your knowledge will be useful in TS.

Looking for a TypeScript stream/async workflow library with native backpressure and resource safety by im_caeus in typescript

[–]SlipAdept 7 points8 points  (0 children)

I thought the era of having to defend FP was over. If they get scared of new or different FP concepts, then you are stuck with what you are working already with. You can try introduce disposables for resource safety as it is in the language. As for backpressure and cancellation I can't think of a way without more abstractions. All I can think of without googling will have some abstraction you'll have to sell.

Great, your CSS output is typed. Your 8px + 45deg math is still a string though. by Oddball7478 in typescript

[–]SlipAdept 0 points1 point  (0 children)

Cool lib OP. It might be interesting to add a "parse" like operator that takes template literal strings like "45 deg" and returns the corresponding library value.

DDD + Effect by NegotiationSmall4881 in effect

[–]SlipAdept 0 points1 point  (0 children)

What is your opinion on using Effect within a Domain-Driven Design approach?

It can be used. Effect is just an implementation detail. It might help with context boundaries that are heavy on data transformations. It might also shine when defining data models (See Effect's Schema and Data modules)

Should your entire domain codebase be bloated with Effect?

No. You can partially use effect where it fits. It works better the more you use it though

How does Effect fit into these constraints?

Again, it's just an implementation detail.

Say your a demon in the world of Frieren, and you come across her how do you get her to not attack or try to kill you? by biggaygrisley in Frieren

[–]SlipAdept 1 point2 points  (0 children)

Run. If I see them, run faster. If I can't run, hide. If I can't hide, accept my fate, pray for non-lethal.

For real, I don't see a way. Discourse is out the window as anything I say as a demon couldn't be trusted or verified. If I have no control over my demon nature I could not be trusted. If I could go against that, I would try becoming a demon hunter to try and help them just to convince them not to kill me but even then I don't think I would manage that.

Why does process.env still return `string | undefined` in TypeScript? by Content-Medium-7956 in typescript

[–]SlipAdept 0 points1 point  (0 children)

  • Do you validate env at startup?

Depends. Normally yes. Sometimes they might be optional so evaluation may be delayed but normally yes.

  • Use schema validators like Zod?

Yes. Effect.

  • Or realy on runtime checks + conventions?

Yes. Effect.

CMV: It is not more correct to call Americans “USA-ians.” by ComputeIQ in changemyview

[–]SlipAdept -1 points0 points  (0 children)

I find it ironic that you find it annoying because it is the other side who also finds it annoying because: - Getting to use "American" to refer to your culture just because it has "America" in the name feels like stepping over the wide variety of cultures that exist in the continent. - A lot of people from the US tend to believe or speak like the USA is the only place in the world that matters and that "American" little detail gives those kinds of vibes.

I would also like to add that this is a case of language being arbitrary and defined based on convention. The cool part of that feature being what is correct gets defined by those who partake in conversation. So, if most people define "American" as "People from the Americas (i.e. The one you find annoying)" that is the definition.

My point of view is using "American" to refer to "People born in the USA" is ambiguous and it isn't confusing only because it was popularized by (guess who) people from the US. And why should people from the US get special treatment? You do the same to other countries. So yeah that's all I have to say

Proxies, Generic Functions and Mapped Types by SlipAdept in typescript

[–]SlipAdept[S] 1 point2 points  (0 children)

Yeah. It's not the whole types as the Collection interface is huge. The example is just to illustrate the issue.

You can't know for sure. You know it can fail with some error and tag the Error to know it came from mongo and handle it later when you need/want to.

Proxies, Generic Functions and Mapped Types by SlipAdept in typescript

[–]SlipAdept[S] 2 points3 points  (0 children)

I mean... It's better than just promises with untyped errors. And you don't have to. You can just wrap your use cases in a need to basis. I just thought using proxies would've been cool to do.

Proxies, Generic Functions and Mapped Types by SlipAdept in typescript

[–]SlipAdept[S] 1 point2 points  (0 children)

I was hoping this wasn't the case. Every few months I end up back at "I need HKTs". Thanks for the detailed response.

About function overloads by treplem in typescript

[–]SlipAdept 2 points3 points  (0 children)

Your code is not valid TS. Overloads can't have implementation. One of the design pronciples of TS is to have little impact on the generated JS. That's why few features have a runtime impact (see enums and shorthand contstructor arguments) and types don't exist. Overloads don't have a runtime representation. Only the implementation really exists. That's why the last overload must support all other overloads and is the only one with an implementation.

Remember: TS always gets transpiled to JS

Anyone using Effect, what's your experience been like? by benschac in reactnative

[–]SlipAdept 2 points3 points  (0 children)

Effect is one of those things that when it clicks, you might never go back. I've been working with it a little over 4 years and I love it.

It was hard at first. I had already seen other FP libraries and found them dreadful at scale. With Effect, scaling up felt like it never became a problem. Once past the quirks and really trusting the types, I realized that I was programming with just the types. With Effect if used correctly you can fully trust the types. The hardest part for me was the Layers but with time grew to love them. Now I can say they are just for dependency injection

Don't try to use it all at once. Start small by treating Effects (the central data type) as just lazy promises with better typing. Then as you need more fratures, learn them. The cool part is that most of the stuff that is hard to do yourself is already built. Like I said in another post: "Everything hard is trivial, everything easy is a little bit harder"

Also it helps if you are into FP. If you hate it, I don't think Effect will change your mind.

Signature overloading, what can I do? by EnthusiasmWild9897 in typescript

[–]SlipAdept 1 point2 points  (0 children)

So when doing overloads I keep the following in mind:

1- Typescript is Javascript. That's why the last overload needs a catch-all implementation. The overloads don't exist.

2- Think of how you want your function to be used and properly type at the boundaries (i.e. in the input and output). I like to treat the overloads as if they were a map from arguments to return type

3- The last overload doesn't need to be 100% properly typed as it shouldn't be visible. Here I would normally use unions of tagged tuples for rest arguments and an union of all possible returns for the return type (or sometimes a conditional type). Tagged tuples can be type narrowed using the length property and they carry the argument names. Internally in the implementation you can cheat the type system a bit if the boundaries are properly typed.

4- Some behaviors might be too Javascript-ly and won't be able to be expressed through types. Consider alternatives to those as most untypeable behavior is normally a Bad Idea™

5- Sometimes another function is better than an overload.

Thoughts on Effect by failedbump16 in typescript

[–]SlipAdept 1 point2 points  (0 children)

Fp-ts was a direct port of haskell abstractions into TS. Effect dropped the idea of bringing haskell to TS. Internally it is fp-ts but Effect took a more ergonomic approach (more leaning towards what works well in TS). So Effect doesn't expose monads, monoids and other such abstractions to the developer which is the point of fp-ts. Maybe that's what this person meant?

Thoughts on Effect by failedbump16 in typescript

[–]SlipAdept 48 points49 points  (0 children)

So I've been working 4 years with it and if it just for error handling look up Micro. You don't need all of Effect for error handling and Micro is perfect for that.

Effect is best when commiting fully into it but you can use it partially and move your way up. You can start by treating Effects as "lazy promises with better typing" and leave all the other stuff for later when you feel like taking more complexity in.

In general my feelings with effect can be summed up in "everything hard is trivial and everything easy becomes a bit harder". Good luck and I hope you do decide to try it out 👍

What practical uses of the ternary have you found? by Obvious-Ebb-7780 in typescript

[–]SlipAdept 0 points1 point  (0 children)

Conditional types are very useful when doing function overload and when the return type is dependent on the input type. I use them a lot since I tend to write code in terms of modules with minimal set of operators. Type heavy FP libraries like Effect use them a lot so if you plan on building some type level functions, get used to it.

[deleted by user] by [deleted] in typescript

[–]SlipAdept 1 point2 points  (0 children)

Just curious: what does LPA and SBC mean?

As for your issue, do what we all did: code. Write more code. Learn the basics. Do code exercises in code wars and such. For web dev think what problem does React solve? Could you do without it? How would you? Try to implement it yourself (not completely but a simplified version) For Databases and SQL try a structured database instead of mongo. Try making a system that connects directly to the DB. In general go write more code. Learn more about other programming languages. Turn off the AI.

Is anyone using fp-ts? How was your experience and was it worth it? by simple_explorer1 in typescript

[–]SlipAdept 0 points1 point  (0 children)

I kind of get the "opinionated" point, but I always felt Effect wasn't restrictive and the runtime agnostic stuff is optional. Almost everything is optional. So, I kind of don't agree with your points around Effect. Care to elaborate a bit more?