11 ms·
Show HN: A platform for beginners to learn programming in Python
- travisjungroth 6y agoI like this idea very much. I've thought about making something similar. The example in the readme isn't idiomatic Python. It would be better to use enumerate.
- The-Toon 6y agoIt's an example for beginners, presumingly to illustrate the range function, so that's probably why it's done that way. To continue to be nit picky with that example, the range function produces an iterable object, which is different from a list.
- travisjungroth 6y agoThis seems to be non-standard, but I make a serious effort to never teach the wrong way to do something. Primacy is just so strong. It makes teaching harder. You really have to work to come up with great examples. But it makes learning easier and there's less correcting to do later.
- cgriswald 6y agoIn general, I agree, and I think it’s especially important in text. A teacher is in a position of authoritative trust. As a student, after I learn an example is flawed, I often wonder if I’m just missing some context because I trust the teacher to have gotten it right. In a setting where communication is already established (e.g., a class room) this can be cleared up quickly with a question. In other settings (e.g., reading a text), it can leave me wondering until I reach a much higher level of competence.
- alexmojaki 6y agoWhen the course reaches the point that students are ready to learn about enumerate (see my reply above) the course will definitely cover it and emphatically point out that it is the better way.
- travisjungroth 6y agoTake it for what it's worth, but that's exactly what I think is a bad idea. It violates the principle of primacy in learning[1]. It also erodes trust in the lessons. (Is this the real way to do it?) There's a similar strategy of building things up and then refactoring when they get bad (this ifelse is getting too big. We could use a dict). But the difference is every step along the way is valid or immediately corrected. [1] https://psychology.wikia.org/wiki/Principles_of_learning#Primacy https://psychology.wikia.org/wiki/Principles_of_learning#Pri...
- alexmojaki 6y agoWhat would you do in this case? The student has never seen a tuple, or iterable unpacking of any form. Would you just show them `for index, word in enumerate(words)` and tell them not to worry about what that means? Quite shortly after this, I ask them to essentially do `zip_longest`. Given two string variables: string1 = "Goodbye" string2 = "World" output: G W o o o r d l b d y e Here's what I expect their solution to look like: length1 = len(string1) length2 = len(string2) if length1 > length2: # one could use max, but I don't expect them to length = length1 else: length = length2 for i in range(length): if i < len(string1): char1 = string1[i] else: char1 = ' ' if i < len(string2): char2 = string2[i] else: char2 = ' ' print(char1 + ' ' + char2) That's not something that can nicely be solved with enumerate. Do you think this exercise is bad because they should just use zip_longest instead?
- travisjungroth 6y ago
- alexmojaki 6y agoWhich is why it specifically says "is similar to the list". But you may be surprised how many list-like operations `range` supports. Subscripting, `len`, `in`, `.count`, `.index`. It might as well be a tuple. And if you want to nitpick more, range isn't a function.
- alexmojaki 6y agoThanks! If you've wanted to make something similar, would you perhaps join me in making this? I'm looking for contributors. Yes, enumerate is better, but I want to teach concepts one at a time and I want students to understand what's going on in code. Before teaching `for a, b in c` I want to teach `a, b = c`. And to motivate doing that I want to teach `return a, b`. At this point in the course they're only just starting to learn about lists - they haven't seen tuples and they've never defined a function. So it's not time yet. Besides, it's important that students are intimately familiar with how to index a list a which indices are valid.
- travisjungroth 6y agoI'm too busy for any side projects :(
- dillonmckay 6y agoMan, personally, with Python, programming with the language seems to be the easy part. I have struggled with virtual environments and runtime executables across various OSs. What are current best practices?
- atoav 6y agoI settled in using poetry for developement and dependency management and the publishing stuff to pypi and installing it via pip. But this approach might be a bit limiting depending on your target audience.
- agustif 6y agoLast time I had problems in Windows I used pyenv/pipenv as per some guide.
- dec0dedab0de 6y agoI use pipenv,and it works well enough for what I'm doing, but in reality the problem is that python just isnt designed to be distributed. There are various techniques each with their own pros and cons, but the only consensus is that it's a pain in the ass.
- mettamage 6y agoWhat are the tradeoffs vs using docker? Just curious.
- opheron 6y agoNice work! I tried to clone the project and run with Docker with the hope of contributing but I'm getting this error message on the "Introducing the Shell" page: The process died. Your code probably took too long. Maybe you have an infinite loop? Do you have a chatroom or something where project devs can discuss work in realtime?
- alexmojaki 6y agoThanks! I'm thinking I should start a Slack. Any opinions on that? In the meantime can you open an issue to talk about it?
- opheron 6y agoI highly recommend Zulip. Free, open-source alt to Slack but with good threaded conversations: https://zulipchat.com https://zulipchat.com If you don't want to create a full chat I'm happy to host on a Zulip chat for hackers I'm part of, just let me know. I'll open an issue, thanks!
- historyremade 6y agoPython is horrible language for absolute beginner. I recommend Javascript over Python.
- raghavtoshniwal 6y agoThis is a cool idea. In a similar vein, I use Google Colab heavily to induct new students to python. Requires no setup, we can collaboratively edit and the output is instantaneous.
- AtHeartEngineer 6y agoThis is awesome, I'm sure this was fun to make. I love digging into the python internals
- alexmojaki 6y agoThanks, it is fun, and quite rewarding. There's still a lot to do, wanna join in?
- chopraaa 6y agoThis is awesome! I was looking for something to teach children programming with. (10-12 years onwards) Your project looks amazing. I hope I can find ways to contribute.
- ggregoire 6y agoIs Python the language of choice to teach/learn programming nowadays? I learned to code with Java like 10 years ago. I haven't touched it again after graduating, and to be honest I was not so fond of the language (too verbose and too much OOP for my taste), but I'm glad I learned the benefits of having static types and a compiler from the start. Obviously, Python is closer to pseudo code than Java, which is also great when you just start learning.
- chopraaa 6y agoThe beauty of Python is in the fact than anyone can pick it up. It helps teach logic and programming constructs to people outside software as well. With tech being a core part of many jobs these days it's essential that everyone knows at least the basics. Python is great for that purpose.
- Pythaway 6y agoDepends on what you want to teach/learn. It's a fantastic scripting language, which makes it excellent for people who want to automate computing tasks. Researchers, journalists, academics, administrative roles, etc. But it is very high-level, so it is not a great way to teach/learn how something like a computer, database, or operating system works. I think it's a great way to start teaching or learning programming, since you can keep using it no matter where your career takes you.
- analog31 6y agoI've had about 6 people in my work area learn Python. We're not employed as programmers, but we're scientists in an R&D team. My colleagues varied in experience, some had used Matlab in college, but none had programmed extensively. The scripting aspect is great because you can get useful things done with a few lines and minimal constructs. There's a pile of solved problems on Stackoverflow. Folks can approach it at their own pace and on their own terms, at work or at home. I promise them that if they hate it, I'll refund the price. ;-) Now, germane to the discussion in this thread about installing the packages and so forth. That's a drawback to Python that I tell people about, but my approach is to provide complete hand holding on installation until they've come up to speed on programming. If they've never programmed, then they've probably never approached a computer from the command line or dug into its file structure. So, learning a bit of programming first is a good way to prepare for doing that other stuff. I originally learned BASIC without knowing how to install BASIC on the mainframe. We're a Windows shop, so I help them download and install WinPython. Running into a useful library that WinPython doesn't have is pretty rare, and then a pip install within the WinPython shell usually works.
- aroberge 6y agoHave you considered using friendly-traceback?