Live data from Hacker News

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

news.ycombinator.com

381–390 of 401 posts

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

#381

Earlier quoted context omitted.

If you’ll open https://reactjs.org/ you’ll read right on their main page: > Build encapsulated components that manage their own state, then compose them to make complex UIs. Components managing their own state is a textbook definition of OOP. They even use inheritance in their example on the main page: > class HelloMessage extends React.Component

React isn't really object-oriented. Components rarely pass messages to each other. Instead, the way that data flows is through function/constructor arguments. You can directly invoke a method on a component, but that's only really used as an escape hatch. It's inconvenient, and IMO, a code smell. For the React that I write, class components are used only when there's some trivial local state that I don't want to put…

> React isn't really object-oriented.

I don't do web development but I've read react API docs and user guides.

Objects calling other objects is optional for OOP, I never saw a definition that requires them to do. OOP is about code and data organization.

Objects and methods are everywhere in react. Some are very complex.

Just because it uses a few lambdas doesn't mean it's not OOP.

For reference, here's now a non-OOP GUI library may look like: http://behindthepixels.io/IMGUI/ As you see not only it's hard to use, it doesn't scale.

Like it or not, OOP is the only way to deal with complex state invented so far. Even in functional languages: https://medium.com/@gaperton/let-me-start-from-the-less-obvi... And modern rich GUIs have very complex state.

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

#382
post #184

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…

We buy software from a lot of different companies, sometimes we own the codebase but hire software companies to build, expand and maintain it, we also benchmark performance. We have a lot of data that explicitly shows that automated unit-testing doesn’t work. One good example is one of our ESDH systems, which changed supplier in a bidding war, partly because we wanted higher code-quality. It’s a two million line proj…

> We have a lot of data that explicitly shows that automated unit-testing doesn’t work.

At best you have data that shows that a poor unit testing implementation failed to deliver. A bad experience doesn't prove a whole tech strategy doesn't work when the whole world shows otherwise.

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

#383
post #225

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…

There was a comment on HN which I keep thinking about. What is the value of expensive testing when you are promptly alerted of critical problems and can deploy in under a minute? Obviously not applicable for every scenario, but at this point I think for most non critical systems a good rollback/plan B is at least as important as testing.

> What is the value of expensive testing when you are promptly alerted of critical problems and can deploy in under a minute?

Because your users should not be your testers and you must catch bugs before deploying them in production.

You may be able to deploy in 3 minutes but it takes way more to debug and fix your bugs.

Testing helps the project to catch bugs prior to deploying them and also provides the infrastructure to avoid regressions.

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

#384

Earlier quoted context omitted.

React isn't really object-oriented. Components rarely pass messages to each other. Instead, the way that data flows is through function/constructor arguments. You can directly invoke a method on a component, but that's only really used as an escape hatch. It's inconvenient, and IMO, a code smell. For the React that I write, class components are used only when there's some trivial local state that I don't want to put…

> React isn't really object-oriented. I don't do web development but I've read react API docs and user guides. Objects calling other objects is optional for OOP, I never saw a definition that requires them to do. OOP is about code and data organization. Objects and methods are everywhere in react. Some are very complex. Just because it uses a few lambdas doesn't mean it's not OOP. For reference, here's now a non-OOP…

> Objects calling other objects is optional for OOP, I never saw a definition that requires them to do. OOP is about code and data organization.

Smalltalk, which is the prototypical OO language, does the exact opposite of everything you said (all computations happen by message passing and all members are public).

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

#385

Earlier quoted context omitted.

> React isn't really object-oriented. I don't do web development but I've read react API docs and user guides. Objects calling other objects is optional for OOP, I never saw a definition that requires them to do. OOP is about code and data organization. Objects and methods are everywhere in react. Some are very complex. Just because it uses a few lambdas doesn't mean it's not OOP. For reference, here's now a non-OOP…

> Objects calling other objects is optional for OOP, I never saw a definition that requires them to do. OOP is about code and data organization. Smalltalk, which is the prototypical OO language, does the exact opposite of everything you said (all computations happen by message passing and all members are public).

> does the exact opposite of everything you said

No it doesn’t.

> all computations happen by message passing

I did not say message passing is required to be not present, I said it’s optional.

> and all members are public

I did not say anything about encapsulation. I said OO is about organization of code and data. If you have classes with properties and methods, it’s OOP.

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

#386

Earlier quoted context omitted.

I guess... though I’ve always found C++ libraries to be light years easier to manage than python. To be honest, the per-language package management seems wasteful and chaotic. I must have a dozen (mutually compatible) of numpy scattered around. And why is pip responsible for building FORTRAN anyway?

You think dealing with C++ libraries is easier than "pip install "?

The happy path (apt-get install, or even ./configure && make && make install) is about the same.

When things go sideways, I find troubleshooting pip a little trickier. Some of this might be the tooling, but there's a cultural part too: C++ libraries seem fairly self-contained, with fewer dependencies, whereas a lot of python code pulls in everything under the sun.

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

#387

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…

This sounds fascinating. Do you have a write-up where you go into more details? A couple of examples with before and after perhaps? Seriously that would be amazing.

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

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

I already asked about this in the parent post that refers to Erlang, but do you happen to have a write up by any chance, where you go into more details. I’m super interested! It would be really appreciated. (This is not the first time I hear people praising Erlang in comparison to popular OOP languages)

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

#389

DDD - Domain driven design. My entire career pivoted the day I worked with a team that was building a large financial system (ie: multiple teams around the world, hugely complex set of business domains, zero margin for error). The entire approach to code, thinking, and organisation meant that a code base that could easily be a mess at 1/10th the scale, was maintainable and actually increased velocity of the teams ove…

Similar experience for me, I was about to lose faith in sw dev, then DDD, Greg Young, Eric evans, Alberto Brandolini and many others saved me

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

#390

Earlier quoted context omitted.

You know, sometimes people have to fix trashfires; that doesn't mean they'd start one. What fundamental changes do you see since 2.2? If you're talking about the object model; objects in python were garbage before and after 2.2, and as a paradigm, it's mostly useless bureaucracy. Bleeding edge 90s ideas.

Sorry but yes, if you're fixing "trashfires" in python, you're using python. And the literal introduction of objects does fundamentally change a programming language. Honest question: How old are you?

Whoa—you crossed into getting personal here and got personally nasty soon after. That's bannable territory. No more of that, please.

https://news.ycombinator.com/newsguidelines.html

Post reply on HN