I used to dislike Java, then recently I discovered java streams, and some of the nice features with newer versions like more immutable types. After that I found Java a whole lot more enjoyable to use.
Ask HN: What made you change your mind about a programming language/paradigm?
161–170 of 401 posts
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#162Earlier quoted context omitted.
I agree, because type inference in some (Typescript) is good enough that there's almost no overhead. Back when it took twice as many lines with types it made sense. But the overhead in typescript is maybe 10%, worth it anymore? I don't think so
I think we have a ways to go. Typescript's type system is very feature complete (which is a good thing, but it also means there's a lot to learn, and I feel like I have to think about type definitions more than I ever did with other languages), but also, fantastic libraries like Ramda have a lot of trouble with expressing their types with Typescript. It's a tough problem to solve, and I still use both, but I'm just s…
Unfortunately Typescript's type system is largely driven by the need to represent anything you can do in JS, for library compatibility reasons.
The main designer also wrote C# and Delphi. In a lot of ways, C#'s type system is better (less complex), but Typescript has the huge advantage of working with existing JS
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#163Re: Ask HN: What made you change your mind about a programming language/paradigm?
#164I'll do it:
1. LLVM's IR. In many ways this is dorky OO: everything has a reference to everything else (an Instruction knows its BasicBlock knows its Function...). It also has many dynamically-enforced constraints, e.g. a basic block must have its phi nodes at its beginning, and terminators at its end. These are NOT enforced via the type system but instead dynamically through verification. I was surprised, but I have come to realize the ergonomic benefits of having everything reachable from everything, allowing transient illegal states, and how type-level enforcement enacts a complexity price.
2. Clojure's threading macros, in particular thread-as. This is basically Haskell's do-notation, but more flexible and without involving the compiler. LISP continues to be relevant and eye-opening - are there any static type systems that have such a construct?
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#165Re: Ask HN: What made you change your mind about a programming language/paradigm?
#166Scripting is perfectly rational due to abundant memory available.
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#167The more code I write in dynamically typed languages, the more I believe that static typing is a must. Generally speaking, I noticed that I'm shifting more and more away from "stop annoying me and let me do what I want, I know better!" part of the PL/API design spectrum, and towards "better safe than sorry". Static typing, runtime checks, data schemas, design by contract, fail fast etc. Yes, it's overhead, but it's p…
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#168Testing. Unit testing to me seemed akin to drinking 8 glasses of water every day. A lot of people talk about how important it is for your health, but it really tends to get in the way, and it doesn't seem to really be necessary. Too frequently, code would change and mocks would need to change with it, removing a good chunk of the benefit of having the code under test. Then I started writing integration testing while…
I am fan of Gary Bernhardt ever since viewing this talk.
Re: Ask HN: What made you change your mind about a programming language/paradigm?
#169Earlier quoted context omitted.
When I looked at Python, it looked interesting. Then I found out that -white space is important-. I thought about what it might be like to worry about that, and decided -not for me-. When CPUs ran at 1 MHz, I wasn't so sure about FORTH with its RPN. But it ran a lot faster than interpreted BASIC, and was a lot faster to write than assembler. Once the world discovers the source of all its woes and goes back to wide-op…
> Then I found out that -white space is important-. I hear this a lot and I think it's a misunderstood statement. Python does not care if you do not have a space in assignments or arithmetic or between commas or parentheses. What Python does care about is the indentation of the source code. The indentation is what guides the structure - which is already what we are doing with most languages that don't care about inde…
This position is hard to maintain after you've spent an hour trying to debug a nonsensical error just to realize you opened the python file in an editor that used a different tab/space setting than the file was created in. Significant whitespace is one of the biggest misfeatures in programming history.