|
|
| | Ask HN: How to get back to programming Python? | |
59 points by mlitwiniuk on Nov 14, 2023 | hide | past | favorite | 56 comments
|
| | I've used Python back on my university days (some numpy coding, some gui apps for both linux and windows) and later professionally, when doing webdev in Pylons and Django. Then I've switched to Ruby and for the last 15 years haven't touched Python at all. And now actually I'd like to get back to it, with some side projects. Ideally I'd love to do some image recognition / qualification apps. Question is - what's the best place to start? I remember some basics, but as I can see, A LOT has changed. |
|

Join us for AI Startup School this June 16-17 in San Francisco!
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
|
- I used to do everything in vim, but now I adopted VSCode (usually with SSH-Remote) and it's been such an improvement to my productivity. Try to use the integrated test explorer and debugger.
- If you use type annotations (sparingly), your VSCode experience gets even better.
- Many projects use auto formatting with 'black' these days. Initially I was a bit grossed out by this, but I now love it. It frees me up from having to spend mental cycles on complex lines, and removes the friction when reviewing CRs. The one change I make is to have a slightly longer line length.
- pyproject.toml is a new project level config file. Try to only use that file for all your setup and tool configurations
- Since you said you last touched Python 15 years ago, we now have Python 3.x. Syntax is a lot cleaner. There are many smaller differences.
- async/await is new. It is pretty neat if you want to do async programming. Don't expect a major boost (or any boost) in performance over traditional threaded code, but you can expect much cleaner code.
- f-strings are pretty neat, I use them pervasively
- I'm not sure if these are already 15 years old, but "with" context managers are the primitive to use for cleaning up resources.