There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

MajorHavoc , (edited ) in This is my life now, until I finally understand Cmake.

Thanks for the laugh.

That was also my experience, but it ended when I stopped using cmake.

I’m not mad at anyone for using cmake, but I consider myself blessed on each day that I don’t have to collaborate with them (on cmake).

Which is weird, because someone will have to pry a Makefile from my cold dead hands, someday.

xep , in This is my life now, until I finally understand Cmake.

The C in Cmake maybe stands for cat. It would make sense.

jupyter_rain OP ,
@jupyter_rain@discuss.tchncs.de avatar

I like this idea!

leggettc18 ,

In case anyone wants to know the actual answer, it stands for cross platform make, and my understanding is that it’s for generating build project files for various development environments. For instance, with one CMake file you can generate a Visual Studio Solution file, an XCode project file, a Makefile, etc. Several IDEs are also able to read CMake files directly.

Socsa ,

This thread is wild, I’m here like “cmake is by far the simplest way to cross compile to ARM and x86, with and without Cuda build targets” and y’all are talking about IDEs for some reason.

nexussapphire , in This is my life now, until I finally understand Cmake.

I forgot to assign a variable, now it crashes %5 of the time. It’s wild how c doesn’t default variables to null or something.

Endmaker ,

default variables to null or something

That is such a bad idea. Better to have the compiler warn you about it like in Rust, or have the linter / IDE highlight it.

nexussapphire ,

If it’s going to compile without any warnings I’d rather the app crash rather than continue execution with rogue values as it does now.

There is so much room for things like corrupted files or undocumented behavior until it crashes. Without the compiler babysitting you it’s a lot easier to find broken variables when they don’t point to garbage.

zaphod ,

Just enable all compiler warnings (and disable the ones you don’t care about), a good C compiler can tell you about using unassigned variables.

nexussapphire , (edited )

Still learning, they just covered compiler flags in cs. They didn’t go into detail yet though.

Edit: I’ve used python for years and they have something equally dumb. You can have a function in a massive application that is broken and the moment it’s called, the application crashes.

At any other point the application will just run as if nothing is wrong even though python evaluates everything at runtime. I’m sure they can’t do much because the initial launch would be slow.

CodeMonkey ,

C does exactly what you tell it, no more. Why waste cycles setting a variable to a zero state when a correct program will set it to whatever initial state it expects? It is not user friendly, but it is performant.

marcos ,

Except that this is wrong. C is free to do all kinds of things you didn’t ask it to, and will often initialize your variables without you writing it.

nexussapphire ,

Machine code would be a better example of what he’s talking about imo. Not an expert or anything of course.

marcos ,

Odds are that your computer doesn’t export any language where it will do exactly as you say (amd64 machine code certainly won’t execute exactly as written). And how much difference it makes varies from one language to another.

But the specific example from the OP, of uninitialized variables, is one of those cases where the C spec famously goes completely out of line and says your code can do whatever, run with a random value, fail, initialize it, format your hard drive, make a transaction on your bank account… whatever.

Hack3900 ,

Coding in C but if I don’t initialize a Variable the compiler formats my drive! (Not Clickbait)

nexussapphire ,

It wouldn’t be that much processing compared to the rest of the app. It would lot more efficient than running an effectively infinite loop or arithmetic on an arbitrarily large number as a result of an unsigned variables.

USSMojave , in This is my life now, until I finally understand Cmake.
@USSMojave@startrek.website avatar

There are cmake debuggers where you can walk through exactly what it’s doing line by line

jupyter_rain OP ,
@jupyter_rain@discuss.tchncs.de avatar

Do you have a good one which you can recommend?

USSMojave ,
@USSMojave@startrek.website avatar

cmake debugger

I use this one in vscodium open-vsx.org/vscode/item?itemName=ms-vscode.cmake…

jupyter_rain OP ,
@jupyter_rain@discuss.tchncs.de avatar

Thanks!

marcos ,

Who debugs the builds of the build debugger?

dgriffith ,

Someone with only a tenuous grip on their sanity, I’d imagine.

lung , in This is my life now, until I finally understand Cmake.
@lung@lemmy.world avatar

That’s like one thing ML can actually help with XD cute cat

Asudox , in This is my life now, until I finally understand Cmake.
@Asudox@lemmy.world avatar

I mean, all cmake does is run some commands for you. You not understanding cmake errors (mostly) means you don’t understand the errors given to you by the C/C++ compiler.

jupyter_rain OP ,
@jupyter_rain@discuss.tchncs.de avatar

Partly, yes. But I also think their documentation is a bit hard do read. Maybe this will get better with time.

Asudox ,
@Asudox@lemmy.world avatar

I use rust btw.

30p87 ,
@30p87@feddit.org avatar

I use distcc, and do not have to take vacation for my programs to finish compiling.

Asudox ,
@Asudox@lemmy.world avatar

