Live data from Hacker News

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

news.ycombinator.com

321–330 of 401 posts

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

#321
post #247

Labview. I hated graphical programming. I don’t even know why. Then I worked on this fairly complex real-time system with FPGAs and lasers and whatnot with several people. Works first time. How does it work? Obvious. Encapsulation is obvious from the diagram. Comments barely needed. Need to make a change deep in the code that breaks an interface? Everything you need to change turns red. If something doesn’t look good…

> it makes bad code harder to write than good code

In practice, I've only seen bad code drawn in LabVIEW; it was shocking for me to see a "good" code example once. But then fixing bad code (i.e., refactoring) is only pain and suffering compared to text-based languages.

> quite obvious visually

Agreed, you can see how confusing it is, but unfortunately that never stopped anyone from doing it that way in my experience.

The only saving grace of LabVIEW is that you can now interface via C/C++ and avoid G (their "graphical programming language") altogether.

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

#322
post #281

My first big Erlang project made me completely rethink my acceptance of object oriented programming in C++, Java, Python, etc. I realized that I had blindly accepted OO because it was taught as part of my college curriculum. After several years in industry I had concluded that programming was just hard in general. It wasn't until my first project in Erlang, where an entire team of OO devs were ramping up on functiona…

Erlang. Same here. Reading first few pages of a book describing principles of OTP (processes, share-nothing, messages, etc) was mind blowing. Company I worked for at the time (and I still do) decided to switch from Java to Erlang in middleware area. This decision seemed like a mixture of insanity and enlightment. Do you switch from one of the most popular languages in the world to something that most developers never…

May I ask what was the book? Do you recommend it?

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

#323

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…

I think most would agree that integration tests are better. The problem is they tend to be slower. Having to initialize the system appropriately for every test (e.g. writing to the database) tends to limit the number of tests you can have. Unit tests scale a lot better. That's why most generally use a pyramid structure: lots of unit tests, a moderate amount integration tests, and a few end-to-end tests.

With an in-memory database like Derby I find my test cases run fast enough

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

#324
I haven't ever changed my mind about a language, because instead I choose not to have strong opinions about something to begin with. Fact is most developers are not experts in a language or framework, even if they've worked with it for 10+ years, including myself. The only thing I've learned is that developers are humans and like to rely on their uninformed opinions and biases. All languages and frameworks have their strengths/weaknesses and their appropriate use cases. You can likely hack any language or framework or toolkit to do what you want it to do. At the end of the day these are all just layers of abstraction. It's important that you do a deep dive into something before you form an opinion about it's appropriateness for a given use case. Deep diving can include reading the informed opinions of experts (generally the people who wrote the language or are actively maintaining it).

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

#325

Earlier quoted context omitted.

Realistically, how could you know if it's still any good if you haven't used it since 2.2? It's basically a different language now.

The same way everyone else does: fixing other people's broken code. It actually hasn't changed much since 2.2.

It's changed fundamentally since 2.2...

Also if you're fixing broken Python code, you're using Python, so no that doesn't really track.

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

#326
post #3

Almost every time I experienced a shift like this in my thinking it was due to experiencing a problem I hadn't experienced until that point. I discovered the value of compile time type checks when I worked on large codebases in dynamic languages where every change was stressful. In comparison having the compiler tell you that you missed a spot was life changing. I discovered the value of immutable objects when I work…

I might even go farther. I wonder if most of the techniques (and languages) that we think are stupid are instead aimed at problems that we don't have. (Of course, those techniques become stupid when people try to apply them on the wrong problems...)

I suspect you are correct. I've definitely been guilty of drinking a particular brand of kool-aid and applying it inappropriately before.

That in itself can turn into a learning experience if you stick around for the aftermath.

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

#327

Earlier quoted context omitted.

as a serious question, why even use python if you have to go through hoops to make it work even half as well as other languages? are you reliant upon some python only library?

> go through hoops mypy and types are only "hoops" in comparison to non-annotated Python (in terms of added syntax / coding effort), yet compared to explicitly typed languages where you have to declare types, that's just standard thing you have to do so there is no extra effort in comparison to these other languages (and then the judgment that it only works "half as well" is controversial (Edit: or at least needs qua…

i prefer ml dialects like f# or ocaml or something like racket that gives you both static and dynamic languages that can interoperate. in f# and ocaml, the type inference handles most things, although you do need to manually declare types sometimes. it is often a good idea anyway.

and what i mean by hoops is that python is not designed to have static types. thus, any type system added is tacked on by definition and will lead to "hoops". in something like f#, at no point will the existence of its type system and inference be a surprise. the language is built around and with the type system.

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

#328

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

Nope, Haskell's do notation is context based computation passing mechanism that in most cases obey laws, while Clojure's threading macro is a programmer/human convenience. Both have nothing but superficial similarity

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

#329

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…

It is all about balance.

Use system/integration/functional/unit tests wisely.

For precise stateless stuff, like making sure your custom input format parser/regexp covers all edge cases, I prefer unit tests - no need to init/rollback database state.

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

#330
post #322
post #281

Earlier quoted context omitted.

Erlang. Same here. Reading first few pages of a book describing principles of OTP (processes, share-nothing, messages, etc) was mind blowing. Company I worked for at the time (and I still do) decided to switch from Java to Erlang in middleware area. This decision seemed like a mixture of insanity and enlightment. Do you switch from one of the most popular languages in the world to something that most developers never…

May I ask what was the book? Do you recommend it?

There are 2 erlang books. "OTP in action" and "Learn you some Erlang". I highly recommend both of them.
Post reply on HN