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

Importing external libraries is absolutely the most frustrating part of learning a new programming language. I’m glad Eclipse handled that for me in my first few programming classes. New students shouldn’t need to get hung up on imports before they get to write a single bit of logic. If they’re serious then they will get to have all that fun later when they are a bit more advanced.


100% agreed that this is a huge problem.

My first programming intro (I did EEE) was in MATLAB, where this isn't an issue. When we moved onto C/C++, though, this was an enormous headache. Even after a couple of years in industry it could be a massive pain the arse in terms of configuring CI/CD and porting it cross platform.

To be honest, I think the best way to solve this is not so much to use IDEs that handwave over things, but a beginner-friendly, useful language where the problem simply doesn't exist - namely Python.


> but a beginner-friendly, useful language where the problem simply doesn't exist - namely Python.

Python? I would rather tech my child Lisp or C , white space being important is very confusing.

For first time programming I would make a simple language that uses syntax like: if end_if for end_for function end_function then it would make more sense then tons {} or stupid tabs and spaces.


In my experience, Python's whitespace-based blocks usually "click" with students faster than {} or start-end blocks. Especially if they previously learned visual programming like AppInventor/Scratch, having subsections indented to the right will be more natural than end statements.

More generally, no program will be easily readable to a human without indentation. Having to scan aheas to find the endif, then find back where I was, then keep a mental note of the "block" of code that I'm looking at is really annoying, while indented blocks make that separation visually obvious. So if we already have to use indentation for our own sanity, why do we make ourselves add clutter like end statements for the compiler's benefit, when in reality, it has absolutely no problem understanding our indentation directly?


I think it would make the code easy to read for a beginner. It could also make the error reports much more clear, instead of "Unexpected symbol }" you can print something like "This for is missing it's matching end_for".

I don't like identation, it is easy to mess it around if you copy and paste code, or if you make edits, is like we would background color the blocks of code, it might look more visual but will cause issue when we actually manipulate the text.

It is a shame that at the beginning of learning to program you are hit with this many concepts and on top of that with this complex programming languages , why we did not invent a simple , more limited but perfect for teaching one? I assume some will say why should we waste time teaching a toy language when we can teach the real thing.


There can't be such a thing as a perfect teaching language because there are many aspects to learning programming and the way you'd make those things easy aren't always compatible. "Typed" or not? Automatic or manual memory management? Pointers? ...

But when it comes to teaching the core idea of encoding an algorithm with lines of text, the main thing seems to be that the less syntax there is to think about, the better. Parentheses, brackets, semicolons, variable declarations, etc. are all in the way. We have two very good languages for this - Python and Lua. I much prefer Python for many reasons, some of which I explained earlier, but Lua also works very well.

The copy-paste issue is real though, I'll give you that. Modern editors (e.g. PyCharm) completely solve it, but when using less sophisticated tools, it is a pain. Still, I can't imagine teaching programming without indentation being an important part of it and Python conveniently forces you into it. Perhaps Lua with format-on-save would be better in this regard I might try that some day...


I disagree, but let me know if you have experience teaching someone python, Python is replacing say both "{" and "}" with one character a space.

When I teach my son I always tell him "when you open the ( or { always add it's matching closed one (if teh editor does not do it and only after you closed it you add your stuff in.

So for a for I teach him to start with for(){} then fill in the stuff. It makes sense to be more explicit. We did not have issues with types though, it makes sense that int and float are different things and you need to be clear about it.


I have taught a handful of programming intro classes in Python, JavaScript and Java (to mainly high school students). Java was by far the worst, since it has a lot of boilerplate that beginners just need to memorize, which is very discouraging. Starting off with types also made the lessons less focused, but I should've adjusted the pre-programming lessons to fix that. JavaScript was great for the first few programs where the automatic type casting let us have quick and satisfying results, but then the messiness of the stdlib made anything that wasn't self-contained (reading/writing files, drawing...) a pain. In both of these cases, students' code was utterly unreadable and issues were hard to find, despite in one case saying indentation was actually required (was that immoral?). I try to guide students to follow their drawn flowcharts along with the code to see where it goes wrong, but a lot of the time, their code was all over the place, which made that difficult.

With Python, that last issue was basically gone, since the layout of the code is the thing that instructs the interpreter. Getting the syntax correct wasn't an issue in either of the languages, but this time, correct syntax necessarily also meant nice layout. The students' code was much more similar and that made it easier to guide a large group through analyzing their code to find problems.

