Earlier quoted context omitted.
I am in some ways the same, but the other way around. I like Python-like syntax more than C-like syntax. But not to the same extreme as you, I wouldn't mind using a language with a C-like syntax. What are your reasons for disliking Python-like syntax?
I want strong visual cues for the end of blocks most importantly. And I want the freedom to adjust indentation in ways that to me improve readability without consideration of whether or not it matches language expectations. But also because I've yet to work in any environment where broken indentation due to tools with different ideas about how to handle it has not been a regular occurrence - indentation is brittle.
Why I Write Games in C
231–240 of 303 posts
Re: Why I Write Games in C
#232Earlier quoted context omitted.
If you're going to write a TL;DR for others, you should at least read the article yourself, don't you think?
I did, it is so abstract to pretend you can do better that there is no way to discern. He didn't even mention "unity" in his post, thats just ridiculous in 2016, but yeah, keep down voting, your implementation of 2d graphics, sound, collision, physics, plugins, marketing, sprites, menus is gonna be so much better than hundreds of engineers at unity withing 10 years straight.
Also, think of the most successful indie game ever made (Minecraft). It was written in Java (a much maligned language, wrongfully IMO), with a very thin framework (Lwjgl), and it's made its creator a billionaire.
If you're doing a game in a relatively mature genre, then yes, engines are great and will save you a ton of time. However if you want to do something completely outside the box, sometimes you save a lot of headache by just simply writing it yourself.
Re: Why I Write Games in C
#233You don't really get rid of complexity by using a simple language. You just move the complexity into your own code. Say if your language doesn't have dynamically sized containers, you will end up writing your own. You hack it so you can store different types in it. You have reinvented polymorphism. And then you need sort functions, and everything else that is missing from the language. And it wont be simple any more.…
It's not for everybody.
"Containers" are actually quite easy without bespoke libraries in 'C'.
And sorting is built-in.
A simple example: http://www.codeproject.com/Articles/108830/Inheritance-and-P...
Throwing languages at problems is in itself a Tower of Babel problem. We need to emphasize mechanism and not tools. But people gain reputation not by producing correct implementation but by leading revolutions against the status quo.
Re: Why I Write Games in C
#234>Even more than that I care about the speed of the compiler. I am not a zen master of focus, and waiting 10+ seconds is wasteful, yes, but more importantly it breaks my flow. I flick over to Twitter and suddenly 5+ minutes are gone. Quick suggestion, has really helped me: take that 10 or 20 seconds waiting for compilation, and stare out a window. This gives your eyes much needed break from focusing on a computer moni…
And if I remember correctly then focusing close for a long time doesn't affect your vision but can cause headache.
Re: Why I Write Games in C
#235The thing I miss most in C when I don't cheat and use a couple C++ features is templates. Specifically, a dynamically sized List implementation that is type-generic. If you do this in pure C, you have to pick your poison: 1. preprocessor abuse 2. void * 3. multiple redundant implementations of the data structure Dynamically sized lists are used so often, that this tends to be a problem in almost every C project. I wo…
BAH! 4. The "intrusive" containers, but of course. The one true way to do it in C. For one, you can keep items in multiple containers, all being on equal footing. None of that typical C++ mess, when this list is a primary storage for items, and those maps are secondary indexes, all sprinkled evenly with iterators. Intrusive containers don't own items, they merely organize them, which is exactly the right way to go ab…
Re: Why I Write Games in C
#236You don't really get rid of complexity by using a simple language. You just move the complexity into your own code. Say if your language doesn't have dynamically sized containers, you will end up writing your own. You hack it so you can store different types in it. You have reinvented polymorphism. And then you need sort functions, and everything else that is missing from the language. And it wont be simple any more.…
> their own private code framework that is too complicated for anyone else to make use of Well, to be fair, games are one place where code reuse and maintenance by third parties is less likely to be needed. The real sadness is when you get corporate websites, technology platforms, and the like that decide they need their own framework to make their own set of tradeoffs, and do a mediocre job of it, and end up with a…
Re: Why I Write Games in C
#237He mentioned a bunch of languages, and I'm not sure why he doesn't look into something like Kotlin. It's the JVM so you get maturity and it's fast as hell (ran a few economics-related benchmarks on my machine, OpenJDK 8 beat both C++ and Fortran!), has great IDE support (Intellij IDEA - which will actually translate Java into Kotlin if you want to translate snippets), and it doesn't strong-arm you into an OO style. A…
Re: Why I Write Games in C
#238Although my wet dream would a C language with map, vector and other containers, a simpler build system (no more headers), more nice syntactic sugar, and an interactive mode... I'd gladly see a language that break C compatibility for this.
Re: Why I Write Games in C
#239Earlier quoted context omitted.
When you drop the semantic silliness of C++, like having the container to take care of constructing, copying, moving, and destructing, not to mention exception safety, a basic implementation of a "templated" dynamic array implementation in C comes down to like 100 lines. Hash map will be a bit more, and is not so trivial to write. It's true that there should be no need to write these things yourself. The alternative…
Considering that vector, map, etc are widely used and expected features of software development, I would think that good libraries in C exist for these already, so you don't have to even write your own 100 lines. Are there any?
Much also depend on how much you really need dynamic allocation - it can be optional.
Re: Why I Write Games in C
#240He mentioned a bunch of languages, and I'm not sure why he doesn't look into something like Kotlin. It's the JVM so you get maturity and it's fast as hell (ran a few economics-related benchmarks on my machine, OpenJDK 8 beat both C++ and Fortran!), has great IDE support (Intellij IDEA - which will actually translate Java into Kotlin if you want to translate snippets), and it doesn't strong-arm you into an OO style. A…
I've been meaning to get into Kotlin and building a game sure sounds like fun. Are there any Kotlin specific game programming frameworks (or any other resources for that matter) that you'd recommend?
So the obvious choices would be LibGDX and Lwjgl 3 (which is written mostly in Kotlin). As for tutorials, it's close enough to Java that you can rewrite anything pretty much word for word (albeit with a slightly different syntax), and there's a Java -> Kotlin translator in IDEA. It keeps the semantics very close to Java, but with some sugar and niceties. It really is the 'Java replacement' that languages like Scala and Ceylon attempted to be.