This thread is for anyone working on personal projects to share their progress, and hold themselves somewhat accountable to a group of peers.
Post your project, your progress from last week, and what you hope to accomplish this week.
If you want to be pinged with a reminder asking about your project, let me know, and I'll harass you each week until you cancel the service
Jump in the discussion.
No email address required.
Notes -
How have you been doing @Southkraut?
Lots of time wasted on engine switching and reconsideration. Better focus more on disassociation from engine even at cost to performance. Said this before, but optimization always draws me towards tighter integration - need to not do that. A cleaner separation with minimal engine specificity (is that a word?). Don't let the siren song of premature optimization lure me from the good path.
Is there a way to do C++ without header files? I realize it's incredibly petty, but having two files per class just keeps turning me off of Unreal.
Other than that, I keep comparing engines.
Unity:
Unreal:
Godot:
Redot:
Stride:
No idea where I'm going with this. Right now I'm trying to fiddle some dev time into my new routines. Not yet sure how to. Maybe I'll just get used to the job and end up being less weary by the end of the workday so I can get something done in the evenings, or maybe I'll follow a friend's recommendation and just get up even earlier to do some coding in the mornings. Or maybe I'll find a way to take a few short breaks (legitimate breaks, not slacking off.) during work to...I don't know, dictate code to my phone?
I wouldn't recommend it as a permanent process, but when I'm sketching things out I often define functions within class definitions in headers. You can almost get to a point where you only have header files, but there are a few caveats (circular dependencies, static member initialization, inlined code size) that prevent me from liking it for bigger projects. But it can be helpful if you haven't finalized interfaces since there is only one place they are defined.
More options
Context Copy link
If you're creating an application or something like a dynamic library using someone else's API, technically you can put every single thing into one giant .C file with no header files and it'll work. If you're creating a library for others to use, either it needs to be "header-only" (i.e. it all gets recompiled by every user, which really only makes sense for pure-template code where the user does every instantiation) or it needs to have separation between declarations in headers (for the users' compiler) and definitions in source files (for the users' linker). Technically you can mark all your definitions as
inline
and put them in headers and just have one file per class even if you're not doing fancy template tricks, but people don't do this, just to avoid longer recompile times.It's common to have more than one class declaration per header file, but for big projects it's just easier to keep everything organized if you have one class per header.
It's not uncommon to do "unity builds" (no relation to the game engine), where a bunch of source files get batched together so that (because of include guards) the header files only have to get parsed once per batch rather than once per file. This is just to reduce compile times and allow for more Inter-Procedural Optimization in a single compiler pass, AFAIK.
Complaining about two files per class isn't petty so much as weird, though. Partly I say this because I love having two files per class (the declarations are "what does this do", which is easier to read when removed from "what messy tricks does this use to do it" definitions), but mostly I say this because there's so much more in C++ to complain about. I'd have imagined a C# fan would have been most annoyed by having to manually manage heap allocations, with no garbage collection.
I thought that was the general consensus. People also think it's the hardest engine to use (which is why I played with Godot with my kids, despite C++ experience myself), but AFAIK it's had the most features for forever and people manage to wring out the most performance from it too.
It is. I posted late at night and was tired and got dumb and messed up my Englisch to the point of stating the opposite of what I intended. Contend, contest, contradict...Nach Müd kommt Blöd.
More options
Context Copy link
Modern C++ is much less painful in this regard. The days of
new()
anddelete()
are long gone.find /usr/include/c++/14/ -type f | xargs grep '= new'
still shows me nearly a hundred uses in standard library headers, so "long gone" is a bit of an exaggeration. If libstdc++ authors are still at that point, imagine where your average coworkers are. ;-)I admit that
shared_ptr
was nice, and the development of "likeauto_ptr
, but you can put it in containers" was a godsend. Pointinggrep
at my own favorite project I still see 6 invocations ofnew
in non-deprecated code, versus about 800 invocations ofmake_unique
.But I'd still argue that even modern
unique_ptr
best-practices count as manual management and are thus more annoying than "the programming language will just figure it out". Even if you try to mimic garbage collection behavior withshared_ptr
you still have to worry about leaking unreachable cycles of pointers that a garbage collector would have been able to detect. This is all a useful sort of annoying if you write any sort of interactive code where big a garbage collection sweep might drop a frame or add input latency or whatever, and even garbage collected code can leak memory because "I forgot to remove a reference" isn't a drastically different bug from "I forgot to delete an allocation", but heap management is still the thing I notice the most complaints about when users of other languages first move to C++.More options
Context Copy link
More options
Context Copy link
More options
Context Copy link
More options
Context Copy link
More options
Context Copy link