Hacker News new | ask | show | jobs
by hiatus 978 days ago
Shouldn't the tutorial author be specifying a version in the tutorial?
1 comments

Normally tutorials ask readers to install latest versions of everything. If you have to provide a version for every package used in a tutorial, it means that every time any of such dependencies releases a new version the tutorial has to be updated. I guess it is possible for a blog post, but how can I update my books or my videos?
There lies the issue. Installing the latest version of everything for a newly published tutorial, or one that is a few months old, you'll typically get the experience you'd expect.

But trying to follow along to a tutorial that is old and asks you to install latest version of anything likely means that you won't get far.

As someone that's written many tutorials, I've been guilty of using "latest" but have been much more proactive here to call out specific versions used at the top of my articles. Nothing worse than getting through half a tutorial to find out something has completely changed.

> Normally tutorials ask readers to install latest versions of everything.

They shouldn't.

They should be doing specified versions, either precise or bounded to the degree you trust the dependency suppliers semver compliance.

> If you have to provide a version for every package used in a tutorial, it means that every time any of such dependencies releases a new version the tutorial has to be updated.

No. It doesn't. You document what version is covered. You then have the choice to update that or not.

OTOH, failing to specify dependency versions means every time abmny of the dependencies releases a new version, the tutorial potentially breaks, which is much worse than working fine but not using a newer version of a dependency when you are not, in either case, using any new features of the new version. (Because if you aren’t upgrading the tutorial, its not covering features of the new version, even if the loosely-specified packages mean uses will pull in the new versions.)

Surely you should specify at least the major version, and/or the version you tested on. Otherwise you are throwing out the entire point of semantic (or semantic-like) versioning.
Pip has special syntax for "compatible version" `package~=X.Y`, how about you just always use that in tutorials? The people watching tutorial videos need all the help they can get, why not give them hygienic dependency practices?
next you'll demand people put dates on tutorials, like people even want to know if a tutorial is 10 years old.
> how can I update my books or my videos?

You shouldn't need to. How/why are you writing tutorials for major versions that don't exist yet?

> `pip install flask` installs the latest version, which is 2.0 at the time of writing

If there is a major version upgrade to a dependency, you would have to update the tutorials if there is a backwards-incompatible change.