Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree WRT block structure, but having TA'd a Python course that "should" doesn't survive contact with a real world classroom. Students will use anything from IDLE to Notepad to PyCharm, and usually shut down completely instead of trying to work things out when the code snippet they've spliced into their program from StackOverflow fails to run because of mismatching indentation. I'm not sure why few try to understand the SyntaxError messages, but it's like they don't exist!

Part of me wants to forbid all "dumb" text editors for introductory programming courses and make everyone use an AST-based one that only allows you to create syntactically correct programs. Unfortunately there's zero chance of that happening any time soon...



Possibly you've had more students in one go than I've ever had for all the languages I've done put together then. That said:

Here's a weird thing that seems to work (especially while learning): Instead of copy-pasting code, type it into your program by hand. For some reason this helps a lot when trying to understand or debug the code that you are entering.

This works equally for those of us who started learning using BASIC on 8-bitters, all the way to Python, Java, or odd things like Siemens SCL.

Wrt editors: the times I've taught people, I actually went completely the other way: requiring the first few programs to be written in notepad or nano (depending on OS) . This tends to take the magic out of what the IDE is doing, and makes everything after it much easier.

Both of the above would seem to be relatively time-consuming. But oddly enough in practice they can save more time than they consume.


This is one of the key parts when starting to learn programming. Just typing out everything manually really helps you see the small details that are important when writing code that can get lost when copying from elsewhere. Courses like Learn Python the Hard Way focus on this method and I think it's the best way to go for absolute beginners.


Absolutely, I find this approach gets the right mental gears turning as well. The problem comes up most often with take-home assignments though, where students are more likely to copy-and-paste a couple lines from somewhere because you haven't given them a full program. If anything, an IDE might be better because it'll give more localized feedback and people are more likely to react to the red squiggles :)


I’m a bit taken aback by this message. My students have never copied and pasted a single line of code aside from their own...

I also don’t give homework. If you want to learn on your own, you can, but homework is a massive crutch that I don’t think benefits most people.


Whenever I hear a story like this, I always ask:

Have you taught a similar crowd any other language and gotten a different experience?

Because what you describe sounds like the students in my introductory programming class, which was in C++. Sure, they didn't have whitespace issues, but did demonstrate a similar lack in rigor, and giving up easily.


No, though I have plenty of anecdotes from friends who have. I agree that these apply regardless of language. Whitespace errors are arguably some of the more insidious syntax errors though, since most editors will not differentiate between spaces and tabs (e.g. vim's set list) and to the beginner programmer it doesn't feel like the number of spaces should matter (I'm indenting my blocks, why do you care how much?)


> I'm indenting my blocks, why do you care how much?

The equivalent in an introductory C/C++ class:

"I put a newline, why do you care if I put a semicolon?"

At some point, students have to accept the quirks of any language's syntax. It's OK to have an opinion and hate it, but whitespace complaints are mostly a preference issue.

(Every time I switch from Python to a language requiring semicolons, it always feels like I'm hitting endless speed bumps.)

While Python may not be a beginner language, nor is Java/C/C++, in my opinion - and for people completely new to programming, those have a steeper learning curve than Python (the for loops are just hideous). These were the standard introductory languages in college before Python took over. I'm sure better teaching languages exist, and I'm also sure JS is not one of them ;-)


Don't get me wrong, Python is head and shoulders above Java/C# or C/C++ as a teaching language. The complaint is that, as the educator, lab/tutorial time is being wasted on trivial syntax issues that would be non-existent given a more lenient parser or better tooling (preferably the latter).


I’m not sure that statement is accurate, I could see an argument being made for C being a really good learning language.


If your goal is low level programming, yes.

If your goal is understanding data structures, algorithms, etc, then C is hideous. Explaining function prototypes, include headers, very unfriendly I/O, and I already mentioned the horrible syntax for for loops.

There's a reason most of the data structures/algorithms were in a second course at my university: It's because it took most of one semester for students to get a handle on the very basics of C syntax.


It would be the best possible learning language, if your next language was going to be assembly.


Is that a crack about complexity? C doesn’t have very many features.


I’m saying that the C machine model would be an ideal introduction to pointers and registers and bit manipulation, and you could compare a C program with its compiled disassembly. Later you could get into in-line assembly and even processor intrinsics.


Alright, I see.

Another good candidate is golang.

I’m going to think on that one a bit more.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: