3 ms·
Here we go again. I will note that this is from 2002. But the fact that it is being recirculated now suggests that this is a timely topic. I've been a program
by gspencley 4y ago
Here we go again.
I will note that this is from 2002. But the fact that it is being recirculated now suggests that this is a timely topic.
I've been a programmer for 30 some odd years. 25 of those professionally. I started on BASIC, learned C as fast as I could because I wanted to program games and all the cool kids were writing games in C. Then OOP became hot and I learned C++ and Java and was introduced to OOP design patterns and threw myself into studying Gang of Four, PLOPD and other classic works on the subject.
Yes, I remember the "hot-ness" of OOP in the 90s. Next, Java, even the marketing forces that led to calling ECMAScript "Java"Script and shoe-horning objects into what was intended by Brenden Eich to be a functional language came out of this idea that OOP was the next big thing in software development.
But what I don't remember was anyone, at any point in my 25 year career history, saying that OOP is the "only way."
In fact, I remember having a keen interest in LISP and FP as an aspiring novice in the 90s. I wanted to learn everything about languages, language theory and computer science that I could. People encouraged me to pursue that and never once said "stick with OOP and forget other paradigms."
But what I do see today, are people being so trendy and fashionable that they ARE saying these things about Functional Programming. OOP is being thrown with the bathwater HARD while people claim that it has "failed" and that everything should be Functional.
Both paradigms solve problems in different ways, have their own strengths, weaknesses and value judgments. OOP values custom types and encapsulating state whereas FP favours primitives, immutability and statelessnes. OOP sees conditional logic and the root of all complexity whereas FP views state as the root of all complexity. Neither is right or wrong and both points of view are provide better tradeoffs in different situations.
In other words, do your job as an engineer and pick the right tool for the problem at hand. Stop pretending that we are going to achieve some utopian panacea where we finally resolve the Church / Turing hypothesis and can say, objectively and absolutely, that one approach is always better in every situation.
- renlo 4y agoIf your first language is Java, like mine was, then you're not even taught that there is anything _but_ OOP. It seems to me that OOP is foisted onto newbies who don't know anything else exists (why would they?), by teachers/instructors/programmers who love OOP.
- zabzonk 4y agothe teachers probably know nothing else either. having said that, i started out with procedural programming in basic, fortran, assembler and c, but when c++ came along i saw immediately that classes were a (note "a", not "the") very good way or organising code for larger projects, and i still think they are. but when i was exposed to java my very first thought was "but i don't want everything to be a class!"
- zabzonk 4y agoone of the big problems about deciding what is the "best" approach is that there is no way of doing this objectively, scientifically or logistically. who is going to pay to have multiple teams implement a complex solution using multiple approaches? and even if someone were mad enough to do this, it would prove nothing, as the teams would be made up of different people.
- Nevermark 4y agoThe solution to this would be languages that made different paradigms easy to use, and easy to use together. I.e. the problem you are pointing out is currently using different paradigms together means bolting disparate languages and tools together, and all the accidental complexity, glue code and cross-tool knowledge that demands. Which is a significant challenge, indeed.
- zabzonk 4y agowell, no, i don't think that is what i am pointing out. and of course some languages (for example c++) are explicitly multiparadigm.
- Nevermark 4y agoAh, yes I see that. C++ and even C. I think Lisp - aside from not being as low level - also is fantastic for easily creating different coding paradigms, with the advantage that code is naturally directly manipulatable. But C or C++ can easily recreate Lisp type computation as well.