this post was submitted on 05 Jan 2025
194 points (98.0% liked)

Programming

17748 readers
325 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
all 34 comments
sorted by: hot top controversial new old
[–] drmoose@lemmy.world 10 points 1 day ago* (last edited 1 day ago) (1 children)

all of these tips are moot because of SEO. If you want anyone to actually read your article you still have to write for both the reader and the search engine unfortunately.

So, tips like the "Write clear headings" are often hard to actually implement as search engines prioritize keywords in headings and you'd be outranked by a dude who doesn't do that 99% of the time.

[–] Randelung@lemmy.world 9 points 1 day ago (1 children)
[–] kubica@fedia.io 45 points 2 days ago (5 children)

I don't quite agree that for a beginer being presented with

sudo apt update && \
  sudo apt install --yes software-properties-common && \
  sudo add-apt-repository --yes ppa:deadsnakes/ppa && \
  sudo apt install --yes python3.9

is better than

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9

All those symbols and "--yes" used to feel quite cryptic to me.

[–] eager_eagle@lemmy.world 7 points 1 day ago (1 children)

The argument is that a beginner might not notice a command falls. The && prevents further execution.

Personally I've seen that happen several times myself. Beginners are just not used to reading the cmd outputs and I can't blame them. There are many CLI tools with awful error reporting out there.

[–] Tamo240@programming.dev 6 points 1 day ago

That's why showing the expected outcome is also very important. It can feel very verbose, but the number of times I've been unclear as to if something worked because the documentation goes on immediately to the next step without demonstrating the success/failure states is extremely frustrating.

[–] Randelung@lemmy.world 6 points 1 day ago

It's not the same, though. One will stop if a previous command fails, the other will continue.

[–] SwordInStone@lemmy.world 16 points 2 days ago* (last edited 2 days ago)

yeah, I'd give it as 4 separate copy-pastable commands and then write "or as one command..."

[–] lunarul@lemmy.world 6 points 2 days ago

If it's a beginner trying to learn those commands, definitely the latter.

If it's a beginner trying to set up their environment for the actual thing they're trying to learn, then a fire and forget single command is more user-friendly.

[–] copygirl@lemmy.blahaj.zone 26 points 2 days ago (2 children)

Is providing a number of commands to use that require user input really that bad? When people start tinkering with the command line, first of all they shouldn't trust just anything on the website blindly, which at the very least requires a basic understanding of how to enter commands, and respond to the terminal asking for input. The following "bad" example..

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9

..is instead turned into this single command with even more confusing syntax for beginners:

sudo apt update && \
  sudo apt install --yes software-properties-common && \
  sudo add-apt-repository --yes ppa:deadsnakes/ppa && \
  sudo apt install --yes python3.9

Sure, it's convenient, but if you just throw blocks of code at people to run, are they really learning anything?

A better approach would be to have a quick tutorial on how to use the terminal and what the $ and # symbols mean (though they could be CSS decorators that can't be copied), what sudo is and warning people about running untrusted commands on their system. Then you just link to that at the top saying something along the lines of "if you're unfamiliar with running commands, and the following seems confusing, check this quick summary", behind a question mark icon connected to each block of commands, or similar.

[–] SwordInStone@lemmy.world 13 points 2 days ago* (last edited 2 days ago) (1 children)

I absolutely abhor it when the command includes $ that copies with it. It means nothing to the beginner's and the pros know it is a command.

I wrote under other comment:

yeah, I'd give it as 4 separate copy-pastable commands and then write "or as one command..."

[–] copygirl@lemmy.blahaj.zone 6 points 2 days ago

Yeah, it should not be part of the text just like line numbers shouldn't be part of the code on a code hosting site, yet it can be visible, no? Later it does recommend using $ to distinguish command and output. Is it now okay for a beginner to be confused about what it means?

[–] MonkderVierte@lemmy.ml 6 points 2 days ago

Rule number one: be wary of ppa.

Rule number two: they work only on Ubuntu, they will break your Debian or Debian derivative.

[–] HaleHirsute@infosec.pub 16 points 2 days ago

I just wanted to read that cartoon, here it is:

[–] dajoho@sh.itjust.works 9 points 2 days ago (3 children)

Am I the only one who finds the title abrasive? Why "rules"? Who are you and why should I listen to you? Will you send the tutorial police around if I ignore you? Maybe "recommendations" would be a better choice?

