[HN Gopher] 30 Days of Python
___________________________________________________________________
30 Days of Python
Author : ibobev
Score : 160 points
Date : 2023-03-03 15:39 UTC (7 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| glacials wrote:
| Love that this starts you right in the terminal and VSCode from
| the outset. A friend has been on the Codecademy grind as a new
| developer, and ~1 year in she is continually frustrated with how
| little focus it places on real-world tools and experiences. It
| seems they want to keep you in their in-browser interpreter for
| as long as they reasonably can.
| bshipp wrote:
| So many courses demand you start in a text editor and I
| understand the rationale but I write almost everything in
| PyCharm and strongly encourage everyone to find a comfortable
| IDE.
|
| If the intention of coding in Python is to get stuff done
| quickly, it seems a bit silly to handcuff yourself by avoiding
| one of the biggest time-savers.
| DiggyJohnson wrote:
| > biggest time-savers
|
| I strongly believe there's a balance to be struck between
| getting started quickly and understanding how your code is
| run. Especially if it's an interpreted language like Python.
|
| If you do understand opening a terminal in your project's
| repository and executing `python3 ./mypythonfile` then this
| should be prioritized. Even for noobs.
| mavhc wrote:
| When teaching noobs I first have to tell them how to make
| folders, create files, what files are and where they are
| stored, modern systems abstract that all away.
|
| I want them to realise that code is just text files, same
| with html
| DiggyJohnson wrote:
| Edit: :3s/do/don't
| grvdrm wrote:
| Completely agree with your last point.
|
| So many of my tools over the years have stuck with their
| simple command line initiation rather than wrapping into
| GUIs or other alternatives. Being able quickly write
| "python [whatever you are doing]" is awesome.
| Stratoscope wrote:
| If I were teaching someone Python, or pretty much any
| programming language, the first place I would start is the
| debugger. I would have them write a program as simple as
| this: x = 1 print(x) y = 2
| print(x, y)
|
| And then instead of just running it, I'd have them step
| through the code, line by line, and observe both the console
| output and the debugger variable display.
|
| Some developers seem to think that using a debugger is a sign
| of weakness, or that it leads you to write bad code. I see it
| differently: the debugger is one of the best tools not only
| for debugging, but also to help you understand a complex
| codebase that you are jumping into.
| LrnByTeach wrote:
| > If I were teaching someone Python, or pretty much any
| programming language, the first place I would start is the
| debugger.
|
| Totally agree.
|
| In the first week of programming, students should be
| allowed only use the debugger (no direct runs) in every
| course/collage around the world. I saw firsthand how many
| courses/collages students struggle with logic because
| debugging was never introduced, and they were unaware of
| how to step through each line.
|
| Another mistake that new programmers make is writing 30
| lines of code and then run and lost why bugs occurring. As
| a rule of thumb, they should debug/run the program every 7
| new lines of code.
| zikzak wrote:
| I end up helping developers when they get stuck all the
| time and it is really amazing to me how many people get to
| the "senior developer" point in their career with very
| little understanding of how to use SQL tracing (e.g. MS SQL
| server) and IDE debugging.
|
| Even the concept of the "print line" debugging into a lot
| file seems kind of foreign to them sometimes.
|
| They instead rely on running the code, changing something,
| running it again, etc.
|
| I am a big fan of reading through the code. That is almost
| always enough for me to find the issue and point it out to
| them assuming I understand the input and output context
| well enough. But if that doesn't work, add a debug point
| and fire it up. Not using a debugger seems like a massive
| waste of time in a situation like this. So much so that I
| have started asking "did you debug this" or "have you
| watched this happen in a debugger" before I will help out
| much. If they say "no" because they don't know how, I will
| teach them to do so.
| vageli wrote:
| exercism.org (no affiliation) is pretty good in that regard,
| offering a cli to facilitate doing the exercises locally using
| tools you're already familiar with.
| __MatrixMan__ wrote:
| I like exercism, but the CLI can hide things like what a sane
| project structure looks like in that language.
|
| I wish it generated a project with unit tests and told you
| which command to run (i.e. not an exercism command) in order
| to run those tests. That way you've got a more similar
| experience to what would happen if you cloned a project in
| that language and wanted to contribute.
|
| Unfamiliar languages are much easier to deal with than
| unfamiliar tool chains IMO
| voicedYoda wrote:
| I've had success in the CLI with elixir, running tests, and
| structure
| BeetleB wrote:
| It depends on the language. Some of their language tracks
| definitely do give those instructions.
| hacker_newz wrote:
| What's with all the spam issues?
| l_theanine wrote:
| More common than you think on educational repos like this.
| Kiro wrote:
| What's the point? It's just an empty issue.
| netruk44 wrote:
| It looks like these people are using it as kind of a
| bookmark somehow, with the issue title as their bookmark
| title ("learn", "python learning", "30 days of python",
| "python").
| l_theanine wrote:
| I think sometimes it's a misunderstanding of the platform
| by people with no clue what they're doing, and maybe a
| partial language barrier?
| werwerwerew wrote:
| [flagged]
| l_theanine wrote:
| Pretty good curriculum, I'm not sold on MongoDB, I'd prefer
| someone with Postgres or SQLite experience so they can be
| immediately useful on a project, but it's better than nothing,
| which would be even worse.
|
| There's a rather deep rabbit hole really about figuring out what
| the best beginner curriculum should look like, because if the
| diversity of the applicability of Python. They might be doing to
| a data science role, a sysadmin role, an infosec role, an
| educational role, you just never know. I think it'd be
| prohibitively difficult to unify these tracks, and might even
| play a role in the perceived difficulty for a lot of people
| coming to computer work from zero programming experience.
|
| Someday, I'd like to see some sort of AI platform that can gauge
| a users intuition about the concepts on the whiteboard and tailor
| lessons to be impressed upon that user the best way. I'd teach a
| 30yo with ten years of Excel munging experience different than
| I'd teach a 20yo with no CS education at all besides video games.
| That could be automated to great benefit, imo.
| rekahrv wrote:
| > There's a rather deep rabbit hole really about figuring out
| what the best beginner curriculum should look like, because if
| the diversity of the applicability of Python.
|
| So true.
|
| I really like that 1 day is devoted to:
|
| * PyPI
|
| * virtual environments
|
| Those feel super useful in all the roles you've listed.
|
| I'm also not convinced that MongoDB is the most practical
| choice. On the other hand, it might be more intuitive to learn
| on 1 day than the relational database modelling. (Especially if
| we assume that the student has already learned about various
| data structures during week 1.)
| rekahrv wrote:
| > Someday, I'd like to see some sort of AI platform that can
| gauge a users intuition about the concepts on the whiteboard
| and tailor lessons to be impressed upon that user the best way.
| I'd teach a 30yo with ten years of Excel munging experience
| different than I'd teach a 20yo with no CS education at all
| besides video games. That could be automated to great benefit,
| imo.
|
| That's an intriguing idea!!
| nerdponx wrote:
| Another -1 for MongoDB here. It's a newbie trap in general.
|
| However is _is_ probably easier to get started with for someone
| who is already learning Python, because its data structures
| closely resemble Python data structures, the query language can
| be expressed directly in Python object literals. This makes
| MongoDB a very gentle introduction the basic usage of databases
| for storing data (as opposed to e.g. dumping JSON to a file).
|
| Starting with Mongo might make it easier to graduate to
| relational databases & SQL later.
|
| Arguably TinyDB might be a better choice than MongoDB, but at
| least Mongo _does_ get used in industry once in a while.
| ssgodderidge wrote:
| >"Python is eating the world and you are killing it before it
| eats you."
|
| Whoa, took a dark turn there
| zoomablemind wrote:
| Nice learning guide. On basic level Python is easy to learn, if
| already familiar with anything programming related. However,
| acquiring a practical idiom for Python code is not that trivial,
| in my experience. There are so many ways of expressing the same
| intent in Python, also the lack of explicit types eventually
| bites you where least expected. Also the whole domain of the
| double-underscore object-functions is like an "easter egg" left
| for someone to figure out.
|
| I wish the learning guides early on centered on builing an
| "engineered" application. Covering the approaches to structring
| the application, user input processing, error handling, logging,
| dependencies, packaging etc. Such that the learners won't be left
| alone with a simple knowledge of syntax and basic operations.
|
| Well, likely there are such guides already.
| dangets wrote:
| I'll give a plug for 'Cosmic Python'[0], it goes into detail of
| structuring larger python applications using hexagonal-ish
| architecture. I wouldn't recommend this approach for smaller
| services.
|
| [0] https://www.cosmicpython.com/book/preface.html
| molsongolden wrote:
| Has anybody seen a good guide like the "engineered" application
| mentioned above?
| alienreborn wrote:
| Similar course that's pretty good: https://dabeaz-
| course.github.io/practical-python/
| photochemsyn wrote:
| This could easily be expanded to 60 days of Python, but it
| provides a nice overview and everything included is clearly
| explained. Perhaps add a full section on generators and
| yield/yield from, those are useful, and maybe itertools as well?
| Also dict comprehensions are nice, they could go in as an
| addendum to list comprehensions.
|
| It might be a good idea to introduce virtual environments
| earlier, as they help keep things from getting too snarled up
| dependency-wise.
|
| In terms of modules, pathlib is very useful, if you're going to
| be collecting data from web scraping or similar then automating
| the process of creating directories and transferring files to
| them. Subprocess is another good one, for coordinating multiple
| activities in one script.
___________________________________________________________________
(page generated 2023-03-03 23:00 UTC)