The way I transition students from flowcharts to code is through an intermediate "step list" notation that they're already used to from procedures they learn in chemistry and other lab classes, as well as generally in instruction manuals. That notation often uses nested (indented) sub-lists, which are almost directly copyable to Python. If I didn't have that step, perhaps the benefit of Python code layout wouldn't be as pronounced, but I think this way of teaching is generally beneficial, even when not targeting Python.

Some notes from the Python classes: the editor should be configured to turn tabs into spaces - no tab character should ever reach the file, even if copy-pasted (I'm 100% on team tabs, but they're horrible for beginners in Python). Skip "idiomatic" things that seemingly simplify code (open file contexts, "or default" expressions, ternaries...) and instead use longer versions - the less knowledge required the better, despite the resulting code being more "complex". Use f-strings and ignore string concatenation for as long as you can. The turtle library is your friend.


I've helped a lot of children learn Python (volunteering) and the whitespace hasn't actually been a huge issue. They seem to get the hang of it quickly. The typing, dealing with syntax errors which don't explain clearly the problem, and motivation are the main barriers I would day. It is quite nice for them to learn a language that is used in anger professionally.

The first experience of most children here (in the UK) at school and elsewhere with programming is Scratch, a visual block-based programming language. So no typing or syntax errors, and very quickly you can makes games etc. It's got its pros and cons.


> Python

I'm tempted to share this xkcd, called "Python Environment": https://xkcd.com/1987/

I'd say that Python is an absolutely stellar language when it comes to readability and getting things done thanks to its rich ecosystem, but at the same time is about as bad as Ruby when it comes to managing dependencies.

In my eyes, something like Java/.NET/Go could be better choices for when you need to work with dependencies as a beginner, whereas Python is probably the better choice when you don't.


Have you used it recently? On any popular version+os+arch combination, pip will "just work" for anything a beginner would ever want to do. Binary packages are pre-compiled, packages are installed in per-user dirs automatically to avoid permission issues and conflicts with system packages (where those exist).

The only issue comes up when you have multiple apps with conflicting dependencies, but at that point you're probably not a beginner anymore and someone will have taught you about pipenv. Just remember to type "pipenv install" instead of "pip install" and all your dependency problems go away. Most IDEs pick it up automatically too.


> On any popular version+os+arch combination, pip will "just work" for anything a beginner would ever want to do. Binary packages are pre-compiled, packages are installed in per-user dirs automatically to avoid permission issues and conflicts with system packages (where those exist).

That's often not the case in my experience. I've had several Python packages fail to compile on my machine (x64, so not even something less common like ARM). Others failed because of missing system libraries without any clear indication what library they're looking for.

It's not as bad as NodeJS's package management, but Python certainly has problems.

Then again, most of these problems aren't really problems for most use cases if you use virtualenvs. I've seen many (ex)academics use Python without venvs and cursing their system for not working properly. This results to pip being invoked as root, subsequently conflicting with the OS package manager and then some cursing about how Python has broken their system. venvs really need to be in the spotlight more often because I think a lot of people have terrible experiences with Python purely because they don't know they exist (or how to use them).


This basically sums up my experience, though perhaps more so in projects with Flask or any other loosely coupled codebase with many dependencies, rather than the likes of Django which are more tightly integrated and perhaps better tested.

In particular, i remember problems when trying to compile DB drivers for a project, what worked in Windows didn't work in Linux containers and vice versa. I remember having to mess around with the system configuration manually and track down .wheel packages, rather than just being able to do a "pip install" inside of a venv. That was in Python 3, though i don't remember which version it was or the particulars of that situation, so sadly i can't comment more, merely comment that i had problems.

That's actually been the case with most languages and toolchains so far, so maybe my computer is just cursed, or maybe that's just the fact that i use Windows for development some of the time, other times i boot into Linux, whereas containers might run something different like Alpine Linux which has plenty of its own idiosyncrasies.


This has been my experience.

To import matplotlib, for example, you type "pip install matplotlib" into the terminal to install it.

Then, you add "import matplotlib" to the top of your .py file.

That's it.


for introductory programming courses there shouldn't be any dependencies

also NuGet is no better than pip


For solving the sieve of Eratosthenes youn need 0 dependencies, and Eclipse gets in the way all the time(I have seen it and it's painful to watch).


Ironically importing external jars is particularly easy in java... and frankly rarely nescessary in an early course. Java gives you a lot!


It should be frustrating because you should avoid doing it.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: