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.

Ask HN: Any Things You Wish You Were Told When Learning Programming?

2 pointsby subtract-smilesabout 2 years ago
I&#x27;m going to be running a class teaching programming from scratch soon, and I want to make sure I don&#x27;t confuse my students more than I teach them.<p>If you have any topics or concepts that made programming a lot easier for you to learn that I could make sure to mention in my class would be helpful.

2 comments

gilchabout 2 years ago
If I could send a message to my past self on the topic, I might have told myself to start with Common Lisp, Scheme, Python or Smalltalk (maybe Squeak), rather than the BASIC, C++, and C# that I started with. (C++ was too complicated. BASIC is maybe too primitive by modern standards, although assembly might have been worth learning early. C# was better but had too much ceremony for even a simple Hello World.) I might also tell myself to actually read the textbooks rather than just watch lectures.<p>There are so many details one has to get right in one&#x27;s head to program at all, that non-programming experience doesn&#x27;t prepare one for. E.g. the assignment operator isn&#x27;t symmetric like the equality boolean operator (in most languages). This is not how it works in math. The simpler the language you start with, the easier it is to model in one&#x27;s head.<p>Having a simple language with a REPL is super useful for getting this straight--if you don&#x27;t know what it does, you quickly test the assumptions. Go through lots of small examples. Have the students predict and write down what the output will be, then run it and have them explain why they were surprised. This should help you diagnose where their mental models are wrong. Tell them to assume the bugs live in the programmer&#x27;s mental model, not in the compiler. Flip the classroom if you need more time for this. (I.e. pre-record the lectures, and have them watch them as the homework, and work on the exercises during class time.)<p>Explain the language&#x27;s memory model. What lives on the stack or on the heap? How are arguments passed? What&#x27;s a copy and what&#x27;s a mutation? Diagram on the blackboard. Write assumptions down. Human working memory is extremely limited. The gifted students might have seven registers to work with, when they&#x27;re concentrating. If they&#x27;re learning the language itself, or talking to you at the same time, there isn&#x27;t much left to program with. Those with more average IQ might not have anything left at all. Have them start with pseudocode, and iteratively break it down to the level that it can be mechanically translated into the language. Offload everything you can.
评论 #35310629 未加载
评论 #35322131 未加载
WheelsAtLargeabout 2 years ago
Don&#x27;t expect teachers to teach you everything you need to know to become a working programmer. Programmers have to seek knowledge. Best way to do it is to create your own project. Challenge yourself by creating an application that you like but that is challenging enough that you will need to do research to create it from scratch.<p>The newest recommendation is to make sure you understand how AI will help in programming. It&#x27;s changing and will continue to change how programmers work.