> make a joke about not liking C++
> defenders come out to say how it's great for game development and systems programming
> video is about a window manager
> "I'm very confused why people are bringing these up"
Conversation
Notices
-
Embed this notice
Brodie Robertson (brodieonlinux@linuxrocks.online)'s status on Tuesday, 30-Jul-2024 02:37:47 JST Brodie Robertson -
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Tuesday, 30-Jul-2024 02:37:34 JST 翠星石 @BrodieOnLinux >Functions are just named goto statements lol
They aren't.
While you can use `goto` to jump to a function address, things explode when you hit `ret`.
Typically you would want to push non-saved registers onto the stack, before `call`ing the function, so the working variables aren't overwritten and the return address is pushed to the stack, so the function actually returns on hitting `ret`. -
Embed this notice
Brodie Robertson (brodieonlinux@linuxrocks.online)'s status on Tuesday, 30-Jul-2024 02:37:35 JST Brodie Robertson @prlzx Functions are just named goto statements lol
-
Embed this notice
Paul L (prlzx@hostux.social)'s status on Tuesday, 30-Jul-2024 02:37:37 JST Paul L @BrodieOnLinux
Assembly language programmers will be along shortly to tell you how jumps (goto) have been around since forever and are not considered problematic at that level,and underpin most high level control structures like loops, if/then/else and switch/case.
-
Embed this notice
Brodie Robertson (brodieonlinux@linuxrocks.online)'s status on Tuesday, 30-Jul-2024 02:37:38 JST Brodie Robertson @Eclipse @Mangdries Overloads are a cool feature when used sparingly and in contexts that make sense, however that's the problem. People recommend avoiding overloads for the same reason as goto, some developers cannot be trusted to use them in a sensible way
-
Embed this notice
Mangdries (mangdries@fosstodon.org)'s status on Tuesday, 30-Jul-2024 02:37:46 JST Mangdries @BrodieOnLinux
C++ is a mixed bag for me. The abstractions it provides is really nice; I can just use the stdlib and it works without having to worry about safety as much (and the convenience). On the other hand some features make it miserable to read and try to understand what some code is actually supposed to do. I typically use C++ over C but mostly just write C with some of the C++ features to get the best of both languages. :c_language: :cpp_language: -
Embed this notice
Kit, local computer gremlin (eclipse@nerdculture.de)'s status on Tuesday, 30-Jul-2024 02:37:46 JST Kit, local computer gremlin @Mangdries @BrodieOnLinux for me pervasive overloading (looking at you std::cout) makes C++ pain to read
-
Embed this notice
翠星石 (suiseiseki@freesoftwareextremist.com)'s status on Tuesday, 30-Jul-2024 22:42:00 JST 翠星石 @BrodieOnLinux Good jokes are correct. -
Embed this notice
Brodie Robertson (brodieonlinux@linuxrocks.online)'s status on Tuesday, 30-Jul-2024 22:42:01 JST Brodie Robertson @Suiseiseki The lol implies it's a joke
-
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Tuesday, 30-Jul-2024 22:45:47 JST Pleroma-tan @BrodieOnLinux everybody should just write machine code in hex with a hex editor
-
Embed this notice