8
submitted 6 days ago* (last edited 6 days ago) by EuAndreh@programming.dev to c/programming@programming.dev

Back writing in my website.

you are viewing a single comment's thread
view the rest of the comments
[-] EuAndreh@programming.dev 4 points 6 days ago* (last edited 6 days ago)

C89, AKA ANSI C famously only supports /* */, having // as a cross-pollinated idea from C++.

[-] thingsiplay@lemmy.ml 4 points 6 days ago* (last edited 6 days ago)

Good example, at least historical. ;-) I wonder why they never added single line comments before. I mean it took them quite a long time to do so. Languages before 1960 even had single lines too.

Edit: BTW it was common in C to write multiline comments to have them look like single line comments too, because that's easier to read and understand. Maybe that's why they didn't feel the need for, because in practical usage it could be replicated. In example as:

/* Title
 * description
 * variables
 */

This could easily be replaced by single lines as:

// Title
// description
// variables
this post was submitted on 05 Sep 2026
8 points (78.6% liked)

Programming

28428 readers
223 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 3 years ago
MODERATORS