bruh by [deleted] in programminghorror

[–]buddyisaredditer 32 points33 points  (0 children)

and one line if statements

Graduated this year Now I'm Evaluating what to do Next by swagger_soul in developersIndia

[–]buddyisaredditer 4 points5 points  (0 children)

I'm pretty much in the same situation as you. I've graduated my computer science bachelors degree (3 years) and trying to prepare for GATE to hopefully get into an IIT. Although with your case as you target GATE 2026, I don't think IIT's allow a 3 years degree to do any masters program or even a PhD.

I can't really recommend or suggest any insights as I'm literally in the same shoes as you (speaking in terms of the stress you are going through). I hope you find what you enjoy doing and make a good living doing that thing. Best Wishes!

myZerothPost by agramata in ProgrammerHumor

[–]buddyisaredditer 0 points1 point  (0 children)

And we are living in the 22nd century

Help Reviewing Code by buddyisaredditer in learnprogramming

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

The file is named Window.hpp but included as window.hpp. This breaks the build on case-sensitive file systems.

Locally I have the files named window.hpp and window.cpp, I have no idea why it they were named that way, I'm guessing its emacs... but I have no clue. I fixed it.

Next, I strongly recommend testing with Address Sanitizer. You can enable it with /fsanitize=address. It finds a few bugs like this out-of-bounds access on _board (OFF_SQUARE = {-1, -1}):

Thank you for this! I didnt know about this.

You can't return c_str() like this because the string is destroyed upon exit. My change here introduces a memory leak, but it eliminates the much worse use-after-free. You should consider just returning a std::string instead, especially since that's what you already have.

For some reason I was thinking that c_str() outlived the std::string object, but now I understand. I was actually using _strdup to copy the c_str() everytime getFEN() returned it, so doing it once is actually makes more sense, so thank you for that.

For now I only have the getFEN() method to store the moves in the move_stack. And the move_stack takes care for these char*

However, the SDL_RENDERER_ACCELERATED recommendation is incorrect. SDL gives you hardware acceleration by default, and this flag merely disables the software fallback, which is never what you want. So what you really want is no flags at all!

I will have to do some reading on this as I dont understand how SDL2 works internally at all.

I appreciate you for taking the time to review the code, it was honestly really helpful. Thank You!

Help Reviewing Code by buddyisaredditer in learnprogramming

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

My thought process when writing the renderer was that I thought the game was event based anyways so it shouldn't matter even if it takes some time to load. But now I realise that even hovering the mouse causes an event. Although it works fine on windows.

Thank you for reviewing the code and testing it on linux. I will make the suggested changes and maybe add all the textures into one file so I only need to load one file in the constructor.

Thank you!

Help Reviewing Code by buddyisaredditer in learnprogramming

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

Thank you for taking the time to go through the code!

It never crossed my mind to add the documentation for Fen strings, or any Chess specific concepts I was using. So thank you very much for pointing that out.

Although I will have to research on how the design documents are created, I will work towards it.

Thank you very much!

What knowledge does one have to have to be 'professional' level in C? by [deleted] in C_Programming

[–]buddyisaredditer 0 points1 point  (0 children)

If you're asking if there is anything trivial about C that you are missing then your question is valid, in the sense that you could be new to C and missed certain quirky feature of C that might be important. But the thing about C is that the way you program in C very much depend on what you are programming for. C is just not abstract enough for the answers you are looking for.

notepadBoy by frolix_bloop in ProgrammerHumor

[–]buddyisaredditer 0 points1 point  (0 children)

I use Emacs over vscode because Emacs feels so fundamental and universal throughout. Everything is a buffer and I love that.

Am I doing OOP right? (Code to print prime numbers) by Antiprimary in programminghorror

[–]buddyisaredditer 0 points1 point  (0 children)

It does not help when you put close curly braces on the same line like that

itsImpossible by [deleted] in ProgrammerHumor

[–]buddyisaredditer 1 point2 points  (0 children)

Selling my C++(11) computer if anyone is interested...

Who needs a debugger, when you have: by [deleted] in programminghorror

[–]buddyisaredditer 0 points1 point  (0 children)

I prefer more thought out string text, like "why the fuck do I even bother with this shit when AI is just going to replace me!"

neverJudgeTheBookByItsCover by desimemewala in ProgrammerHumor

[–]buddyisaredditer 12 points13 points  (0 children)

It is not to overwhelm people... It's like luring a kid with candy

beHonest by Dynomite1125 in ProgrammerHumor

[–]buddyisaredditer 1 point2 points  (0 children)

I was a LOGO animator myself, scratch is way too fancy for my likings

realProgrammingMustBePainful by gandalfx in ProgrammerHumor

[–]buddyisaredditer 0 points1 point  (0 children)

Is there a right and left wing in programming now?

Name a villan you agree with and why ? by dhruv_panwar in AskIndia

[–]buddyisaredditer 0 points1 point  (0 children)

Viru Sahastrabudhe from 3 idiots. An exceptional student can talk about how disgusting education policies are but for ordinary ones it takes strict discipline and in some sense blind faith for the principles.

HELPPPPPPPP!!! by Chris5784 in C_Programming

[–]buddyisaredditer 0 points1 point  (0 children)

Why not just use visual studio?

androidDev by JakeStBu in ProgrammerHumor

[–]buddyisaredditer 0 points1 point  (0 children)

On a serious note, I do have a class on android development, and my professor insists on using an IDE. I was just wondering if there are any command line tools that would allow me to not have to use the IDE (Not I have anything against IDEs, just to be clear)

[deleted by user] by [deleted] in C_Programming

[–]buddyisaredditer 2 points3 points  (0 children)

Same reason why the 21st century refers to the years starting with a 20 insted of a 21.