unsafeCode

230 points · 13 comments · view on lemmy.world

13 Comments

30p87@feddit.org · 24 pts · 1y (9 replies)

Should return 0;.

Kwdg@discuss.tchncs.de · 26 pts · 1y (2 replies)

Not needed, main in C++ implicitly returns 0 if there is no return

30p87@feddit.org · -1 pts · 1y (1 reply)

Should ≠ Needs to

You can do it, and it will work, but it's unclean and not best-practice. I wouldn't be surprised if it's undefined behaviour.

xmunk@sh.itjust.works · 22 pts · 1y

Just to clarify. It is defined behavior - there's plenty of undefined behavior in C but that ain't one of them.

syklemil@discuss.tchncs.de · 20 pts · 1y (5 replies)

>What is C++? A miserable huge pile of "should"s

shotgun_crab@lemmy.world · 8 pts · 1y

Love me some Castlevania++

30p87@feddit.org · 1 pts · 1y

Still love it tho. You can make it whatever you want!

riodoro1@lemmy.world · 1 pts · 1y (2 replies)

should have a space after „>” and two new lines after „?”.

I guess markdown is miserable as well.

kboy101222@sh.itjust.works · 5 pts · 1y

Hey now, markdown serves it's purpose. It's not great, but as a web dev, I don't want people expecting full WYSIWYG editors in every website cause fuck that!

xtools@programming.dev · 3 pts · 1y

not being able to master markdown might hint at why the commenter is struggling with C++

onlinepersona@programming.dev · 2 pts · 1y (2 replies)

Didn't you know that C++ programmers are better than compilers at checking code for safety though? And if they aren't, it's a skill issue.

/s

Anti Commercial-AI license

cm0002@lemmy.world · 3 pts · 1y (1 reply)

It's all worth it for that sweet sweet 50ms speedup!/s

lord_ryvan@ttrpg.network · 1 pts · 1y

And sensible compile times.

I'm trying to write a game in Bevy but my laptop's Intel 7400 taking almost a minute to compile even small changes is really killing me.
I've looked up rustc compile times on different CPUs and am seriously considering getting a new laptop with a Snapdragon X Elite or something in that vein for this.

KindaABigDyl@programming.dev · 1 pts · 1y
[ removed ]