Live data from Hacker News

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

news.ycombinator.com

81–90 of 91 posts

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

#81
post #75

Earlier quoted context omitted.

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…

The problem, I think, is that OOP is teach with lots of inheritance. And people think is all about inheritance, and is the only valid tool. Correctly (sparingly) used is ok, but 99% of the time is over used. That is the "All has to inherit from something" illness. Another thing that is overused is hiding: all has to be private, all accessed through getters/setters, all so deeply hidden as possible... OOP has good ide…

Agreed. OOP is a valid tool and we use tools to solve problems but the moment it becomes a wrong tool to use is when you find yourself trying hard to retrofit the original problem only so that it can match your abstract OOP puzzle. That's just calling for more problems in my experience.

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

#82
Easily this was the idea that maybe OOP wasn't the solution to everything. It's not exactly a paradigm, but more of a repudiation of one. I still write a majority of my code in classes. But you can see a lot of other influences as well: the command pattern (which is more procedural I would say), a lot of LINQ expressions (which are pretty functional), and a whole lot of dumb records being passed to dumb functions (which I got from data oriented thinkers). Anyway the point is, it's not just one paradigm which has made a difference for me. It was realizing that there isn't one paradigm. I can freely import influences from all of them, use them where appropriate, and get a benefit from all of them. Including OOP, but not only OOP.

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

#84
The relational model.

Is so simple, that for like a decade I was using it with great success without having a clue about it.

Then when I start looking for my hobby programming language, was the one that pop-up as the easiest to implement with the greatest level of potential and expressivity. There is when I truly pay attention to the actual theory.

And the shocking part is that the theory is so small that you can put in in a single piece of paper.

Why is not more prevalent? I dunno!

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

#85

I’ll actually list 3. 1 - Smalltalk. I’ve done Python, Kotlin, Swift, C++, and Objective-C, all in various forms of real production code. The kind of OOP you do in Smalltalk is not the same as you do in other “oop” languages, which are really just Algol dirivstives with some weak sauce OO smashed on top of them like lipstick on a pig. 2 - C actually. In particular, pointer rich C. Working in some domains where we did…

Interesting that you consider Objective-C to be just an Algol derivative when it is so heavily inspired by Smalltalk and is basically Smalltalk bolted onto C. The C half of Objective-C is Algol derived, granted.

A huge amount of stuff you do in any program is logic (branching), math (add, subtract, etc), and enumeration (various forms of looping). Algol/C does all these with built in language syntax. Smalltalk though, does not. It does these very elemental things, what might make up maybe 80% of a method body, with messages (or at least the facade there of). It couldn’t do logic and enumeration without closures. Objective C did not have theses so you still did that core 80% of stuff with old fashioned C.

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

#86
post #26
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…

As a C# developer, F# is something I long to learn. I heard about F# until I had to adjust some build script which I thought is elegant [1]. I did try some F# tutorials at free time, but nothing that would make me comfortable and "click" on how to write functional code. But I long to bring some improvements to code correctness that can be statically checked by embracing immutability, pattern matching with discriminat…

Learning functional programming well is like learning algebra; it really pays off to take a theoretical course from first principles, by a teacher who can also teach you the idioms (parameter accumulators, currying, monads...)

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

#87
OOP, hands down. Though I never learned Functional (and never learned Smalltalk, for that matter. I think the OOP I learned wasn't half of what Smalltalk offered.)

I learned to program on punch cards, and the options were 'top down' ("The best way"), and bottom up ("The bad way").

Top down was hideous, because it ended up being decomposed as the next level as (1) Initialize things (2) Do what's needed. There was no clear path to subdividing the functionality.

Bottom up was worse. Ya' know you're gonna need a routine to do such-and-such, so go ahead and write it. You get to feel productive. The huge down-side was that you couldn't figure out in advance precisely what was needed, so those routines always got re-written to be amenable to what was needed at a higher level once the higher levels were written.

OOP gave me a way to think about the middle layers of a program in a way that isolated some element of what was needed and let me code it 'usably'. I could sit and think about an what kind of interface I wanted to provide, and get it right. It was also a big win to realize that even C (NOT C++) could be used in this paradigm, in terms of a boundary around the interior or some piece of functionality.

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

#88
post #33

Ruby's pry. Just dropping `binding.pry` anywhere in the code, run it and then get a full REPL with all the variables and instrospect everything with `ls`. This is why I am still coming back to Ruby and writing everything like it. In most other languages you spend a lot of time actually trying to find a way to debug properly. Happy to hear recommendations how other languages are doing it. (I know that there are debugg…

For C#/Visual Studio you can attach to a remote computer process and step through code. Lately I learned that the exexuting cursor can actually be moved back/forward and code writtrn while debugger is active (and continue execution). Neat.

As of javascript, you can hit F12 right away and dive into debugger for 3rd party site. :)

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

#89
post #69
post #26

Earlier quoted context omitted.

As a C# developer, F# is something I long to learn. I heard about F# until I had to adjust some build script which I thought is elegant [1]. I did try some F# tutorials at free time, but nothing that would make me comfortable and "click" on how to write functional code. But I long to bring some improvements to code correctness that can be statically checked by embracing immutability, pattern matching with discriminat…

One of the things that made F# "click" for me was Wlaschin's "Domain Modeling Made Functional". It's largely a focus on how to think about the underlying data, and getting in that mindset helped tremendously in feeling more comfortable with F#.

Wlaschin is also the owner of fsharpforfunandprofit.com, which I highly recommend.

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

#90
post #33

Ruby's pry. Just dropping `binding.pry` anywhere in the code, run it and then get a full REPL with all the variables and instrospect everything with `ls`. This is why I am still coming back to Ruby and writing everything like it. In most other languages you spend a lot of time actually trying to find a way to debug properly. Happy to hear recommendations how other languages are doing it. (I know that there are debugg…

Python using IPython:

  import IPython
  IPython.embed()
Or, using only the Python standard library:

  import code
  namespace = globals().copy()
  namespace.update(locals())
  code.interact("", None, namespace)
Post reply on HN