17 comments

[ 2.9 ms ] story [ 60.6 ms ] thread
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.
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.

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.
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)

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.

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
This article is too basic and does not introduce anything you'd encounter in a typical Go project. If you want introduction to Go testing I recommend just reading the official docs https://pkg.go.dev/testing and understanding how to write table driven tests - https://go.dev/wiki/TableDrivenTests.

Going beyond what's built in, get familiar with https://github.com/stretchr/testify as that's used a lot.

Indeed. "Test driven development" is too big of a title for setting up such a basic project. And honestly I think a decent ChatGPT prompt will generate a tutorial that is clearer and more concise than this entire article.
(comment deleted)
That doesn't look like full introduction. That looks more like lecture notes to the lecture on debugging and testing of CS 101. Not even the full lecture, more like the note taker lost interest and fell asleep at the middle.
(comment deleted)