[–] MagicShel@lemmy.zip 7 points 2 days ago

Unless it's filled with specific uses of MUST, SHALL, and MAY, it's just opinion. This is the internet, so the IMO SHALL be assumed.

[–] SwordInStone@lemmy.world 3 points 2 days ago

not my title, but it is kinda in your face.

I agree "recommendations" or "pointers" would not come across as so selfğrighteous

[–] NostraDavid@programming.dev 1 points 2 days ago

Because rules are meant to be broken :3

This is beautiful. If only all tutorials were actually written well.

[–] deroyonz@lemmy.zip 4 points 1 day ago (1 children)

Think about the wording of the headings so that they communicate as much as possible without sacrificing brevity.

Which of these tutorials would you rather read?

  1. Go
  2. Installation
  3. Hello, world!
  4. Deployment

Or this?

  1. Why Choose Go?
  2. Install Go 1.23
  3. Create a Basic “Hello, World” Go App
  4. Deploy Your App to the Web

honestly, neither of those? I get the general point, the first one looks careless and vague, but the second one looks AI generated and needlessly long, hard to skim for what I'm looking for. Why do the headers say Go 3 times when I already know I am in a Go article? Why is the specific version in that one header (even if you will be pointing them to a specific one in the content)?

[–] xthexder@l.sw0.com 8 points 1 day ago

I got the same sort of impression in the "Write for beginners" section. The "good" example is like 3x as long but contains less actual information. The reader is already looking up a tutorial, you don't need to sell them on what they're about to do with marketing speak. I've really come to value conciseness in recent years.

[–] Boomkop3@reddthat.com 2 points 1 day ago (1 children)

Why not just:

  1. you're gonna learn this this and that

...

  1. now you should know what this this and that is
[–] FizzyOrange@programming.dev 2 points 1 day ago (1 children)

That's the "say what you're going to say, say it, then say what you said" advice from school. It's ok if you don't know any better, or maybe for particularly boring work presentations, but it isn't a golden rule that most people blindly repeating it think it is.

Think about the best presentations you've seen. They never do that. They're engaging enough that you don't need repeat things three times.

[–] Boomkop3@reddthat.com 2 points 1 day ago

I didn't get that in school, perhaps we're in a different country or something. It's not about being engaging or following a guideline. It's about setting goals and checking if you achieved them.

Every audience is different, every student learns at their own way and pace. A one size fits all solution doesn't exist. Some presentations may be awesome, but that takes more than just a good script and slideshow

[–] Sibbo@sopuli.xyz 5 points 2 days ago* (last edited 2 days ago) (3 children)

I stopped reading after the first example. One of them is described as "good" and the other as "bad". The bad one though does not actually fix the errors in the good one, but just leaves them out. The good one seems to be only an introduction. The bad one seems to be trying to convey content. Surely not very well, but comparing an introduction with content is like comparing apples with pears.

[–] tyler@programming.dev 2 points 1 day ago

The first two or three examples are really bad but the rest are quite good.

[–] protist@mander.xyz 4 points 2 days ago (1 children)

The two examples at the beginning are completely separate examples, not rewrites of each other. The comparison is in the readability for beginners, not the content.

[–] xthexder@l.sw0.com 3 points 1 day ago

I prefer my tutorials without reading someone's life story at the beginning. The intro contains so little info compared to the number of words being used. This reminds me of looking up a recipe and having to scroll past an essay on the history of someone's grandmother. I like it when documentation is as dense as possible, and ideally formatted in a logical way so it's easy to skim. Big paragraphs of English do not achieve this.

[–] SwordInStone@lemmy.world 2 points 2 days ago

sorry for your disappointment

[–] Ephera@lemmy.ml 4 points 2 days ago (1 children)

If only this stuff wouldn't eat so much time. I've been writing a library and it often feels like I'll spend 1 hour documenting for maybe 5 hours of implementing a feature. And I'm not even terribly happy with the documentation yet. 🫠

[–] SwordInStone@lemmy.world 6 points 2 days ago

That's still not a terrible ratio

[–] BaldManGoomba@lemmy.world 0 points 1 day ago

Why not both? People are motivated or get things in different ways sometimes I just need the command other times I need to understand why. As for titles of sections the funny or longer chapter lines I might remember better than the simple one.