#C or C++

1 messages · Page 1 of 1 (latest)

strong pawn
#

I'd like to increase my love for Zig by learning one the two languages. From what I understand, C++ dominates the market and most lower level code is written in C++. I've also heard that C is closer to what Zig is. That is, not having OO features in the language itself. If I had to choose one to deep dive into to prepare me for when Zig 1.0 comes out, which one would be best?

stray cave
#

C, but just using more Zig might be most effective to “prepare for Zig 1.0”! (I’m not sure how long that’ll take so maybe just taking advantage of Zig’s benefits in its current state could be a bit more practical?)

devout igloo
#

C will give you an understanding of why most of Zig's features exist especially comptime. Better practice too I think, getting used to C++ RAII would not leave you well prepared for manual memory management, and classes are a pointless distraction.

strong pawn
#

I was thinking I would go over either C/C++ then really get into Zig. There are just certain things I still don't really comprehend and I think going through C/C++ first could be beneficial. ie memory allocation. They tend to have a lot more resources for learning

strong pawn
devout igloo
#

Oh, well if it's for games then the style of C++ is very close to C anyway, and you won't be hurting for the missing features as much except C99 features that C++ doesn't have. C++ has better tools for working with vectors/3D objects. In that case probably C++

#

It can be fine for embedded, if you choose a chip with decent vendor support and limit the features you use. Most of the libraries will be in C though except for like arduino

#

I'm biased I started with C, never learned C++ until recently, and do embedded 😆

strong pawn
#

I've read online that data oriented design is great for game development. I'm not sure if that replaces OO, making C++ and its features irrelevant or not. Is OO the reason C++ is used in games? Or did C++ just take over that industry and that is why it would be better for me to learn C++?

#

Like the Odin language, it isn't Object Oriented, yet it was designed specifically for game development. So that is why I question if C++ really is worth diving into.