4 ms·
I've been thinking a lot recently how to get devs to read more code and it's a very interesting reason you give that you don't want to wade through boilerplate.
by eatonphil 5y ago
I've been thinking a lot recently how to get devs to read more code and it's a very interesting reason you give that you don't want to wade through boilerplate. I never thought of that before.
I don't know boilerplate-heavy systems like Rails or Django too well. But I just wouldn't suggest starting with reading web app code (though maybe I've ignored reading too much web app code over time).
The easiest code to start thinking about is libraries and things you use today already like the nginx code base or the CPython code base or your logging library or your web server library code.
In these cases maybe you download the repo, build it, see how you could make a small tweak and run it. And soon you're looking through its code to understand how it works.
Another maybe easier technique to start reading more is when you are programming and have an error in a 3rd party library, use grep to find that error in 3rd library code and just start poking around when you do. Maybe add some print statements to it so you can see more of what goes wrong. Try to solve the problem just looking at the code and modifying it instead of using google.
If you ever get into it I'd love to hear from you. Email is on my site and Discord is in my HN profile.
- Beltiras 5y agoDjango and DRF are really well written systems with good documentation.
- fernandotakai 5y agoabsolutely +1 for django's source. and after they shipped their black integration, everything is properly formatted, which makes reading the source even easier.
- bityard 5y agoI must be in the minority, I have tried to "learn Django" on more than one occasion and gave up every time after struggling with how hilariously over-engineered it is. My best guess is that Django must be great for writing big important relational-database-backed apps, or rolling your own CMS, or something else people get a paid a lot of money to do. But personally, for my small projects I get more mileage out of starting with a micro-framework and just choosing and bolting on the bits I need.
- Beltiras 5y agoThat's exactly the case. My career has been mostly making CMS systems using Django. The neat thing is that you have this front-end batteries-included framework with a gargantuan ecosystem of system tools bolted on it's back end (Python). Django is not a web page tool. It's a tool to build large-scale web systems.
- thijsvandien 5y agoI'm totally with you. Whenever I tried to build anything with Django, I soon went back to Tornado for its glorious simplicity. Being able to quickly see how something is implemented is worth much more to me than any magic I mostly end up fighting. Django just has too much going on with everything being somehow connected to everything else (which is sort of the point). I might agree it's well-engineered, but an example of easy to read code...?