Live data from Hacker News

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

news.ycombinator.com

91–100 of 401 posts

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

#91
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 functional programming, that I discovered that the purported benefits of OO were lies. I also realized that the idea that concurrency and parallelism must be hard is untrue. OO simply makes it hard.

Now I see OO as something I have to deal with, like a tiger in my living room. Thankfully, so many new languages have come out recently; Go, Rust, and Elixir being the ones that I use regularly, that have called out OO for what it is and have gone in more compelling directions.

Hopefully one day they will teach OO alongside other schools of thought, as a relatively small faction of programming paradigms.

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

#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 predictable overhead - unlike, say, trying to debug an incomprehensible error the night before release.

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

#93
post #81

Using it as my main language: Python (2.7). How the hell did this thing become so popular? I've used it for all sorts of stuff earlier, less complex than the other. Scripts, devops, ETL... But then I got into a company that is using it for some quite serious stuff, a large codebase. Holly smokes this thing does not scale (in terms of development efficiency and quality) well. I swear at least 70% of our bugs is becaus…

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-open, 8-bit systems, I'll go back to FORTH.

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

#94
post #81

Using it as my main language: Python (2.7). How the hell did this thing become so popular? I've used it for all sorts of stuff earlier, less complex than the other. Scripts, devops, ETL... But then I got into a company that is using it for some quite serious stuff, a large codebase. Holly smokes this thing does not scale (in terms of development efficiency and quality) well. I swear at least 70% of our bugs is becaus…

I've mostly done Java in my career and I tend to stick to it (or Kotlin now). I've always said the power of java isn't in solving programming problems, it's in solving organizational problems. The killer feature that vaulted it to the top and still hasn't been beat is javadoc.

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

#95

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…

> Unit test suites would break all the time for silly reasons, like someone optimizing a function would mean a spy wouldn't get called with the same intermediary data, and you'd have to stop and go fix the test code that was now broken, even though the actual code worked as intended. Can you or others speak more about this? I was taught that verifying function calls for spies/mocks was good practice. But, I encounter…

Your tests should be driven by your contracts. Is there a contract for the component being tested that says, "it calls function X if Y"? If yes, then test that. If not, then you shouldn't be testing such an implementation detail anymore so than you'd test values of local variables inside a function at some point in the middle.

The important part is to remember that not every function is a component, and not even every class by itself. Where to draw the boundary between components is itself an explicit design decision, and should be made consciously, not mechanically.

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

#96
post #8

Not what you’re asking for but related. I’ve always found programming interesting. It’s possibly one of neatest ways to figure things out with computation. But early on I got the impression the profession was abusive - maybe inherently. I got fired from my first programming job for prioritizing finishing high school over a programming job. I dabbled after that and every project related to computers had this “natural”…

Maybe it's different in other places, but I've worked in a few EU countries and I don't agree that abusiveness is inherent. I see the company culture and attitude of the bosses as the determinant factor, but overall most places I've worked have been fine. And even in the worst, where overtime was rampant and stress was high, it was unthinkable to fire one of the intern students for prioritizing school.

I can't argue with boring; CRUD is rampant. But I think you can escape it if you really care.

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

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

One downside to static typing is the overhead required when writing/running programs.

For example, let's say you have a class `Dog` that you want to rename to be more generic so you now call it `Animal`.

In Python you can test out snippets of code with `Animal` without necessarily having to worry about other pieces of code still referring to `Dog`. You would just need to make sure that the code you want to run happens before later pieces that might use `Dog`.

In C/C++ you'd have to change all the references to `Dog` in your codebase, comment them all out, or add a new target to your project to build a subset of files which do not include an invalid reference to `Dog`.

This extra friction can make rapid prototyping a little harder in static typed languages.

IDK if any language supports this today, but ideally I'd like to be able to run a language without compile-time type checking for prototyping and be able to progressively turn on type checking as I'm nearing the final stages of iteration on a project/feature.

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

#98

Scala. It really opened my mind up to what I was missing, as a recovering Perl programmer. Perl folk tend to think their shit doesn't stick. But it's the Blub Paradox in full effect. Types matter. Functional programming matters. Anyone advocating for dynamic typing in the year 2019 is captain of the USS Blub; and it's sinking.

What do you think about the fact that the person who coined the Blub Paradox was an advocate and creator of dynamic languages?

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

#99

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…

Same reaction but different type of project and language. Immutable data with persistent data structures was a game changer for me. There is place for OO but it does feel like the last 20 years our profession has been suffering from collective insanity.

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

#100
post #41

My opinion about Perl went from "It's hideous" to "It's okay". I tried to learn Perl by just reading code, like I'd learned several other languages (Fortran to Pascal to C). I finally read the Camel book. On page 83 it said "Everything in Perl happens in a context. Until you learn this you will be miserable." I was.

Perl was my first love. If you take the time to really grok it Perl is a beautifully designed language.
Post reply on HN