News for hackers. Stuff that matters.
Re:Ask HN: How can I get better at writing production-level ... by serjester on Tuesday July 18, 2023 @05:23PM (#36779276)
Assuming you have the fundamentals down, I’d recommend taking the time to dig in and understand the source code of a couple well written packages. Start with some simple libraries like datetime, requests, flask and move on to more complex, modern examples like pandas / fastapi.

Clone the package, run the tests, break the tests and try adding functionality. You’ll learn a lot - I know I did when I was starting out.

I’d also recommend checking out Fluent Python.

Re:Ask HN: How can I get better at writing production-level ... by a_bored_husky on Tuesday July 18, 2023 @06:15PM (#36779795)
Fluent Python is fantastic.
Re:Ask HN: How can I get better at writing production-level ... by hbcondo714 on Tuesday July 18, 2023 @06:44PM (#36780036)
Yeah, reading the Fluent Python book[1] and / or following along with their support files[2] would a good way to start

[1] https://amzn.to/3J48u2J

[2] https://github.com/fluentpython/example-code-2e

Re:Ask HN: How can I get better at writing production-level ... by bitsinthesky on Wednesday July 19, 2023 @01:13AM (#36782339)
Just fyi to cheapskates like me, i was looking around for a free pdf, some are hosted on github, others on google docs. Putting the pdf urls into https://www.virustotal.com/gui/home/url , all were suspicious or malicious. I think ill search around a bit more, but will probably give up.
Re:Ask HN: How can I get better at writing production-level ... by scrlk on Wednesday July 19, 2023 @11:47AM (#36788329)
Might be of some interest to you: https://annas-archive.org/
Re:Ask HN: How can I get better at writing production-level ... by bitsinthesky on Wednesday July 19, 2023 @01:14PM (#36789852)
Unfortunately it seems pdfs linked there may also be malicious ( https://www.virustotal.com/gui/url/7e73cc3d685c77d88ad9cf769... ). I checked on some other pdf links ive downloaded previously and they were safe, so I don’t believe the software just flags everything.

But it could be if the coding book includes working examples and exercises, that would probably flag any system looking for code execution.

Re:Ask HN: How can I get better at writing production-level ... by scrlk on Wednesday July 19, 2023 @03:16PM (#36791743)
I'm inclined to say that those are false positives, given the obscurity of the vendors who are flagging the URL.
Re:Ask HN: How can I get better at writing production-level ... by racrui on Tuesday July 18, 2023 @09:51PM (#36781263)
This is great recommendation, you can get very far by reading well written code. These have very well written Python, exposing much of the language expressiveness:

- https://github.com/python-attrs/attrs

- https://github.com/mahmoud/glom

- https://github.com/pytoolz/toolz

- https://github.com/Suor/funcy

- https://github.com/dabeaz/curio

  ps: dabaez has great educational content on writing idiomatic python, definitely worth checking out
An honorable mention of norvig's classic essays, which got me into python while I was in college, over 12y ago: https://norvig.com/spell-correct.html.

Aside from reading code, _writing_ something that you know it exist (e.g glom) and then comparing it to how others have done it is also a great learning experience.

Re:Ask HN: How can I get better at writing production-level ... by jmatthews on Tuesday July 18, 2023 @11:20PM (#36781753)
Second or third reco for Fluent Python. Also, to be a purist for a moment. Explicit is better than implicit. Use this as a razor to decide all ties in your design.
Re:Ask HN: How can I get better at writing production-level ... by ttymck on Wednesday July 19, 2023 @03:59AM (#36783304)
FastAPI, while a very impressive codebase, is not approachable at even an intermediate proficiency in Python.

It is _staggeringly_ dynamic, and basically uses runtime reflection of "static" types to scaffold a really complex ast describing your application.