Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Some points:

> All my solo project games I've been making recently have been written in 'vanilla' C.

The author is talking about solo projects, not big projects where dozens of teams may be collaborating. It is good that he makes the point at the beginning.

> Nobody does this.

This is just not true. There are solo projects developed in Python, Go, even Commodore 64 assembly. When you do something for fun, you can have as much fun with it as you want.

> It would be nice to make things for the web, but it feels like a terrifyingly fast moving enviroment.

The author should look into Emscripten. It is widely used in the games industry that aims for the web.

> C++ ... It is also slow to compile compared to C.

Probably an important point. You need very good practices to make C++ compile fast. Most people don't follow them as adds complexity to the project.

> Haxe feels much more promising than most alternatives.

Haxe is kind of Object-Oriented and like C++. So, I do not see the point after bashing C++'s OOP so badly. For me, the problem is that it transpiles to another languages. So, when something fails does it in code that you didn't write but the Haxe did. This makes debugging harder that it already is.

> Some people just say screw it, I'll write my own language, the language I want to use. I admire this, and sometimes I toy with the idea of doing the same.

Yep. Something possible for your own fun. Not a good idea when developing commercially. It makes sense for him to choose one language for commercial projects and another, or even create his own, in his spare time.

> It can be made to run on just about anything. Usually this is relatively easy. It is hard to imagine a time when this won't be the case.

This is the big advantage of C. If doesn't run C, probably it just doesn't run at all.

> I absolutely DO NOT mean to say "hey, you should use C too"

For solo projects is a giver that each developer should use the best-suited tools for the task and their abilities and preferences.

I, personally, like C++. I have developed big and small projects in C++ and for me comes natural to write object oriented code. For big projects I see advantatges in being more rigid than C. The extra rigidity makes more difficult that there is unexpected funky stuff happening. So, it is easier to use for teams that maybe situated in different countries. For a solo project, you do not need that rigidity as you know how your own code works.



> > It can be made to run on just about anything. Usually this is relatively easy. It is hard to imagine a time when this won't be the case.

> This is the big advantage of C. If doesn't run C, probably it just doesn't run at all.

Is that really an advantage of C over C++? They have identical runtime requirements and typically share a common compiler (although one of those, MSVC, barely supports C). Is there actually anything that can run C but which cannot run C++?


> Is that really an advantage of C over C++?

You may find that not all C++ features are supported for the least popular processors or for old ones.

Standard C++ threads, for example, were not supported by GCC for Windows for a long time. I do not know what is the current status, thou.


> > It would be nice to make things for the web, but it feels like a terrifyingly fast moving enviroment.

> The author should look into Emscripten. It is widely used in the games industry that aims for the web.

Emscripten is wonderful. If you are slightly careful, a standard C SDL2 OpenGL application can, with a few small changes, run directly in the browser — any modern browser — with WebGL, and your single codebase can target both just by having different targets in your Makefile. I've done it for my own hobby game project. :D

It is a bit constraining as a target. Only WebGL 1.0 is supported by all major browsers, which limits you to OpenGL ES 2.0. And unfortunately, in my experience OpenGL calls in Emscripten (translated to WebGL) are much slower than native ones. But if you're content with not trying to do a max-fidelity AAA experience, it's manageable. Particularly compelling to me is the possibility of letting someone try out your game immediately on your site with no download, or even jump into a multiplayer game with a friend with just a click on a link.


> You need very good practices to make C++ compile fast.

I would reframe this as the design of C++ makes it hard to write code that compiles fast.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: