Live data from Hacker News

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

news.ycombinator.com

281–290 of 401 posts

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

#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 heard of? Surely, exciting, but will it work? How do we hire new staff? After our R&D confirmed it was promising, me with couple of other developers were tasked with rewriting quite an expensive piece of middleware software that was unfortunately reaching its maximum capacity. We had no knowledge of how the software worked, we just knew its API. We were given time to learn erlang so we did. We all switched from eclipse to vim (some to emacs). After a bit of playing around with erlang we did our job in just 3 months. New app was much smaller and was easily capable of handling many more messages than the previous one. And it was written by erlang newbies! Then many more erlang apps we have created. It turned out to be a really good choice. Also the level of introspection you get out-of-the box with erlang is just amazing. I have never seen anything like this before.

Now I can compare Erlang to Java and it is really baffling how the heck Java took over the world. To do erlang I just need an editor with some plugins, ssh connection to linux with OTP installed and of course rebar3. To do Java I need 4GB of RAM to simply run an IDE with gazillion of plugins, maven to cater for thousands of dependencies for the simplest app and I need to know Spring, Hibernate, AOP, MVC and quite a chunk of other 26^3 3-letter abbreviations. No thanks.

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

#282
post #144

Earlier quoted context omitted.

Good insights. Modern platforms are neither full dynamic nor rigidly static, but gradual, https://en.wikipedia.org/wiki/Gradual_typing . Start with a dynamic script, add typing as you go to strengthen the system. Notable mentions: Typescript, Python + mypy, C#, Dart.

This doesn’t encompass all modern platforms, just those that decide to go that route.

Fair enough. 'Quite a few modern platforms...'

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

#284

Earlier quoted context omitted.

I almost only use mocks for external calls (usually external APIs). Very rarely, I use them for some internal code that is unusually time consuming or difficult to set up. A few months ago, I did a contracting job and the team I worked with used the "mock everything" approach, without even one integration test, which to me seemed crazy (especially for a component which was calle "integration layer"). I tried hard to…

People I’ve worked with have had that idea, and I’ve found they’re most frequently from the games industry or from contract shops. In both of those, the maintenance of the code over time is far less important than that it works on the ship date. Additionally, people with large state machines with too-complex sets of possible states (games, big frontends without a top level state management system) tend to only unit t…

Yes, it's for sure a quicker way to have 100% test coverage...

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

#285
post #16

Every once in a while I search for something I need in Python and find that it only exists in Python 3, but I'm not quite convinced it's worth the effort to transition from 2. However... I've just learned about Python 3's f-strings and they gave me a big smile, and probably the final push I needed :) (Yes, I do know that sounds silly and there are probably much better reasons to transition to Python 3 ¯\_(ツ)_/¯ )

The non-Python-specific term is string interpolation, and it should be in every language.

From a language design perspective, the problem is that the compiler needs to know about it, so it's a core feature, but for maximal efficiency it might require some feature that isn't part of a language's core, like string streams. Another possibility would be a powerful macro system that allows the transformation of a format string into code, but few languages offer that.

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

#286
post #249

I had my doubts about Rust. I knew it was a powerfull tool, but I thought it was too hard to learn, to complex, and that it was reserved for heavily resources-constrained environments, or any other situation where pure performance was one of the prime concerns. Then I attended a brilliant conference/demo about Rust, in which the speaker proved that one could build something with Rust without giving much thought about…

> Rust est souvent présenté pour ses concepts de gestion de mémoire avancés comme les lifecycles ou le borrowing.

«les lifecycles ou le borrowing», ouf!

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

#287

Types - I worked on an enterprise Java application for a few years and grew to hate them. What I actually hated was J2EE, but at the time I didn't know that. So I swung hard into "You don't need types", only to work for another two years on the world's worst Node.js app. I was young, I was naive, I didn't realize how bad things could get. We didn't have anybody that cared about testing, and I'd never been around test…

> I've now moved onto "Just enough E2E/Integration tests" as a paradigm.

Another soul is saved!

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

#288
post #210
post #120

Earlier quoted context omitted.

If I had to point to something, I would single out CL's powerful support for multiple dispatch. I'd hesitate to recommend CL to undisciplined programmers, because it is too easy to write code that works but you don't understand a week later.

(I hammered out that answer right before I had to run on stage. A couple other big items I forgot:) A proper numeric tower. Python has complex numbers, but they don't seem well integrated (why is math.cos(1+2j) a TypeError?). Fractions are frequently very useful, too, and Python has them, in a library, but "import fractions; fractions.Fraction(1,2)" is so much more verbose than "1/2" that nobody seems to ever use the…

Conditions, yes.

If you have multiple dispatch, then building/supporting a numeric tower is natural.

In your other reply you pointed out macros. They are a mixed blessing, easily misused. Other languages have them but use them more sparingly and making it harder to overlook their special status, which leads to better "code smell" in my opinion.

Do take a look at Julia. It has learned deeply from CL and innovated further.

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

#289
post #199

Earlier quoted context omitted.

My experience has been very much the opposite - integration tests are often very brittle, and finding the root cause is often almost a fools errand since stack traces are often no good for figuring out what went wrong, at least for web UI. While yes, unit tests do have a maintenance burden, they are often reproducible, less flaky, give you targeted debug information, and run extremely fast. There are heavy costs to i…

Although I agree with you in general, integration tests that are really focused on the contract between two services can be pretty easy to debug, ESPECIALLY if you use request ids that are passed between services, and included in every log. It’s often a matter of simply searching for the request id in your logs and quickly seeing what happened. E2E UI tests are definitely hard to debug though, in most cases. They sti…

Totally agreed - the problem is when integration tests are used in lieu of what unit tests are for, which has been an increasing trend in the frontend web world I’ve seen, in large part because of UI frameworks not providing the tools to do testing well.

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

#290
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 quit around 2.2, never looked back. Python was a breakthrough scripting language ... in the 90s.

what do you use now?
Post reply on HN