Hacker News new | ask | show | jobs
by bnormative 692 days ago
It is funny how tutorials are always built on top of "hello world" or basic math functions where you don't see anything close to real world. I mean, I would not expect to see production level code but at least it could be a sort of demonstration of it.
4 comments

I really like Rob Pike's talk about Go Concurrency Patterns [1] because it uses Google Search as an example. Really helped in my early years of using Go to use goroutines and channels appropriately.

[1]: https://go.dev/talks/2012/concurrency.slide

I think it's funny how some people always complain that simple educational examples are not representative of professional level code.

This is clearly intended for complete beginners. It's explaining what a variable is. More advanced stuff comes later. Not to mention teaching a programming language is not the same as teaching frameworks and libraries within that language. If you're going to show more advanced exanples you inevitably need frameworks and libraries, which use more advanced language features and techniques, which makes learning a nightmare because now you're trying to understand a library while also trying to understand the language. Huge difficulty multiplier.

The first step is to learn the programming language itself. For that you don't need advanced code examples, nor do you want them. You want simple examples that demonstrate whatever you're trying to demonstrate with as little distraction as possible.

This.

Show me how to connect to a database.

Show me how to unit test something that does an external api call.

Show me how to build a generic file store package in such a way that the interface at the top level can be implemented for several providers.

Hello world tutorials are an absolute grift and I'm suspicious that anyone peddling them has never actually built something real.

I totally agree! I really liked https://lets-go.alexedwards.net which walked you through creating a web api with a database. When I did it, I decided to use SQLite instead of what was in the course, which meant I could follow along but still had to understand and choose the right dependency etc myself.

(I’m not affiliated, just a happy customer)

True.

Write some ultra basic stuff, title it like authoritative state of the art on current subject matter.

People are writing not because they have something to write but they have to write something.

He who pays the piper calls the tune, as they say.
There's a general misalignment of incentives in educational writing. As an author you want the maximum audience, which is gotten with a mixture of banal content and a bit of FOMO. This is because there are more beginners in almost anything, than there are more advanced people. There's overall no real incentive to make these people to actually learn something, as that would remove them from the audience.
The amount of YouTube tech grifters support this claim. Any seriously skilled dev will barely have an audience but channels skimming the water grow to millions.
This is my same complaint about interviews. I’m never asked to write some fancy algorithm and then figure out how to take it from O(n^3) to O(n). I’m asked to figure out why we’re fetching the user’s email from the db 6 times in one http request.
Zero to prod has that perfect balance of "this is do-able in a week" and "this feels like real code". I don't mind tutorials taking notes from this