Amateur Programmer Thread

Did you check any of the results from cplusplus.com? There are some really solid posts there.

Long answer: Honestly I think unless you have a specific reason to use C++, there is probably a better language for you to pick in 2023. I mostly just know what I know because my unversity classes were taught in C++ and because I'm working in unreal rn.

Short answer: microcontrollers. pick a fun pico project and write it in c++ instead of python. diy game controller or keyboard is probably a good one cuz you'll learn about the usb spec and/or xinput/dinput

I know it has like a mistique and this reputation of like "real programmers code in a low level language like C or C++", but the truth is that actually working in c++ is kinda clunky and is probably going to cause you more problems than benefits unless you are doing something that actually needs it.

Like as hobbiest if you wanna dip your toes into more unmanaged memory stuff to learn and for fun, you can still do it in a language like C# and you're going to spend way less time doing annoying busywork.

1 Like

no i just googled and that didn't show up. ty for the rec ill peep.

Edit: im not going to use them for this, but i 100% forgot friend functions were even a thing and what a neat and scary feature lol.

2 Likes

Scary? You're scared of code? It's just text on the screen.
Have you heard of Amnesia: The Dark Descent? Now that's scary. It's the new hot game, look it up.

2 Likes

ya im scared of code

you still doin that VR thingy?

.

nah i sold out a while ago. work for a big studio now. its much nicer even if the games i work on are a lot less cool to me.

but its like twice the money for less work

1 Like

It beats burning out that's for sure

c++ standard libarary data structures are so cringe holy shit

1 Like

They are incredibly lit

what do you like about them?

He troll

There's only like 3 data structures: map, set, and vec. How can they be cringe

they use non conventional naming conventions in a very cringe way

i'd even go as far as to say a lot of the function names are straight up bad. like a lot of it is cringe in a way that i guess could be 'personal preference' (ie i prefer camel case to snake case) but i also think some things are actually just bad.

like one example is how it uses empty() to mean 'is empty' and clear() to mean 'empty/clear the data struct'

a lot of people say shit like 'just use this attribute that gives you a warning if you dont use the return value'. I think this is insane cope. Like if you acknowledge its confusing enough that you need an attribute to give people warnings, then its probably a bad function name.

I keep editing cuz im heated but another dumb thing:

They use size() to mean count, which is dumb because if you dont use the std library you might reasonably assume size means either capacity or size_of(data struct), which is an important distinction.

I want to preface this at the outset: this is f*g talk.

Get it out of your head that the "name" of the function alone could ever inform the developer about what's going on; the base unit is the method signature: name, parameters, parameter types, and the return value.

The example that comes to mind is operator overloading with binary operations (+, -, *). It's rather obvious that some understanding of the RHS/LHS types is required to even know what these do (could be monoidal add, could be string concatenation, who has a clue).

empty()/clear() doesn't seem to be an issue to me.

but there's nothing that could ever effectively differentiate size(), count(), length(), whatever with name alone. For a Vector type there's how many different interpretations for someone who doesn't know?

A) The size of the value on the stack
B) The size of the value on the stack + the allocated memory on the heap.
C) The number of elements currently within the vector.
D) The number of elements that the data structure can currently hold (think capacity).

If anything, the retval is the most important part here (and C/C++ is awful with retval, between error codes being ints/actual functions returning ints, whatever); if there's a sufficient type system you could wrap A & B in some sort of type like BytesAllocated(int) and C & D could be just integers.

I would just give up on thinking that the name alone could ever fully inform you as to what you're doing.

1 Like

the solution is the type system and the one within C++ isn't complex enough to solve it: get over it.

Your language is only following good convention if it has the same language semantics as RPG Maker or UnityGameDev Framework.

1 Like

Naming is the problem? The problem is that the 'objects' or 'structures' have associated functions at all. OOP is trash.