Hacker News new | ask | show | jobs
by danShumway 2819 days ago
> I think you're saying that Python isn't great at procedural programming.

No, I'm saying it has weaknesses as a first programming language for beginners. Of course Python is practical, that's why it's so insanely popular.

The reason my friend went back to Excel wasn't because of a weakness in how Python is structured or what types of programs you can write in it. He left it because he didn't like needing to look up how to do things, or look to see what library supported what function. Excel is limited and inflexible, but he knows the "API" by heart, so when he's doing something creative, he's spending more time thinking in depth about the concepts he already knows, and less time learning new concepts.

Python is just big. There's a lot of it. There are multiple ways to do everything. That's good, and I like that about the language. But it's also kind of bad. You can ignore a lot of it, but that takes effort and it limits what resources/tutorials you can look at online. Being able to grab someone else's code off the Internet and learn from it or change it for your own projects is nice. But if you want to do that for Python, you need to be good at the language first.

That's what I think the strength of very small languages are. You can hold them entirely in your head without too much effort, so as a beginner you're able to spend more time applying them, which is often the fun part of programming for a beginner anyway.

1 comments

Yeah, but your examples (TI Basic, Pico8) all imply that a first programming language has to follow a procedural style.

There's no reason whatsoever it should be so. I knew some odds and ends before college but had my introduction to programming with a SICP-like (but much simpler, I wasn't a CS major at MIT) course in Scheme that was taught by the creator of Lua. Like SICP, it emphasized a "compositional", mostly functional style. The next course was data structures in C.

So of course, a "First Course in Programming with Python" will be nothing like a "First Course in Programming with ZX Basic" (which yeah, encouraged you to peek and poke into memory directly, etc). A "First Course in Programming with Haskell" will be even more different. But some may argue that those who have cut their teeth on Haskell are better prepared for anything.

At any rate -- Haskell is really difficult but Scheme was until recently pretty popular.

It's not about procedural programming -- it's about the size of the language.

If you know of a functional language who's entire manual and standard library can fit on 2 or 3 sheets of paper, then fine, use that. But Python certainly isn't that language. Neither is Javascript. Neither is Haskell.

Doesn't mean you can't start on it. Heck, one of my very early languages was C++. But that doesn't mean it's beginner-friendly. Remember, I'm not talking about what your first programming class in college or high-school would be. I'm talking about, "can you sit down over a weekend with zero programming knowledge and end up with at least a basic understanding of how the entire language and runtime works?"

Scheme... yeah, I guess I can see Scheme being OK. But you're really missing the entire point of what I'm saying. The reason I brought up Excel in the first place was to drive home that how good the system is overall for practical, real-world purposes does not matter.

I bring up examples like TI Basic because if you want to teach someone TI Basic, you can hand them just a calculator and then give them one HTML file (https://www.ticalc.org/programming/columns/83plus-bas/cherny...) and that's it. You're done. They'll be able to figure out the rest.

TI Basic is a fantastically designed beginner language. Not because it's procedural. Because it introduces a small number of concepts that force the user to be creative and encourage them to organically discover more advanced topics on their own without an internet tutorial. It's fantastic because it's so small that even a beginner can look at any other example program on the web, even if written by an expert, and generally speaking know what it's doing.