Live data from Hacker News

Ask HN: What made you change your mind about a programming language/paradigm?

news.ycombinator.com

161–170 of 401 posts

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#161

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.

Same. Then I discovered Kotlin, which is really just a much improved Java, and my only regret is that there aren't more server side gigs available for it (yet).

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#162

Earlier 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…

I agree that the type system is very complex. I've spent a lot of time wrapping my head around it and still get confused sometimes.

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?

#164
Anyone want to swim upstream in the static types -> functional programming -> immutability current?

I'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?

#167
post #92

The 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…

Dynamic languages: you are the compiler. You save time now to pay it later.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#168

Testing. 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…

Both unit and integration tests have their place. This talk was excellent in explaining it to me (with functional cores, imperative shells). Unit test functional cores, use integration tests for imperative shells: https://www.destroyallsoftware.com/talks/boundaries

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?

#169

Earlier 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…

>but white space just is not one of them.

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.

Re: Ask HN: What made you change your mind about a programming language/paradigm?

#170
Used to hate Ruby, then I picked it up for a side project. I wouldn’t exactly write a compiler in it, but it’s great for small scripting tasks that don’t need to be fast. I’m still not entirely sure why people do so much with it, but it’s much more friendly than bash scripts for doing many of the same small tasks.
Post reply on HN