Live data from Hacker News

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

news.ycombinator.com

271–280 of 401 posts

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

#271
post #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.

Well, in principle you still pay it now in the form of lots of unit tests that you wouldn't need with a statically typed language.

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

#272

I didn't like python at first. The mentality of "hardware is cheap, there's no need to be that fast" drove me away from it full speed. However, I was short on time for something, and I gave it a try, then I actually liked it a lot. It's very practical and fast enough for most cases. The string processing capabilities has blown me away, however it didn't change my love for higher performance, compiled languages. Now I…

TBH Java used to be a lot worse than it is now :)

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

#273

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…

As is the case for all software, unit tests should be well designed.

If a unit test fails when the code under test hasn't functionally changed then it means that your unit tests are flaky.

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

#274
Minimalist languages, as in: languages that support a single kind of paradigm. The more I work with C#, I find that supporting all kind of different paradigms severely hampers a language, since you never know how a module is going to do this.

I didn't notice this until I started learning Pharo and F#. Both of them were just so incredibly clean, and so much simpler. I never have to think about how to do anything in those languages too hard, since there's one good way of doing it, and if you're doing it in another way, you'll run into so many ugly bits of code that you instantly see that it isn't working.

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

#275
Parse.com shutting down is what turned me off from BaaS services and made me realize that vendor lock-in is real and that all future services I write should be as generic as possible so I can easily switch platforms when needed.

Besides that, spending months fixing issues that pop up in production but should have been caught at compile time has turned me off from dynamically typed languages in favor of static typing.

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

#276

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…

The integration tests that you are describing behave much like I would expect unit tests to behave. Give an input, assert the results (return value or state change). The example of optimizations breaking the unit test could be either a poor test (If the function doesn't need to call that intermediate with that data, why is it being tested?). Oftentimes the spy is added to the test because there is unnecessary tight c…

A good use of mocks/spies is if you need to test a side-effect. For instance: did your code call that service with the right parameters?

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

#277

Earlier quoted context omitted.

I will probably be the lone voice here defending mock testing but probably not for the reasons you'd expect. Does mock testing end up being brittle? Yes. Do you have to refactor the tests immediately after making small changes? Yes. Is there a cost to this? Yes. Mock based testing however is the only thing I've ever encountered that forces me to think very, very clearly about what my code is doing. It makes me inspec…

What's stopping you from thinking clearly about the code while/after you write it? As I'm writing this sentence I'm thinking clearly about it and I'll probably reread it after I hit save. There's no reason you can't do the same w/ code.

It's not that it can't be done, it's just that sometimes it is nice to have a tool that helps you think about the code. Unit tested code isn't better in any way, it's just a style of writing code that can produce good quality code, but not the only coding style that can do that. But I'd like to add that there have been quite a few refactors that I have done that would have been way harder if it hadn't been for the unit tests. It might not work for everyone, but I'd recommend you give it a serious try, it might be useful.

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

#278
post #272

I didn't like python at first. The mentality of "hardware is cheap, there's no need to be that fast" drove me away from it full speed. However, I was short on time for something, and I gave it a try, then I actually liked it a lot. It's very practical and fast enough for most cases. The string processing capabilities has blown me away, however it didn't change my love for higher performance, compiled languages. Now I…

TBH Java used to be a lot worse than it is now :)

I've first used Java in the early 2000s. I think I've seen some of these times. It was fun nevertheless. :)

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

#279
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…

I could not disagee more. Sorry... But fuck Labview. I'll take VHDL over that mess any day.

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

#280
Types, I never could stand them. I started out programming C++ for tiny side projects, eventually moving to python2 for a majority of my projects until I got into a programming class in my highschool and was taught java, and I hated java as soon as I touched it. Java's type system was gross to me, I never really got advanced enough in C++ to use types much and python has no type so I just assumed java was an outlier and types where a stupid addition by it. I continued to believe this even once I got a job in node, until I used typescript. Actually seeing why you would want a static typing system, and being old enough to appreciate the structure they provided changed me, would hardly consider using a dynamically typed language for even a reasonably sized project now.
Post reply on HN