TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Opinion: In 2023 beginning programmers should be taught to program functionally

5 pointsby noob_engover 1 year ago

3 comments

retrocryptidover 1 year ago
Well. I mean. I thought this was a good idea in 1986, but people told me the future was OO and Lisp had too many parentheses.<p>Also, many people will find functional programming difficult and just give up on it. But CS students should absolutely be introduced to functional (as well as OO, logic, dataflow) paradigms and purely applicative and point-free styles.<p>But CS programs don&#x27;t even require compiler courses any more, so you can make it through a degree without ever learning parsing. CS programs are less about teaching kids CS and more about preparing them for jobs at FAANG companies so they have extra cash to donate to the alumni association or buy the alma mater a building.<p>But yeah... if you&#x27;re interested in doing a good job in software, you should do enough Lisp (or erlang or haskell or whatever) to understand why other people rave about hygienic macros, metaprogramming and &quot;the point free style.&quot; Bonus points if you can grok monads to the point you can explain it to someone else.
评论 #37339412 未加载
PaulHouleover 1 year ago
Oh god, all those functional examples w&#x2F; the Fibonacci function are malpractice. This was a big fight in the early 1980s because people who liked languages like Lisp and Logo were really pissed because Microsoft BASIC was everywhere.<p>The old way iterative we did it in BASIC or FORTRAN was better. Back in the 1980s the best &quot;functional&quot; examples involved drawing fractals, something that could drive you crazy if you tried to do it in BASIC.<p>If you are really smart you will use the closed form for Fibonacci which I think involves some really cool math<p><a href="https:&#x2F;&#x2F;fabiandablander.com&#x2F;r&#x2F;Fibonacci.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;fabiandablander.com&#x2F;r&#x2F;Fibonacci.html</a><p>I have met so many young programmers who wander from job to job like itinerant martial artists looking for the true functional programming enlightenment and never finding it because... it doesn&#x27;t exist. Functional and OO both started in the late 1970s and OO has prospered more because it is the key to writing simulations, graphical UIs, and many other kinds of programs. There are a lot of great ideas that came from the ML languages that are absolutely mainstream today, like algebraic types and pattern matching and you are seeing these being carefully weaved into languages like Java and Python right now. (Turns out those ideas from ML are really convenient for writing compilers!)<p>As @retrocryptid works around, you get real enlightenment from learning how compilers work, which is a bit advanced for the beginning programmer but you might be able to show people the power of interpreters early on. At my high school (that I attended part time in the 4th grade) we ran BASIC on an old PDP-8 and would draw &quot;graphics&quot; on the line printer with a simple DSL that came to a list of statements to the effect of &quot;draw + 35 times, draw a space 15 times&quot; which exposed us to some of the discipline involved in more complex programs. (Those old adventure games like Zork and the Scott Adams games always involved a specialized interpreter because without OO functionality it would be terrible to try writing that in BASIC, FORTRAN or Assembly.)<p>Start with &quot;a monad is like a burrito&quot; and you will lose even more people in CS 101 than they lose already.
b20000over 1 year ago
no, beginning programmers need to learn negotiation, marketing and sales skills