Live data from Hacker News

Which programming paradigm had the most impact on you as an engineer and why?

news.ycombinator.com

51–60 of 91 posts

Re: Which programming paradigm had the most impact on you as an engineer and why?

#51
Object oriented programming, though not the Java BeanCakeFactoryFactoryInterfaceProvider approach. It isn't exactly Java's fault though, it is just common there - but there are exceptions (see Swing vs SWT, with the latter having a much simpler API or LWJGL which has a very simple API itself). Also i don't really do the whole patterns thing (unless accidentally) nor all the acronyms (i don't care about things like LSP, SOLID, etc, i mainly keep related things together and use inheritance for specialization).

Of course i don't do OOP for the sake of OOP, i stick with simple procedural code where it makes sense, but for some things (e.g. GUIs) other approaches feel like trying to shove a square peg through a round hole.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#52
Not a proper paradigm, but I will say test-driven-development. They didn't teach that to us at University, or I was not paying attention when they did. I had to learn it afterwards.

I struggled with it for months. Only started seeing the benefits way after. An exercise on delayed gratification. I think its main difficulty is that it requires "learned intuition" - knowing which tests to write first, and which ones to build afterwards. It's a bit like solving integral equations - apply the "right" transformation and you get to the result in a few steps, fail to see the pattern and you'll have a hard time.

Perhaps I didn't find the right resource. I won't say that I use it every day, but it is certainly at the top of my toolbox.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#53
post #39

It's interesting to see how many people in this thread have had negative experiences with OOP. As much as I don't do OOP that much anymore, I think it had a positive impact in me. But like every popular practice, there is a lot of bad patterns you have to navigate through. Things like depending on interfaces as opposed to concrete implementations; or prefer message passing over direct data access are practices that I…

I agree. Hating OOP is somewhat mode du jour, but if you started out from languages like FORTRAN and C as I did, you organised your code around abstract data types and operations to work on them (including mechanisms like passing 'this' as the first arg, composition of structures and common operations). OOP was a completely natural extension.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#54
post #52

Not a proper paradigm, but I will say test-driven-development. They didn't teach that to us at University, or I was not paying attention when they did. I had to learn it afterwards. I struggled with it for months. Only started seeing the benefits way after. An exercise on delayed gratification. I think its main difficulty is that it requires "learned intuition" - knowing which tests to write first, and which ones to…

test driven development definitely changes things. It's not just a way to reduce bugs but it also changes the way the production code is written in terms of design/architecture.

I suggest you to also look into type-driven development (it is orthogonal to test-driven development). Essentially it does the same but on the type-level not on the implementation-level.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#55
Paul Graham's book Hackers & Painters resonated with me as a teenager, more specifically what he wrote about how code is like paint, or clay. Writing software is like writing essays: you make drafts, iterate, kill your darlings, and even though you may have a single goal in mind, a point to make, things seldom have a definite form. It's an art. It's more of a hacker's mindset, perhaps, but I keep it close to heart still because it's how I stay sane in this business.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#56
"Reactive" sutff. Bad impact. Programmer for 30 yrs and while it theoretically makes sense, pratically it's all a shitshow so i made a very simple js framework thats all "imperative" like Android (findView, setText, etc etc.) just for myself.

Been making a living migrating react and vue overengineered projects that are supposed to be small to this with much succe$$.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#57
post #4

Functional programming. I learned OOP in school, and always thought it overcomplicates things, why can't this comparison operator in one page of Java just be a function, I thought. How can you make the state of objects manageable, especially if it's private, how do you test, without opening up too much of the API, couldn't we just make this a set of functions with an explicit state so it's easier to understand? How d…

I feel the same way for OOP paradigm but I found it's usually hard to argue against it because it seems to be so ingrained into people's minds. After all that's what we are taught in universities and presented as a first go-to toolbox so it's no wonder.

I'm guilty of that defending attitude too but after probably several hundreds kLoC of OOP style and utilization of whatnot design patterns I've came to realization that it's mostly great for overcomplicating stuff for no materializable advantage.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#58
post #4

Functional programming. I learned OOP in school, and always thought it overcomplicates things, why can't this comparison operator in one page of Java just be a function, I thought. How can you make the state of objects manageable, especially if it's private, how do you test, without opening up too much of the API, couldn't we just make this a set of functions with an explicit state so it's easier to understand? How d…

I feel the same way for OOP paradigm but I found it's usually hard to argue against it because it seems to be so ingrained into people's minds. After all that's what we are taught in universities and presented as a first go-to toolbox so it's no wonder. I'm guilty of that defending attitude too but after probably several hundreds kLoC of OOP style and utilization of whatnot design patterns I've came to realization th…

I think the problem is that OOP is mostly taught as a separate paradigm, when it should be seen as a convenience layer over procedural imperative programming. It is about bundling procedures together in groups, associating them with mutable state, and protecting and encapsulating that state from other pieces of code.

Re: Which programming paradigm had the most impact on you as an engineer and why?

#60

First pure functional programming (not just functional programming) and then type driven development with a typesystem that supports dependent types. In combination they are a huge productivity boost that you can't really imagine without having tried it. I still remember the days where I wrote tests over tests and ran the system to check if it works. But "if it compiles it works" is just a sooo much smoother workflow…

What languages specifically do you have in mind?
Post reply on HN