Earlier quoted context omitted.
Yeah, you could argue that choosing C is just choosing a particular subset of C++. The main difference from choosing a different subset, e.g. “Google C++” (i.e. writing C++ according to the Google style guide), is that the compiler enforces that you stick to the subset.
C's string handling is so abominably terrible that sometimes all people really need is "C with std::string". Oh, and smart pointers too. And hash maps. Vectors too while we're at it. I think that's it.
I write games in C (yes, C) (2016)
151–160 of 288 posts
Re: I write games in C (yes, C) (2016)
#152I write mostly like I would in C, but use C++ features as needed. It ends up looking similar to Rust if you squint. All these "I write games in C" people complain about C++ features, and then end up reimplementing virtual interfaces manually with struct headers or massive switch statements, just to feel better about themselves. Writing games in C is not harder, you just have to implement modern language features by h…
Re: I write games in C (yes, C) (2016)
#153I write mostly like I would in C, but use C++ features as needed. It ends up looking similar to Rust if you squint. All these "I write games in C" people complain about C++ features, and then end up reimplementing virtual interfaces manually with struct headers or massive switch statements, just to feel better about themselves. Writing games in C is not harder, you just have to implement modern language features by h…
C++ reimplements a lot of the things we do in C with function pointers, while hiding what's actually happening behind topheavy syntax that implies a 1990s object oriented paradigm that's dead now.
Re: I write games in C (yes, C) (2016)
#154I write mostly like I would in C, but use C++ features as needed. It ends up looking similar to Rust if you squint. All these "I write games in C" people complain about C++ features, and then end up reimplementing virtual interfaces manually with struct headers or massive switch statements, just to feel better about themselves. Writing games in C is not harder, you just have to implement modern language features by h…
I remember the creator of Kaiju engine stating something about C++ compilers producing slower code with C-style C++.
Regrettably not every C++ feature is free if you don't use it. But there aren't many that aren't.
Re: I write games in C (yes, C) (2016)
#155I write mostly like I would in C, but use C++ features as needed. It ends up looking similar to Rust if you squint. All these "I write games in C" people complain about C++ features, and then end up reimplementing virtual interfaces manually with struct headers or massive switch statements, just to feel better about themselves. Writing games in C is not harder, you just have to implement modern language features by h…
> Complaining about a language having features you don't want is silly. It might be silly if you're working on your own. Software that delivers a lot of value is usually developed and evolved not only by team, but by a team with changing members and changing leadership over the project's lifetime. The features used will be the union of all features used over the years, and while it's easy for team leads to allow the…
This is quite important and often overlooked. An annoying fallacy is that people think some features are optional, but once they get heavily used, they aren't anymore. Often they quickly become an requirement and if you don't follow suit, your code is legacy or you are an idiot. But well, I guess I create legacy code upfront and the cargo cultists create modern code that turns into legacy next day.
Re: I write games in C (yes, C) (2016)
#156In my core I'm the same. C is my language and served me well for decades. There's nothing inherently major wrong with it until you reach one of the two (or both). Working in a group of people on a C codebase tends to introduce pain on multiple levels unlike some other languages (yes, including C++). The other is that anything takes a long-ass time to do compared to modern alternatives, which might also be an issue if…
Why do you think working with a group of people on a C codebase introduces pain unlike other languages? Working with a group of people always causes pain, but I found the pain much less severe for C than for C++.
Re: I write games in C (yes, C) (2016)
#157Earlier quoted context omitted.
COM was designed to be compatible with C. Linux games are also often written in C++. The ones written in C are just old.
Sure, but in practice COM is almost never used from C programs unless there is some integration into a very legacy codebase. Games are newly developed, they’re not enterprise database platforms.
Re: I write games in C (yes, C) (2016)
#158Earlier quoted context omitted.
C++ reimplements a lot of the things we do in C with function pointers, while hiding what's actually happening behind topheavy syntax that implies a 1990s object oriented paradigm that's dead now.
Contrary to popular belief C++ isn't really object–oriented. I mean, you can write object–oriented code, but the language doesn't make assumptions about what goes into a class. It's really just a struct with associated functions.
Re: I write games in C (yes, C) (2016)
#159Earlier quoted context omitted.
Do you get a dopamine hit out of this?
Nothing about a dopamine hit out of it, no. Something about _main being an undefined symbol. Are you familiar with that error message?
You're doing that thing. I think it's called "trolling". It goes like "hurr durr, they said take one, but they wouldn't let me take one plate" or "hurr durr, I filled my gas tank with nitrogen, which is a gas, but my car doesn't go" or "hurr durr, they said C++ features are all optional, but I don't want to use letters, how can I write C++ without using letters?"
At least when that guy asked Stack Overflow how to make gcc compile his .png, it was actually funny.
Re: I write games in C (yes, C) (2016)
#160As a hardcore C programmer and zealot myself... How in the hell can you be productive like that? C is a systems programming language, not an application programming language, let alone relevant to the levels of abstraction you'd want in game development. That said, "I am dead" is a very real video game indeed... and his arguments are very sound. I also can't stand C++. I disagree with him on Java though. The core lan…