this post was submitted on 05 Jan 2025
198 points (98.1% liked)

Programming

17759 readers
835 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 [email protected]



founded 2 years ago
MODERATORS
198
submitted 3 days ago* (last edited 3 days ago) by [email protected] to c/programming
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 26 points 3 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.

[–] [email protected] 13 points 3 days ago* (last edited 3 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..."

[–] [email protected] 6 points 3 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?

[–] [email protected] 6 points 3 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.