Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
gregstula
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
gregstula
7y ago
Hi, I decided to get back into C++ by making a project with a clear criteria. This project uses some C++17 features like structured binding so a modern-ish compiler is required. This is my first Show HN post, so feedback and code review is
2.
▲
Show HN: Quick Snake – A fast-paced snake game for the terminal
(github.com)
5 points
by
gregstula
7y ago
|
1 comments
3.
▲
by
gregstula
10y ago
It does get easier to read and code over time. As an aside, the C++ in this post is pretty much as elegant as it gets.
4.
▲
by
gregstula
11y ago
> Unreal's game-level memory management system uses reflection to implement garbage collection. Yep. Game-level garbage collected C++. Which is exactly what I said, I just a didn't mention GC on C++ to avoid obscuring my po
5.
▲
by
gregstula
11y ago
You asked a question about the array and I answered it. Yeah I missed the part where you said mmap. There's libraries that make that safer, but clearly there's a preference for working with the raw tools here. > Otherwise have
6.
▲
by
gregstula
11y ago
> What is the alignment of your std::array? What is the memory type (e.g. can the GPU read from it at all? Can it write? What are cache policies?). The alternative though is not a C array, it's an explicit memory mapping. Guaranteed
7.
▲
by
gregstula
11y ago
> I don't know anybody who would agree with this. std::array<int,ARR_SIZE> is better than int arr[ARR_SIZE] I don't know how you could disagree with that after looking at the facts. From what you're saying here, ther
8.
▲
by
gregstula
11y ago
Why couldn't you use a structure to encapsulate the table and then have the destructor to deallocate the the array? This is how vector works.
9.
▲
by
gregstula
11y ago
They do not have garbage collection. You're conflating game development with game engine development. When a big powerful, flexible, C++ engine has been written for you, you can use C# or JavaScript or BluePrints to use the engine to m
10.
▲
by
gregstula
11y ago
Right, you use C++ to build game engines, you can use scripting languages on top of that once the engine is built.
11.
▲
by
gregstula
11y ago
Unreal and Unity were built using C++. They offer garbage collected languages on top of their C++ game engines for scripting game logic. Any significant modifications to the engine will need to be done in C++
12.
▲
by
gregstula
11y ago
Can you give me an example of soft real time game that isn't hurt by the presence of a garbage collector?
13.
▲
by
gregstula
11y ago
It's gross because it's written in "C with namespaces and overloading" Preferring #define for constants over constexpr is 100% the result of C++ bigotry. It's a laughable decision. constexpr gives you the power of t
14.
▲
by
gregstula
11y ago
Do you know why Microsoft rewrote Minecraft in C++? Games can certainly be successful in spite of performance problems, but why purposefully introduce them in the first place? In the case of Notch, he used Java because he was most skilled a
15.
▲
by
gregstula
11y ago
> Abstractions like RAII, constructors and destructors, polymorphism, and exceptions were invented with the intention of solving problems that game programmers don’t have This is the only part of the Jai philosophy I struggle to understa