Hacker News new | ask | show | jobs
by teiferer 7 hours ago
> learn a new programming language. I collected quite a few and it was fun to learn new paradigms

Let's be honest here: how many actually distinct paradigms are we really talking about here? I challenge you to name more than 5 which are not just flavors of the same core approach. Bonus if they are actually all relevant for production software.

3 comments

The old ones are so ingrained it seems hard to imagine they were new at one point. But generally, assembly, top down programming (structured functions, modular hierarchies, no goto), bottom up programming (easiest to feel in Lisp or Python, doable in C after your first few programs, and arguably the basis for agile, the real version), object oriented (keep you verbs in your nouns), functional as pure compute (useful even in C) and functional as a bunch of chained standard meta functions (Haskell and ML and those ilk), closures/let over lambda (super powerful Lisp and what I think let JavaScript become excellent; let your verbs have the nouns they want), repl oriented programming (Python and lisp, and as a very fast way to explore a new interface from the bottom up), stack languages (Python, forth), interpreted VMs (Python again and JVM at first, many small weird examples at work), wrapping IO around poll/Linux type mechanisms (Node, gevent, high performance C), threads (so many thread per request frameworks), green threads(go, modern Java), declarative languages (prolog and Terraform), embedded languages for easy customization (TCL/Lua).
Python, Go, Rust, Lua, Racket, and of course Pony.

Python and Lua being probably the most similar of the bunch. The point is not that you would use any of these production (although you could), the point is to get your feet wet in a new setting. You see what's different and what's the same. I think it's a very important part of maturing as a programmer.

> Python, Go, Rust, Lua, Racket, and of course Pony.

I was asking about paradigms. These are 6 languages and the distinct paradigms they cover are hardly 6. Unless we have different notions of what a paradigm is.

I see imperative and functional paradigms covered in your list. Am I missing anything else? Object orientation could be counted as a separate paradigm but how much different that is from basic imperative programming is already somewhat debatable.

> Object orientation could be counted as a separate paradigm but how much different that is from basic imperative programming is already somewhat debatable.

There’s OOP with message passing (Smalltalk, Objective C) and there’s OOP with functional flavor (CLOS in Common Lisp).

I do agree that collecting paradigms is more interesting than collecting languages. Like logic programming (prolog), array and stack programming (uuia).

> Bonus if they are actually all relevant for production software.

Why it should be relevant for production software?

Because I find that an interesting question. There are lots of experimental and somewhat esoteric things out there. And sure, it can be fun learning about them. But the proof is in the pudding, and if something is rarely useful for anything in production then it's more of an artisan entertainment factor and less of an actually useful programming language.
> But the proof is in the pudding, and if something is rarely useful for anything in production then it's more of an artisan entertainment factor and less of an actually useful programming language.

That's not true at all. In first place, what you can think is good for production, i can think otherwise.. Beside it there is a lot of things/paradigms/languages that we learn, to help us to either understand better the basics or because it is easier for beginners. There are a lot of Science and Research that you can just throw away, but that was super important for further development. Pascal, Smalltalk, Minix are example of technologies, that we learn(ed) and not necessary are widely used in production. Haskell helped me to understand is pure immutability is actually practical or not, and so on..