[HN Gopher] Ask HN: Is SICP/HtDP still worth reading in 2023? An...
___________________________________________________________________
Ask HN: Is SICP/HtDP still worth reading in 2023? Any alternatives?
I'm a self-taught programmer but I recently realized I need to
really understand how to write programs elegantly. GPT-4 was a huge
motivation for this because whenever I asked it to rewrite the code
like a professional Python programmer, it would come up with
amazing things. But after GPT-4 became nerfed by OpenAI, I felt a
void: how can I keep writing elegant programs? My answer is: I
should learn how to do that myself. SICP uses Scheme, which I
don't mind. My main concern is that it's an old book. Are there
ideas and concepts not discussed in the book which are crucial in
today's programming landscape? Will I be better off reading a book
that uses Python in the first place?
Author : behnamoh
Score : 75 points
Date : 2023-07-20 16:06 UTC (6 hours ago)
| karakot wrote:
| Concepts, Techniques, and Models of Computer Programming is also
| a great book.
| iainctduncan wrote:
| oh thanks, I don't know this one!
| Al0neStar wrote:
| This is a hardcore book.
| sn9 wrote:
| For those interested in working through all three, the order to
| do so would be HTDP -> SICP -> CTMCP.
| billfruit wrote:
| Perhaps even better than the the other two.
| Buttons840 wrote:
| SICP gets challenging in the very first chapter. You should aim
| to do about 1/3rd of the exercises, knowing that you can come
| back and do more later. The first chapter will certainly improve
| your ability to reason about recursive code. If you lose
| motivation later in the book (like I did), you will still have
| gained something.
| rg111 wrote:
| This.
|
| I wish I learned it earlier in my life. Before I realized what
| you said, I procrastinated on so many books and never started
| many I wanted to read.
|
| After I realized this, I finished way more books, and learned
| many new things even when I didn't finish books. You don't need
| to finish books to learn new things that make you better.
|
| Even you read four chapters of a book, you are still those four
| chapters wiser than yourself who hadn't read those four
| chapters.
| omnicognate wrote:
| Since, astonishingly, neither full title is mentioned in the post
| or the comments:
|
| SICP = Structure and Interpretation of Computer Programs:
| https://mitp-content-server.mit.edu/books/content/sectbyfn/b...
|
| HtDP = How to Design Programs: https://htdp.org/
|
| Sometimes I think gratuitous use of acronyms (initialisms for the
| pedants) has been the biggest impediment to learning throughout
| my career.
| parentheses wrote:
| I'm not saying text should be full of acronyms/initialisms, but
| they serve a purpose of compressing the content. Maybe the
| chosen acronyms/initialisms don't work for you and that'd be a
| fair point.
| teh_klev wrote:
| In good writing you should ideally use the full name of the
| thing you're going to abbreviate with the acronym in
| parenthesis after the initial "expanded" version. e.g.
|
| _" My article is about How to Design Programs (HtDP)..."_
|
| Then later the article: _" In the HtDP book it mentions...."_
|
| This makes life easier for those less familiar with the
| subject matter.
| krapp wrote:
| This is a technical forum, it's reasonable to expect
| readers who discuss a thread about a specific subject of
| interest to be familiar with the common vernacular and
| idioms related to that subject. If you can't understand the
| initialisms, maybe that's a sign that particular thread
| isn't for you, and that you likely have little of value to
| add.
| omnicognate wrote:
| I've read SICP cover to cover and completed every
| exercise, so I recognised that one. I had to look HtDP
| up.
| teh_klev wrote:
| This is a rather short sighted and somewhat gate keeping
| mentality. Acronyms are often contrived and separate from
| the common vernacular and idioms related to a subject
| matter.
|
| As a software developer with a forty year career behind
| me I'm quite familiar with the "SICP" book. But for some
| reason my brain won't persist the connection between the
| full title and the SICP acronym when I bump into it. Yet
| somehow I can recall what each and every assembly
| language mnemonic means across a fairly broad range of
| micro and mini computer processors.
|
| > maybe that's a sign that particular thread isn't for
| you, and that you likely have little of value to add.
|
| Sure I may not have much to add, but the reason to read a
| thread, article or essay is to become familiar with the
| subject matter because it sounds interesting. Don't
| assume your reader is an expert in decoding your special
| and often made up acronyms.
| JohnFen wrote:
| I've read and understood them both but didn't recognize
| them from the initials. In another comment here, someone
| said
|
| > TAoCP (er, Knuth's "The Art of Computer Programming")
|
| I also would not have recognized TAoCP as referring to
| the Knuth book. Not all corners of the tech world
| commonly refer to tech books by their initials. That
| doesn't mean they have nothing useful to say about them.
| JohnFen wrote:
| Thank you for this. I was wondering.
| bloopernova wrote:
| _thank you_
|
| Acronyms and initialisms _with no explanation_ are passive
| aggressive gatekeeping.
| ASalazarMX wrote:
| At least it's not as annoying as military fans, who will write
| whole sentences of acronyms and euphemisms, glued with the
| minimum of words, as if it was some secret war transmission.
|
| I think IT reached bottom when we started using numeronyms like
| L10n (localization) or K8s (Kubernetes).
| diarrhea wrote:
| Yep. I avoid acronyms as much as possible for that reason. They
| are rarely worth it. An accumulated 20 seconds saved typing is
| not worth the eventual 3 minute hunt towards deciphering later
| on.
| jonsen wrote:
| 3 min x n nor (number of readers)
| [deleted]
| vjust wrote:
| SICP is a beautiful book. The Youtube lectures are just as good.
| amackera wrote:
| SICP is an amazing book that will make you a better programmer,
| but might not help you with the task of writing better
| professional Python programs. If you aspire to understand
| computing systems from first-principles, there's no better
| resource that SICP. I've read it multiple times and I learn
| something new each time.
|
| Do the exercises too!
| f1shy wrote:
| > but might not help you with the task of writing better
| professional Python programs
|
| Let me disagree here: right now I'm doing mentoring with some
| python programmers where I work, they watch the videos, read
| the relevant part of the book, and we have a discussion
| together after each part. I hear constantly "oh yeah, I can
| apply that here or there", "this streams concept is so good",
| etc etc etc. I think it is most valuable if your background is
| "only" Algol family languages.
| cbm-vic-20 wrote:
| Likewise, TAoCP (er, Knuth's "The Art of Computer Programming")
| is even _older_ than SICP, and will definitely not help with
| writing better professional Python programs, but is steeped in
| first-principles goodness. Even so, I end up turning to it
| every once in a while; once while figuring out some tricky
| allocation code, and another to see if I could find a way to
| skip a few steps in a piece of code that needed to run in a
| tight loop.
|
| It's certainly not required reading to be a successful
| programmer in the 21st century, but like SICP, it offers a
| different way of looking at things that may help influence some
| of your decisions on how to build something.
| rsrsrs86 wrote:
| I think it won't ever hurt to know the topics in SICP. The
| interpreters and other components presented in the book will help
| the user navigate so many different problems, and the use of
| Scheme will instruct the reader in functional programming.
|
| The presentation is very gradual and easy to follow (as far as
| any text in CS can be easy).
|
| If you follow SICP in Racket, you will get know a language that
| can be used to do anything - Racket has a formidable library.
| brainzap wrote:
| not worth
| ParallelThread wrote:
| What is HtDP?
| tobinfricke wrote:
| "How to Design Programs" (https://htdp.org/)
| beeburrt wrote:
| Anyone read this one?
|
| https://cs.uwaterloo.ca/~plragde/flaneries/FICS/
|
| Functional Introduction to Computer Science
| nelsontodd wrote:
| I dont know about practicality but Ive read a good amount of SICP
| and find it very entertaining
| iainctduncan wrote:
| It is also worth reading the Little Schemer at the same time.
| That will teach you to be truly comfortable in a recursive style.
| retrocryptid wrote:
| Meh. Python is for scientists. Lisp is for engineers. Which is to
| say the languages were designed for different language design
| methodologies. In the old days of Lisp we didn't have large
| libraries of pre-existing functionality, so it was important for
| programmers to know how to construct complex functions from
| simple functions. But now we have python with its expansive
| partially documented standard and semi-standard libraries. You
| don't need to know how to rewrite that lump of functionality. You
| just need to know how to write small test programs that verify
| you understanding of how it's supposed to be used. And if you
| find you need to do something that's not supported, you just
| change what it is you're trying to do.
|
| The flip side of this is that there's a large corpus of programs
| demonstrating idiomatic python. "There's only one way to do it,"
| was a mantra I heard from Pythonistas in the 2000s. Maybe it's
| still a cultural value in that community. That would explain the
| large corpus (that and it being a popular language.)
|
| I've yet to see a LLM spit out even half-way decent Lisp (CL,
| scheme or even e-lisp). My suspicion is the corpus of available
| code is small and its language features tend to generate less
| "boilerplate."
|
| Having taught "practical lisp" in the 90s, SICP was frustrating
| because of its insistence on describing idiomatic Lisp in text,
| but with far fewer examples than comparative texts in other
| languages (k&r c or PASCAL User Manual and Report.)
|
| There seems to be a tradition of this in Scheme and CL books.
| Where you could easily find books in the 80s entitled "${N}
| PROGRAMS IN BASIC" or some such, which were useful to provide a
| corpus of idiomatic code learners could use to build an intuitive
| understanding of the language. In the Lisp world no such books
| were available, and members of that community seemed to want
| learners to develop a wholly rational approach to learning.
|
| So... if your purpose is to have a language that can be generated
| by ChatGPT, definitely pick Python. My experience with automated
| tools is they absolutely do not understand how to refactoring
| lisps effectively.
| nickpsecurity wrote:
| "Python is for scientists. Lisp is for engineers."
|
| Then what does that make Hy language?
|
| https://hylang.org/
|
| Re Languages with lots of example code and LLM's
|
| With translators or things like Hy lang, one could get the
| LLM's to solve your problem in Python before converting it to
| another form. Then, you just need a translator. If lacking one,
| it's easy to translate by hand.
|
| The practicality of this concept will probably vary by use
| case. My experiments had GPT doing sketching, implementations,
| boilerplate, and even porting Python to Rust. A legally-clear
| LLM trained on multiple languages could probably be fine-tuned
| to do Python to LISP conversions. If not, Hy might be a
| stepping stone, too.
| galkk wrote:
| If you will go past first chapter, you will find wealth of
| knowledge, that is not programming language/api/backend/frontend
| specific. SICP is a book that is a bit hard to start.
|
| This is a thing that I miss about C++ programming language, third
| edition by Stroustrup. The "Design using C++" section of about
| 100 pages in the end made me, at a time, better programmer. I do
| not read it now, though, to keep my good memories about it =)
| webnrrd2k wrote:
| I haven't started it yet, but I have great expectations of
| "Software Design for Flexibility: How to Avoid Programming
| Yourself into a Corner" by Hanson & Sussman.
|
| Hopefully someone else can provide a review?
| thatcherc wrote:
| I'm reading that right! It's cool. It's all Scheme, so get
| ready for that if you haven't seen it before. It's really
| interesting stuff though, all about how to make really
| extensible systems. I'm not sure how much I'll use the tools it
| talks about day to do, but it is really neat to have a much
| deeper understanding of things I often take for granted like
| pattern matching (regex) and generic dispatch and games solvers
| can be implemented from directly scratch.
| f1shy wrote:
| If it is just as a gentle introduction to lisp, and you go ahead
| a little bit with "Practical Common Lisp" to learn CLOS, I think
| it will pay off every second you invest in studying it.
|
| And that is just taking advantage of 1% of it.
| miki123211 wrote:
| > after GPT-4 became nerfed by OpenAI
|
| Care to elaborate on this? I didn't have access until recently,
| is there really that much difference in performance?
| memco wrote:
| There are versions of SICP adapted for Python like this one:
| https://www-inst.eecs.berkeley.edu/~cs61a/sp12/book/ and
| https://wizardforcel.gitbooks.io/sicp-in-python/content/.
|
| I can't compare them to SICP, but if your only concern is the
| relevance of the examples then these may be worth looking into as
| a supplement or replacement for the original.
| e12e wrote:
| I'll just add, that if you would like to read clean python
| (incidentally often about natural language processing) Norvig's
| work is well worth a look - explified by the essay on writing a
| spell-checker:
|
| http://norvig.com/spell-correct.html
|
| Now dominated by notebooks, linked to from norvig.com:
|
| https://github.com/norvig/pytudes#pytudes-index-of-jupyter-i...
| daggersandscars wrote:
| Background: SICP was the textbook for my undergrad intro to CS
| class, though I was already a self-taught programmer at the time.
|
| SICP provided a different way of understanding programming. I
| enjoyed the class, did well, and became a big fan of Scheme for
| quite some time.
|
| But the text was written for a different era, one dominated by C,
| PASCAL, and COBOL and when parallel programming was rare. In a
| time where almost all programming required working with low-
| level, basic programming constructs designed around the CPU's
| architecture, using Scheme to teach future non-academics was a
| great way to open their eyes to different ways of thinking about
| programming.
|
| But it's close to the 40th anniversary of the first edition and
| past the 25th anniversary of the second. A four core CPU is
| low(er) end. Phones have 4+ cores. Even watches have dual-core
| CPUs. Ruby, Java, JavaScript, Python, Go, Rust, and a zillion
| frameworks are all available and widely used.
|
| It wasn't possible to get performant Scheme on the hardware of
| the time. Now that we have the hardware, other languages have
| taken what Scheme could do and done it better.
|
| Are the concepts useful? Certainly. But if your goal is to be a
| better programmer now, I'd pick a different book. If you're a
| Python programmer, pick a (modern, recent) Python book. If you're
| a JavaScript dev, then a (modern, recent) JS book.
|
| If SICP was teaching woodworking, it would be the no power tools,
| start with a standing tree method. It's fascinating, it's neat,
| there are cool concepts to learn. But it's of little relevance,
| day-to-day, in a world filled with tools that let you focus on
| the goal instead of a million tiny details.
| [deleted]
| debaserab2 wrote:
| aside from the fact SICP now has a javascript edition, if you
| pick a book that focuses on whatever random modern
| javascript/python programming language you're not really
| studying anything like the material in SICP.
|
| SICP is more like studying the actual composition of wood
| itself than it is about tools. this is still important whether
| youre using new or old tools.
| dreamcompiler wrote:
| And because javascript has real lambdas and lexical closures,
| you probably lose less studying SICP in JS than you would in
| e.g. Python.
| rfrey wrote:
| Starting with hand planes, dovetail/carcass saws, and
| chisels... and then moving to a table/bandsaw, jointer, planer
| etc. IS the best way to learn woodworking. Diving into riving
| wood, green joinery, etc. brings you to the next level.
|
| Power tools are accelerators, not fundamental tools. Your
| analogy of woodworking is excellent, but I believe you draw the
| wrong conclusion from it.
| bmitc wrote:
| Your only critique is that SICP is old. Computing power and
| performance are irrelevant to SICP.
| f1shy wrote:
| Not only that. Now _precisely_ because multicore is the only
| path to follow when we reach the end of the Moore's law, we
| need more than ever functional programming. Is no coincidence
| that there are so much new languages that are trying to use
| those concepts, including a big revival of Lisp.
| agomez314 wrote:
| This so much.
| olddustytrail wrote:
| Multicore is a continuation of Moore's law not its end.
| david2ndaccount wrote:
| Functional programming doesn't help with multicore. The
| real problem with multicore programming is data dependency,
| of which mutability is merely a special case. functional
| programming doesn't help prevent you from depending on a
| certain computation and forming the bottleneck of your
| program.
| 7thaccount wrote:
| There's a big revival of lisp?
| gumby wrote:
| Many ideas that come from lisp, and for which lisp was
| long ridiculed, are now mainstream, like garbage
| collection, closures, a big runtime, a _huge_ library
| (nowadays lisp is criticised for its small library),
| typed data (instead of typed storage), exploratory
| development in an interpreter coupled with an optional
| compiler...
|
| I don't consider languages with these features lisps, but
| I think the GP's statement is only quite mildly
| hyperbolic.
| bigfishrunning wrote:
| > focus on the goal instead of a million tiny details.
|
| This attitude is why my 16 core machine with 100Gb of ram feels
| about as fast as my Windows 95 machine felt 25 years ago. It's
| why software seems to scale with the computers that run it.
|
| GP: Read SICP. even if you don't end up writing any Scheme,
| you'll be a better programmer for it.
| LoganDark wrote:
| there are a couple reasons to read those books, but the most
| important reason is simply to expand your wealth of knowledge.
| will you be writing scheme? probably not. will you benefit from
| knowing all the algorithms and practices that were used back when
| scheme was more common? almost definitely. because even if you
| don't use those algorithms and practices, they will surely inform
| your opinion of which algorithms and practices you do want to
| use.
|
| i say this as someone who has not read either of those books and
| doesn't even know what the acronyms refer to: knowledge is good.
| it'll take you many years to re-learn the knowledge that is
| already written in those books if you don't read them.
|
| there is a practical limit to how much knowledge you can just
| throw into your brain, but these surely must be some important
| and well-renowned books if you throw out the acronyms without
| clarification, so i doubt the ROI could possibly be negative
| starside wrote:
| I think so. Let me ask you this, what changed that would make it
| irrelevant? There have not been any earth shattering advances in
| language design that make it obsolete.
|
| It may not align with your ambitions as a programmer, but math
| and functional programming still apply.
| wk_end wrote:
| SICP is a great and mind-expanding book; but I came to it fairly
| late, at a time when (I think, I hope) I was already decent at
| "elegant" programming, so it's hard for me to say if it'd help
| you program elegantly. Probably, but I don't think that's one of
| its chief concerns.
|
| On the other hand - HtDP is explicitly focused on teaching you
| patterns of thought that will help you create well-structured
| programs. It's also significantly easier, so I'd recommend it for
| your purposes full-throatedly.
| Agingcoder wrote:
| Edit: I'm essentially self taught as well, apart from one class
| about algorithms.
|
| To a large extent, reading books about old tech is still
| interesting- you'll just have a better appreciation of what you
| have now, how it came to be, and what was explored before. It
| will also show you a simpler version of what you have now, so
| easier to understand: reading the manual of the 6502 or i386 is
| not the same thing ( a single readable text file ) as the many
| manuals of the latest Intel CPUs, totaling thousands of pages !
|
| I grew up reading manuals of old computers, old computer
| magazines, books about random tech ( from expert systems to
| system programming in pascal, prolog, etc ) because my father
| would buy random books. I've never regretted doing so, it just
| gave me a broader overview of what was possible.
|
| In any case, sicp is great, just read it.
| bmitc wrote:
| The concepts in SICP are timeless. There's nothing to be lost
| going through that book.
|
| There are video lectures you can use to accompany the book:
| https://youtube.com/playlist?list=PLE18841CABEA24090
|
| Also, I highly recommend the courses _How to Code: Simple Data_
| amd _How to Code: Complex Data_ on edX that are based on HtDP.
| scns wrote:
| Second that recommendation. Kiczales is a great teacher, IMHO.
|
| https://en.wikipedia.org/wiki/Gregor_Kiczales?wprov=sfla1
| tobinfricke wrote:
| As if to prove your point, those video lectures are from
| _1986_.
|
| I took the course in 1999.
|
| And yes the material is just as relevant today.
| jstx1 wrote:
| Not necessarily as relevant, programming has changed a lot
| since SICP came out. Sussman says so himself -
| https://youtu.be/OgRFOjVzvm0
| db48x wrote:
| Did geometry become irrelevant once we stopped caring about
| field boundaries along the flooding river Nile?
| joaogui1 wrote:
| I think the real comparison is "has the proportion of the
| population that needs to know how to take care of farm
| animals gone down?"
| Al0neStar wrote:
| A great book by one of the auhors of HtDP is DCIC and it uses a
| programmimg language called Pyret and chapter 3 covers a
| transition from pyret to python.
|
| https://dcic-world.org/2023-02-21/index.html
|
| Do you have any examples you can share of GPT4 being degraded?
| jstx1 wrote:
| I'm not convinced that they're worth it for people who know how
| to program. If you want to write better Python at work, learn how
| to write better Python at work; don't waste your time on learning
| how to write a loop in scheme.
| agomez314 wrote:
| If you want to write professional python code, read python books
| and courses. Take algorithms and data structures courses. Take
| compiler courses if you so choose. Work hard to be the best you
| can at your work. If you are doing all this, feel free to glance
| over the first chapter or two of SICP, it's Calculus concepts and
| esoteric explanations will probably turn you off. If you're
| foolish enough to continue, don't, it will take over your
| precious time and learnings you could invest in the newest
| frameworks and LLMs, which make you into a more productive
| programmer anyway. If the first chapter of SICP is still echoing
| in your mind about "procedures as general method" and you
| daydream about opening and closing parenthesis, then it'll open
| up your mind to pleasures of programming you never new existed
| and stay with you forever. Your code could probably improve too,
| but in a tangential sort of way. SICP is the best programming
| book i've ever read, and one of the best of any kind.
| brudgers wrote:
| The best way to decide if a book is worth reading is to start
| reading it.
|
| If it isn't stop and set it aside for later. Because your future
| self might be one of the people who thinks it is worth reading.
|
| If it is, keep reading until it isn't. By "keep reading" I don't
| necessarily mean reading as if cramming for an exam. It's ok to
| read books slowly. Just as it is ok to not finish books
| (sufficiently slow reading is indistinguishable from not
| finishing a book). Good luck.
| JohnFen wrote:
| I agree. I'd also add that it's useful to skim through such
| books as well, maybe casually reading things here and there
| that catch your attention.
| rdelpret wrote:
| Is there any concrete evidence that GPT-4 was lobotomized?
| ShamelessC wrote:
| (No)
| neilv wrote:
| Try SICP at some point, no matter what else you learn.
|
| HtDP is also worth taking a look at, and is much easier than
| SICP.
|
| LLMs will mostly statistically plagiarize code. (Some people will
| rationalize "The tool generates the boilerplate, so that I can
| focus on the harder problems, because I am a mental giant who is
| above mere coding, and this is totally not open source code
| laundering", and then slap the code into a Git commit with their
| name on it, while making "cha-ching" cash register sounds.)
|
| Instead of LLM, if you want to learn from other people's open
| source code, you can just read it in the original form (and not
| pretend you wrote it).
|
| You can also practice writing your own code. Find things you want
| to do, and instead of using an LLM or Googling for something to
| copy&paste, _work through the problem yourself, and build that
| understanding and mental machinery_.
|
| And when that starts getting routine, experiment with different
| approaches within the same language, as well as with different
| languages. You will add to your toolkit of approaches, and start
| to build up a feel for when they are appropriate, and various
| implications.
|
| Advanced, once you have some basic programming skills: Start
| building things that have to work reliably and securely, have to
| be maintainable and evolvable at a good cadence, have to be done
| in the context of a team where everyone is working towards
| product success, etc.
| iainctduncan wrote:
| SICP is the bomb. I wish I had picked it and Scheme up 15 years
| earlier. Literally mind expanding.
|
| Sure lots of it is not as applicable now as it was, but it should
| absolutely be on your bookshelf in addition to more modern texts.
|
| I spent most of my professional code slinging career doing
| Python, but IMHO it is critical to learn to read CS books in many
| languages. If you use any lexically scoped language, reading the
| chapter on environments and what happens when you go from pure
| functions to a language that sets variables is _invaluable_.
___________________________________________________________________
(page generated 2023-07-20 23:03 UTC)