If it means my code won’t panic out of nowhere and cause a disaster for me, I am willing to “take a vacation” for my program to finish compiling.

marcos ,

Maybe this will get better with time.

Yes, just give it a few more decades.

paperplane ,

CMake can also emit its own errors during the configure step though, particularly if you have complicated build logic and/or lots of external packages.

nihilomaster , in Don't use any clicking scripts.

That’s actually hilarious (provided you don’t actually use that information. otherwise it’s a dick move and probably a criminal offense in many places)

akash_rawal OP ,

I did not make this, and you’re supposed to put dummy details there. Don’t put actual credit card information.

Pika , in Don't use any clicking scripts.
@Pika@sh.itjust.works avatar

I don’t get the purpose of this, the page isn’t super clear unless I missed it. plus it wants card details?

SuperFola ,
@SuperFola@programming.dev avatar

A card grabber disguised as a game to me

akash_rawal OP ,

It is a game, but it might also be a card grabber.

akash_rawal OP ,

It wants you to put dummy details as fast as you can.

SatouKazuma , in Uh oh, what have I done

I don’t think I’ve ever produced spaghetti code in my life…

Because my code never works in the first place.

MashedTech OP ,
thebardingreen , (edited ) in How would your codebase (personal projects, work projects etc.) look as a burger?
@thebardingreen@lemmy.starlightkel.xyz avatar

My code projects lately?

“This project uses an API written in PHP, with HTML in Lua (OpenResty) and JavaScript. We’re starting with the PHP component, please write me a burger with cheese, bacon, lettuce, tomato, pickles, ketchup and mustard.”

“Absolutely! I’d be happy to help with that! I understand that we’re creating a burger in PHP. Here is a burger, with cheese, bacon, lettuce tomato and mustard. Explanation of the burger: The bacon is on top of the cheese, so it doesn’t fall off. The lettuce is included, to create an underlying HTML structure.”

https://lemmy.starlightkel.xyz/pictrs/image/79a6fd96-5fd9-4be1-b3b8-ffbce6641633.png

“Um, that’s not at all what I asked for. First of all, you completely forgot the ketchup, which I explicitly told you was a requirement. Secondly, you said there was mustard, but I don’t see any. Third, the cheese is cottage cheese? No one puts that on burgers! Why would you put cottage cheese? Third, the bacon is turkey bacon. That’s not what I wanted at all. On top of that, the lettuce is UNDER the burger, not ON it. We’re not writing HTML, this is meant to be a rest API. All the output should be JSON.

Please try again. Write me a burger in PHP with pig bacon, mustard and ketchup, which you forgot to include last time, cheddar cheese (NOT cottage cheese) and tomato, pickles and lettuce INSIDE the bun. This is an API, so don’t write any HTML!”

“I appologize for the misunderstanding. Here is your burger with bacon (made from pigs, not turkey), mustard, ketchup, cheddar cheese, tomato, pickles and lettuce inside the bun. I understand this is an API, so I’ve taken out the HTML. Please let me know if there’s anything else I can help you with.”

https://lemmy.starlightkel.xyz/pictrs/image/b3aaee27-1097-483d-bd3a-0b14fe64262f.png

“It looks like you’ve called a function to put the lettuce inside the bun, but you never created that function?”

“You are correct. Your PHP code would need to have the function defined to put the lettuce inside the bun. Here is your updated PHP code with the putLettuceInsideBun function included.”

https://lemmy.starlightkel.xyz/pictrs/image/55ce6d44-4425-481a-a133-afd3f18387e4.png

“Thank you, there’s a tomato and the lettuce is inside the bun now. I’m not sure why you called the putLettuceInsideBun() function twice, but at least it’s in there now. I note there’s still no bacon, cheese, ketchup or mustard. You know what? I’m just going to write those parts myself!”

“Writing PHP code can be a fun and educational challenge! Please let me know if I can assist you any further with your PHP hot dog grilling project.”

ornery_chemist , in How would your codebase (personal projects, work projects etc.) look as a burger?

I mean… just rotate it 90 degrees ((()))

niktemadur , in I hate it

It’s curious, but in my mind these types of mathematical or logical visualizations are the sheep I count, trying to sense the deeper flow and patterns where the emergent oddities even out.

That’s when I know I will soon fall fast asleep, when my mind starts getting abstract.

henfredemars , in Uh oh, what have I done

My code is self-obfuscating.

deuleb_biezelbob ,
@deuleb_biezelbob@programming.dev avatar

Hi I work for Denuvo, do you have a minute?

henfredemars ,

Ah yes, The generated VM and callback-based obfuscator.

CanadaPlus , in Detailed Error Messages

Man, actually seeing this in a wild log would make my day.

iAvicenna , in Detailed Error Messages
@iAvicenna@lemmy.world avatar

I can tell by the error msg this wasn’t an error before and was the cause of much grief

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines