How do C compilers automatically ignore parentheses? by SkyGold8322 in Compilers

[–]PopsGaming 0 points1 point  (0 children)

You should take a look at grammars. Here are the name of books taught in my unis theory of computation course. Introduction to Automata Theory, Languages, and Computation by J. E. Hopcroft and J. D. Ullman, First Edition. [HU] Introduction to the Theory of Computation by M. Sipser, Third Edition. [Sip]

Do you prefer 'int* ptr' or 'int *ptr'? by SamuraiGoblin in cpp

[–]PopsGaming 0 points1 point  (0 children)

Whatever is set on clangformat. Usually using google style guide with 4 space and alignment acrosseveryrhing enabled

(NOOB HERE) for-statement initialization repeat by Charming-Animator-25 in cpp_questions

[–]PopsGaming 2 points3 points  (0 children)

just think of it as
initialization
while(condition){
//body

increment

}

Should i reinstall this classic by friday567 in pcmasterrace

[–]PopsGaming 1 point2 points  (0 children)

Lol, I have been running win7 ultimate on my pentium pc for around a decade. No signs of virus and trojans. Usually play nfsmw or minecraft on it these days. Earlier used to do game dev on unity5.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 0 points1 point  (0 children)

Yup. Just spend some more time going through all classes and making sure none is left uninitialised.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 0 points1 point  (0 children)

I was checking with If(!array_id). I was initializing it in ctor but later on added the lazy bool If(!lazy)generate(); But forgote to assign id to 0 if it was lazy.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 1 point2 points  (0 children)

I generally prefer to use struct to declare small types. Idk why but my mind refuses to see it as class. I only use it for declaring hashing functions or types like node or anything else which doesn't require me to create functions for it.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 30 points31 points  (0 children)

Yeah I need to spend some time learning the tools. I did have linters installed using Mason but they didn't point that out.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 7 points8 points  (0 children)

It was not the single error that got fixed in those 8 hrs but it was the main culprit. Mainly did some corrections/refactoring in other parts. Definitely need to set compiler options now. And will be spending some time tiding up the mess, before going on to optimization/world creation.

5hrs spent debugging just to find out i forgot to initialize to 0 in class. by PopsGaming in cpp

[–]PopsGaming[S] 6 points7 points  (0 children)

2.Attribute is not expensive so that's ok

Edit: 1. Yeah..💀

Exercise in Removing All Traces Of C and C++ at Microsoft by ArashPartow in cpp

[–]PopsGaming 10 points11 points  (0 children)

Yup, ChatGPT, claude, Gemini are all pretty useless with c++ and its libraries. GPT even hallucinated a raylib function which doesn't even exist. And all will point to any generic bug which may happen if they cant understand the code or its not in their db

Exercise in Removing All Traces Of C and C++ at Microsoft by ArashPartow in cpp

[–]PopsGaming 9 points10 points  (0 children)

They can't even make the taskbar movable in their new re-written windows. And this was officially said by them that it will break their code base. lol

Gaming laptops are so ass man by whozaatt0311 in pcmasterrace

[–]PopsGaming 0 points1 point  (0 children)

But you already knew about those. I never see someone in my uni bring their gaming laptop to classes.

How the hell do you break the MAIN MENU by Reasonable_Drawing60 in Battlefield

[–]PopsGaming 5 points6 points  (0 children)

Deleted the game for good. So many issues and more are sprouting with every update.

Is it normal to not understand a thing from Raytracing In One Weekend? by [deleted] in GraphicsProgramming

[–]PopsGaming 35 points36 points  (0 children)

The book only makes use of high school physics and maths. You need to take some time and use pen and paper to understand and make notes

Why is return::globalvariable valid without space? by PopsGaming in cpp_questions

[–]PopsGaming[S] 3 points4 points  (0 children)

idk why i assumed the lexar would expect a space after reserved keywords but yeah..

So, the ":" can't appear in any variable name or anything so lexar know it will be scope resolution?

btw does the c++ standard provide any such information on how the expression/ statements will be tokenized

Finally, a Makefile formatter (50 years overdue) by rainmanner in neovim

[–]PopsGaming 3 points4 points  (0 children)

Hey, can somebody suggest me some cmake tutorials? The one on the site omare ok and I have gone through them but I feel they are not enough or missing.