News for hackers. Stuff that matters.
Re:How I Program in 2024 by seer on Sunday August 04, 2024 @11:42PM (#41158004)
As a matter of fact - no I haven’t. My experience with types is TypeScript, Elixir and a bit of Scala.

I always try to have “clojure style” types where I don’t try to be too prescriptive - don’t lock things down if you don’t need to, just the minimum possible types to make sure the code I’m writing is correct, and nothing more - Rich Hicky’s talks on Clojure’s Spec was an eye opener.

I have been told by some java devs though that it is a matter of style - while unconditional it is possible to write java code with much less boilerplate if one uses newer language features and actually tries to hold the cruft at bay. Is that true?

Re:How I Program in 2024 by fendy3002 on Sunday August 04, 2024 @11:46PM (#41158026)
idk, haven't use newer java or C# after 2014-ish, though I think I've read C# has support some dynamic typing, never explore that. Never touch Elixir and Scala too so cannot comment on that.

TS though, the type declaration is amazing with it's union, optional and intersection type!

Re:How I Program in 2024 by behnamoh on Sunday August 04, 2024 @11:59PM (#41158084)
> My experience with types is TypeScript, Elixir and a bit of Scala.

Dude, Elixir only recently introduced some sort of a type system...

Re:How I Program in 2024 by ianleeclark on Monday August 05, 2024 @02:50AM (#41158685)
Elixir has had dialyzer + type hints for years
Re:How I Program in 2024 by seer on Monday August 05, 2024 @03:49AM (#41158984)
While not part of the compiler, the dialyzer’s types are quite nice, even if sometimes it is a bit clunky - I’ve noticed that most of the time when I thought it was “wrong” it actually wasn’t and had picked up on some bug / misunderstanding in my code, though error messages could have been better