this post was submitted on 21 Dec 2025
457 points (100.0% liked)

Technology

77928 readers
2669 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] truthfultemporarily@feddit.org 93 points 3 days ago (5 children)

They wrote this without googling anything.

[–] mech@feddit.org 56 points 3 days ago (1 children)

They wrote this without autocompletion or syntax highlighting.

[–] Nanook@lemmy.zip 33 points 3 days ago (1 children)

They had PAPER NOTEBOOKS cheats

[–] bstix@feddit.dk 13 points 3 days ago

They also used the classic they knew what they were doing shortcut.

[–] bigfondue@lemmy.world 33 points 3 days ago* (last edited 3 days ago) (1 children)

It's actually really easy when you get to make everything up as you go along. Like the transistor, and C, and Unix. That place was something else. The modern world was born in NJ

[–] WhiskyTangoFoxtrot@lemmy.world 20 points 3 days ago (1 children)

The modern world was born in NJ

* looks at modern world *

Yeah, that tracks.

[–] bigfondue@lemmy.world 4 points 3 days ago* (last edited 3 days ago)

Yea I thought about having 'for better for worse' in the post, but I lived in NJ so I'll let them have a little glory for once

[–] xthexder@l.sw0.com 26 points 3 days ago (1 children)

Hello World in 1974: echo.c

main(argc, argv)
int argc;
char *argv[];
{
	int i;

	argc--;
	for(i=1; i<=argc; i++)
		printf("%s%c", argv[i], i==argc? '\n': ' ');
}
[–] ZoteTheMighty@lemmy.zip 10 points 3 days ago (1 children)

Bloat, they wasted an extra integer operation with argc--.

[–] xthexder@l.sw0.com 10 points 3 days ago (2 children)

I think it's actually quite elegant. No matter what it has to skip over argument 0 which will be the executable name echo.
If the subtraction was removed and the loop changed to <, it would then need to do an addition or subtraction inside the loop to check if it's the last argument.

[–] palordrolap@fedia.io 5 points 3 days ago (2 children)

The real question might be whether the compiler was smart enough to change var++ and var-- into ++var and --var when the initial values aren't needed.

As compiler optimisations go, it's a fairly obvious one, but it was 1974 and putting checks like that in the compiler would increase its size and slow it down when both space and time were at a premium.

[–] xthexder@l.sw0.com 7 points 3 days ago

Well, good news, the source code is right there. Someone can go check (it probably won't be me)

I was going to guess the same regarding the time period.

[–] surewhynotlem@lemmy.world 3 points 3 days ago

Or they just drop the =

[–] bigfondue@lemmy.world 12 points 3 days ago* (last edited 3 days ago) (1 children)

If you had a question about C, you would just consult K&R, and I don't mean the book

[–] ylph@lemmy.world 4 points 2 days ago (1 children)

I worked at Bell Labs in the 90s, on wireless stuff, but we were still using the "in house" cfront compiler at the time, and would e-mail the compiler group, which included Bjarne Stroustrup, with issues sometimes. I learned C++ from his book before I joined Bell Labs, so that was a bit of a holy shit moment for sure for me then.

Kernighan, Ritchie and Thompson all still worked at Bell Labs as well at the time, but the company was huge then, and they were all in a different location from my team, so I never had any opportunities to meet them.

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

Have you read Unix: A History and a Memoir? I only started it, but the first chapter or two is just Kernighan talking about Bell Labs.

[–] BreadstickNinja@lemmy.world 4 points 2 days ago

They were chatting with ELIZA and vibe coded the whole thing