Live data from Hacker News

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

news.ycombinator.com

21–30 of 91 posts

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

#21
For me, more than any paradigms, the following outlooks were the most useful -

1. YAGNI - plan for the future if required but only implement once it arrives.

2. KISS - Keep things as simple as possible. For example, f you have to generate 50 forms for 50 different use cases, build 50 forms. Don't try to create a generic dynamic form.

3. Tests - Not necessarily TDD, but there should be tests for when you think your module / function has been done. This will ensure your edge cases are considered. Try NOT to fix a bug without adding to your tests.

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

#22
Only paradigm isn’t enough. Language design, ecosystem and pragmatism is essential as well and Clojure has all that.

After a couple of years of writing Java in my late teen, early 20s, I observed considerable overhead and inefficiency while working on large Java projects.

I thought we shouldn’t have to recompile the whole project upon every single change.

Classes and private public fields, methods felt like they were solving the wrong problem.

Other fancy words, that contained fairly simple ideas, felt like the output of clever language designers who enjoy the sound of their voice.

Those were the issues I observed as a newbie, but still I started looking for alternatives and found Clojure fairly soon. Sense of satisfaction steadily grew as I dug deep into the language, it was addressing so many design decisions I questioned before. At some point I started re-writing core library and it was joy to see how simple a programming language can be.

I wrote software in many different programming languages over the years but writing Clojure at work is fun, multiplied.

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

#23
Uncle Bob's "Extract Till You Drop" which suggests breaking down large chunks of code into multiple, single-task functions (i.e., when describing a function, you should rarely if ever be able to say it does this and this).

I went from creating messy, frustrating code to well-organized, easy to debug modules that (have) run w/o issue for years. At first it seemed like overkill, but the sheer speed of bug fixes 10x'd overnight for me. I haven't looked back in 5+ years.

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

#24
I don't know if I can say.

A lot of things that have been mentioned like FP and TDD and whatever can bring new perspectives because they force you to break your existing programming patterns, but I also think that is the main benefit, not the paradigm itself. This is also the benefit from (the increasingly contentious) Clean Code. It's basically a bunch of rules that force you to break habits, even though it's easy to conflate that with benefits from the paradigm-change.

It's difficult to improve when you're basically just building the same program over and over. That's what I'll argue is the benefit from switching paradigms; you can't keep doing that, so you're nearly forced to learn new things.

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

#25
The ability to freely mix programming paradigms and to bend the language towards the problem instead of the other way around. It's the thing that Common Lisp is kind of famous for.

Depending on the programming sub-sub-task that I'm working on right now, I can have simple state machines written with explicit GOTOs, algorithms working on immutable state and written in functional style, minor operations in these algorithms implemented with a functional shell but imperative core, the ability to do declarative programming and define my own syntax for the declarations while I'm at it, and the ability to always branch off to a task-specialized DSL whenever it brings direct benefits to the table.

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

#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 discriminated unions where compiler ensures you have handled all cases, typing system which makes illegal state impossible... those are just some features I spotted could be very useful. On top of that, F# code seems so much shorter.

[1]: https://github.com/jordimontana82/fake-xrm-easy/blob/master/...

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

#27
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 LOTs with pointers (vms and the like) gave me a practical understanding of the general computation model of Chios in general. After I worked with pointers a lot, assembler, though arcane, just suddenly clicked.

3 - Currently Elixir. It’s pragmatic approach to functional fascinates me. I don’t have to become a type theologian to participate. I just get to try and solve problems with function pipelines, ubiquitous immutability, no return statements and everything as an expression.

And though each of these paradigms is very different, they all have pushed my mind the most. It’s interesting that whole different, they’re each “simple” but powerful paradigms maxed out in the interest of consistency.

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

#28
Definitely object oriented design, in a negative way. It taught me how I do not want to think about a computer system. All its ideas sound so neat and if you have a well designed system, which never needs to change, it might even work. But someday, somewhere you might realize that some functionality means none of your abstractions made any sense. The idea of combining functionality with state (classes) was definitely a useful one, but you shouldn't use a hammer as a screwdriver.

I have a lot of positive things to say about procedural programming. It is perhaps the easiest and most straightforward way to think about computation. The more abstract the problem gets the more I start to think about it in functional terms, it allows you to construct the flow of data in a very managable and efficient way.

Post reply on HN