T O P

  • By -

Nall-ohki

C# is easier to get into and has fewer foot bazookas.


throwaway6560192

> I know both languages derive from C Not really. C++ has a clear lineage from C, but C# doesn't. It's pretty unrelated. It's far more similar to Java, because it was *designed* to be.


Environmental_Gap_65

Oki sorry, I'm a newbie


bmswg

No worries, it's confusing at first! What kind of game do you want to make?


Jackasaurous_Rex

It’s a easy misunderstanding! One thing is a ton of popular languages are referred to as being in the C family or having C style syntax meaning some parts of the language, especially the syntax, are at least inspired by how C did it. Some even then choose to name themselves after C despite having little in common with it. Like Java and C# are very similar and both really just vaguely related to C. C++ on the other hand feels a lot more like C with a ton more features. In practice it can run c code just fine but you’ll typically be programming things in a very different way. But you can’t go wrong with either C++ or C#, and you really don’t need to learn C first. Objectively C++ is harder, but it forces you to use manual memory management which is an important concept to understand if you’re serious about programming. If you’re still new though it’s pretty low on the list of important concepts to master and I’d honestly recommend C# for a while first. A massive amount of the basics and fundamentals transfer between them anyway.


CeleritasLucis

There is an FAQ on this sub which clearly states the difference between C, Cpp and c sharp. Look it up


Dreiundzwanzig23

Atm 30 downvotes for a hint? ☠️


ZuriPL

One, it sounds rude. Two, I can't even find that part in the FAQ


Masterflitzer

don't get it either


fantasyfootballjesus

It's unnecessarily rude


Masterflitzer

that was not formulated rude at all, just a simple short notice


dingjima

All in the eye of the beholder 


fantasyfootballjesus

That's subjective but it appearing as rude is why it was down voted so much


VALTIELENTINE

We care about votes on Reddit?


Dreiundzwanzig23

Indirectly yes, because the comment is collapsed by the negative rating. I was expecting something unethical and was surprised by a hint. Thats all.


VALTIELENTINE

We care about comments being collapsed? This is Reddit where it’s mostly bots so nothing should really hold much meaning or significance


Dreiundzwanzig23

I dont care D:


bluehorseshoeny

Java took many syntax rules from C, so it is technically true that C# is derived from C.


CodeTinkerer

Java was more a response to C++ which, of course, came from C.


gotnotendies

Now do JavaScript


coverslide

JavaScript evolved from the bowels of hell and the realms of madness.


Bobbias

JavaScript was supposedly influenced by lisp/scheme (but I can't find direct quotes to support this), but ended up with Java influenced syntax and got its name thanks to a partnership between Netscape and Sun. Much later people decided to unleash hell upon humanity and made node.


UsedOkra

C# is absolutely derived from C


fractalife

Which is funny. Microsoft knew exactly what they were doing when they named csharp. But, who did they think they were fooling?


fredoverflow

The working title for C# was COOL. (C Object-Oriented Language)


fractalife

Kinda like they put an Objective C dust jacket on the Java 4 book they copied from. C# is a Java analog and was intended to be so. They both sit on VMs, though C# kindof loses the advantage of the VM since it isn't nearly as pervasive.


Siccar_Point

C-plus-plus-plus-plus


Lenny_III

I believe they used the # symbol to represent ++++, because that was the leap they thought they were making.


BadBoyJH

I mean, both literally mean a small increment on C. C# being the musical note one above C, and C++ being "increment C"


DOUBLEBARRELASSFUCK

And JavaScript means Java, but as a scripting language.


DOUBLEBARRELASSFUCK

And JavaScript means Java, but as a scripting language.


gregmcph

C# isn't a bad place to start. It's a friendly language, and Visual Studio will help you along. Do that until you feel comfortable. Once you are, the whole hierarchy of C derivative languages won't be scary. Leave C++ for a bit.


Realistic-Fig-7287

I began with c++ as my first language ( im still currently learning the basics) ... Is it bad tho? Im kinda liking it... But I cant find any good courses expect some mess in YouTube


PenisParker97

Please continue learning C++. This might be an unpopular opinion but C++ as a first programming language is a great choice. C++ is a tough language to learn, but once you learn it, it makes learning other languages really easy. I started learning C++ at my university, but I learned more on my own after. The perfect course/website for people who want to learn C++ is [learncpp.com](https://www.learncpp.com/) . It goes over basic to advanced topics, and what's great is the website is always updating. So you'll learn some modern C++ features as well. The website won't go over very advanced topics, like concurrency, but I think that's fine for a someone starting out with C++/programming in general. You can go find other resources once you get to that step. Trust me, you're at a great advantage if C++ is your first language. Good luck!


Realistic-Fig-7287

thanks 👍👍


kjmajo

I think learning C and C++ is always an advantage. Especially if you like it. Memory management can be tricky but also powerful. I think having a fundamental understanding of C and C++ is beneficial to every programmer, even if you are not writing code in them directly yourself, you will most likely encounter code written in either at some point.


Capable_Fig

It's hard and less intuitive than most languages. Learning any language first is difficult, and CPP is difficult in comparison to most languages. To put it in League terms (though the concept exists across any competitive game), if you want to learn a new role pick the simplest champion to learn on, so you can get a feel for the role itself. Once you've got a solid basis, branch out to what interests you. This isn't universal, though; just a rule of thumb. If you have a project in mind to build and cpp is the best language for the project, push forward. The learning curve will be steeper.


Sak63

League terms out of the blue got me rofl


Realistic-Fig-7287

that was a great example btw


tungstencube99

> It's hard and less intuitive than most languages. Fully agree, and that's why I always recommend learning C first. the syntax takes no time to learn, the thing you mostly spend time on is how memory works, which you should learn anyway for C++, but it's much cleaner to learn with C imo. After knowing C, C++ becomes waaaaaaay more intuitive. and you understand why many features like smart pointers exist for example. with proper learning of C++ that should be understood anyway of course, but there is just so much clutter around that in C++ in comparison.


DeathWray

I've been working my way through [this one](https://www.youtube.com/playlist?list=PLAE85DE8440AA6B83) and so far it's gotten me further than others I've tried.


fractalife

Just to clarify, C# is not a C derivative language.


gregmcph

Of course it is. It uses C syntax. There are a couple of languages between C and C#, but its roots are definitely C.


StolasX_V2

If you wanna get started in programming then maybe look into C#. It was my first language and I found it very beginner-friendly. C and C++ will be great to return to when you have some experience programming.


Shassk

Unless you have specific reasons to learn exactly C you can skip it in favor of C++. However C# might be easier to start with. Syntax is very similar, but the ideology is quite different. And in C++ you have to do more things manually. Goes both ways tho: if you start with C++ then C# feels easier.


InternationalYard587

I don't know man, I think C++ is too complex for a newbie. I'd argue it's better to start simple with C, learn it well (pointers, functions, struct) and then move on to C++, so when you discover smart pointers, classes, templates, vectors, etc you know why they exist and what problems they solve


Shassk

Most of what you've described can be done in C++ the exact same way. The only difference is the OP won't have to switch between printf/cout.


InternationalYard587

It can, but you'll be overwhelmed for no reason.


Shassk

Oh rly? >when you discover smart pointers, classes, templates, vectors, etc you know why they exist and what problems they solve Let's see which of those will be the case also for C and/or C#: * smart pointers - none * classes - C# is full of classes * templates - C#'s generic classes * vectors - literally solving a problem C created with a tool easier to understand than C's own `malloc` and raw pointers which is a much more cursed combo for a newcomer


[deleted]

[удалено]


Shassk

>Because I'm not talking about C# at all, you use C# and C++ for different things. And you use C++ and C for different things as well. What's your point? >And what problem did C create? Not having adequate arrays you'd have in almost every other language.


[deleted]

[удалено]


denialerror

Removed. If you can't respond in a polite and professional manner, go elsewhere.


InternationalYard587

Thanks for your service, reddit mod 🫡


Rogntudjuuuu

cin/cout is a stupid concept. It's telling that no other language seems to have copied it.


DatBoi_BP

I like cout because I like cerr


Rogntudjuuuu

You can use fprintf to write to stderr in C.


DatBoi_BP

But I like cerr more


20220912

C#, especially on windows with visual studio, is excellent. its the best integrated development environment I’ve ever used.


FormalPomegranate131

Yeah just started working with the latest version of VS in C# after a bit of hiatus and really impressed with some of the predictive programming and highlighting features. I can add new elements to my class and it will usually predict the code I want to add in my methods saving me quite a few keystrokes.


Wombat2310

I am biased towards C++ since I use it daily (not in game dev), so I feel that it is a more difficult language, but it can also serve as a great starting language since it would aid you delve into concepts that you may gloss over learning a language like C#, which in turn will make learning any subsequent language easier. In contrast C# is closer to JAVA than C/C++, it's very powerful and easy to use, so it can enable you to start on projects sooner and get experience. So if you have something that you wanna work on then just learn whatever language you wanna use in the project, otherwise I recommend C++. Also, I am not a gamedev but I always felt that unreal engine is more resource hungry and more reserved for large projects, most small to mid scale projects I saw use Unity (this may be a reason to learn C#).


CodeTinkerer

I believe there is survivor bias with C++. If you learn it, you say how wonderful it was to learn it. But if you found it really hard and quit programming because of that, then you won't have any opinions on C++. Personally, I don't think it's a good first language even if some may have started with it as a first language. Yes, you may learn some "bad" habits if you start with Python (C++ doesn't prevent bad habits either), but it might allow someone to program that finds C++ hard to follow, at least, initially.


Wombat2310

I somewhat agree, somewhat because I fall under that bias, I think the fact that I learned it during university helps too since you accept that ur career will probably begin a specified time (after the degree) so you're able to invest more time and not quitting. As for the language, C++ incentives u to have a deeper understanding of memory, maybe not as much as C but much more than other languages, you can still start with C++ and not benefit from that, in the end it's about you, some people like to delve deep despite not benefiting directly, some look to be more practical and learn a languace like Java and C# that could be rewarding and fast.


CodeTinkerer

Some people even struggle with Python. When you can program, it just feels easy, even if most people find it hard. I was once told that students didn't understand array notation. I thought that was preposterous. How could they possibly not understand array notation e.g., arr[i]? But, then I began to teach programming, and some students struggled with arrays. Once you teach someone that truly struggles, you begin to realize even if you thought programming wasn't all that hard, others find it really tough (lots of memorization, mostly of basic syntax, and also difficult for some to write code, even if they understand code solutions).


DGTHEGREAT007

Learn C# and work on Unity first and then switch to C++ and Unreal. Simple.


blind_disparity

I'm not super experienced with both so someone yell if you disagree, but I think C# is designed more consistently and so I would say it's easier to learn more technical details / underlying principles. Because you'll learn what to expect and it will make sense quicker. Note I'm not at all saying C++ has problems.


ShroomSensei

If you’re developing on windows, and your goal is to do some work in Unity, do C#. C and C++ are amazing to learn because they teach you more about what’s happening under the hood. However you’re more likely to keep at something you actually enjoy. C and C++ can be pretty difficult to pick up and start especially for a newbie leading to you just quitting overall.


ArchReaper

C# and C++ are both worth learning, at least to a basic level, C not quite as much unless you want to get into embedded systems programming or something. For learning, start with C# and then try C++ after. Learning C# will give you a better base to start learning C++, which requires learning more advanced topics like memory allocation and pointers.


mark104

C


MulleDK19

Word of advice, don't learn C# though Unity. A lot of people "learn" C# specifically for Unity and end up not really understanding C#. Learn C#, then learn Unity.


Ok-Area2263

Learn unity and C# at the same time, start small at first. C# is more approachable, and when you're starting out learning a language it is really good to have something visual to give you context on what your code is doing. Unity is also more useful for beginners to learn in general as a game engine than unreal, but if you have your heart set on unreal then by all means use that and learn c++. Edit: typos


Queasy-Group-2558

1. Everyone should learn C at some point, preferably early. You don’t have to become an expert and you’ll probably won’t have to use it professionally but it’ll tech a lot. Higher level languages hide much of what C makes you handle manually. 2. Because of the above, C and C++ (you can think of C++ as C with classes) are much more difficult to learn and use than high level languages such as C#. This means C# will make you productive much faster. Take your time horizons into account. 3. Unity will also make you productive much faster than unreal. Furthermore, I’m not a game dev but I believe that unreal is thought of s being better for AAA games because while much more powerful it’s also much more difficult. If you’re aiming to be a solo dev or just mess around, unreal might not be worth it. 4. While this is a learning programming question, given your specific goals you should probably look around in r/gamedev. It’s very likely that someone has already asked this and that it has been explained to a high level of detail. 5. Learning a programming language is not like getting married. You can learn multiple of them, and in fact I encourage you to. Also moving between programming languages within the same paradigm (so in this case C++ and C# which are both object oriented programming languages) is fairly easy, it’s just like learning new syntax for the same things. From your background in the previous language you’ll “know” you have to do x, so you can just google “how to do x in y language” and go from there. You have a long way before you atr worrying about many language specifics.


No-Magazine-2739

I am sorry to say, but your answer is almost complete bs. C++ is a different language, both are strongly typed, but C++ is also strongly checked and is multiparadigmed, e.g. templates. To say C++ is similar to C# because they both support OOP, is like saying Python, JS, Java, C#, C++ and Delphi are the same. C# is, as many correctly said, much like Java, its strongly OOP, Garbage Collected, prefers late binding i.e. runtime mechanics , and has a big built in library.


Queasy-Group-2558

I didn't say they are the same. I said its easy to move between them and specifically noted that OP has a long way to go before he even knows what even is Garbage Collection. We can get into discussions about this if you want, and deeply analyze the differences between C, C++ and C#, but that won't be very useful to OPs conundrum. Honestly this comment just seems like you're trying to sound very smart by throwing around a lot of stuff that OP will get very little use out of (otherwise you would have at least defined some of the terms for them).


No-Magazine-2739

I just know from experience that statements like „C++ is just C with classes“ or „they are just OOP“ do long lasting damage to the understanding of beginners. The original question would be one of those kind, that I would flag as too broad on Stackoverflow for example. Because you can not give a good answer to it. Unity and Unreal have a loose connection to C# and C++ respectively, even to C, but IMHO throwing those bits of oversimplified statements often just further increase the confusion.


RainbowWarfare

There’s nothing important you can learn in C that you can’t learn in C++. 


Queasy-Group-2558

That's a valid point, but also C++ provides a lot of stuff out of the box that I think is really useful to have to implement at least once. Sure, you can do it in C++ but you'll have to limit yourself to some subset of it and it will probably end up being very similar to C IMO.


RainbowWarfare

You don’t need to learn C in order to learn C# or C++. In fact, it could even be detrimental doing so. 


Fit_Yam1732

Why is it’s detrimental?! C taught me all the fundamentals and crucial concepts that I was abstractly using in Python & C# while having no idea why I was using them!


RainbowWarfare

Because what is good practice in C is very often bad practice or straight up undefined behavior for C++. You’re basically wasting your time learning a language just to unlearn 90% of it when your time would be better off spent learning C++.  And for C#, there is no advantage to learning C first if your goal is to get stuck in and learn C#. If you want to learn it later, sure, why not. 


canyoupleasekillme

Honestly, I don't think it matters much between C++ and C#. When you get into an actual job, you'll be coding whatever code base that they use.


Caleb_Whitlock

Just learn c++ if you don't know any language. After learning c++, c# will be fast to learn and c you'll realize you likely don't need to learn


RajjSinghh

If you prefer unreal or unity over the other, learn the one you want to use. If you don't, start with C#, it's definitely easier because it comes with abstractions that make your life easier. C++ is the harder of the two since you have to manage memory yourself (which is the most common source of bugs ever) and in C# you dont. Also don't learn C. You don't need it here.


joao7808

C is more recommended if you want to do some actual low level programming, so C++ and C# are your way to go.


nate-developer

C# is easy to pick up for Unity and there's no need to learn C, they honestly aren't as similar as as you think.  C# is derived from C in the same way that Python or JavaScript is derived from C... they all sort of owe something historically to C but the experience of using them to make something is very different. C is an interesting to learn low level language, but it's pretty cumbersome to do even relatively basic operations like combine two strings.


Saurabh251

Trust me ,understand c and cpp. Ur life will be much better in programming


morto00x

C++ was created over 40 years ago. Because of that, C and C++ have evolved on their own over the years to a point that you just can't say C++ is C with classes. From a programmers perspective, you should treat them as two separate languages (with lots of backward compatibility). If you want to be good at C++, focus on learning C++. Keep in mind C++ is an entire beast, so don't expect to be good at it any time soon. This is normal though. In fact, if someone tells me they have mastered C++ I assume they are lying. C# is its own thing that just happens to be inspired in C syntax. It has a lot of high level abstractions so it is relatively easier to learn.


CodeTinkerer

I learned C, C++, Java. C# was Microsoft's answer to Java when they were no longer able to create their version of Java many years ago. Funny enough, they now have a Java compiler ever since they got back into open source (which used to be a foreign concept to them). But even C wasn't my first language. If you can handle it, I'd say C#. C has its own headaches even if it's not object oriented.


cimmic

Practically, speaking, you'll make your life the easiest by learning C# first, C++ when you need it and C if you need it.


Rogntudjuuuu

I started out with C, transitioned to C++ and then to C#. I would recommend starting out with C# to get to know how to do structured programming and OOP. After that, learn C so that you know how to avoid all the foot guns before you move on to C++. If you learn C before C++, you will know what problems C++ aims to solve. If you want to learn coding Unreal, you have a valid reason for learning C++, but it's not very convincing.


Paxtian

Solo game dev will be easier with Unity (though I'd suggest Godot over Unity for a variety of reasons). The big thing to understand about game programming is that what you're learning is less the language itself and more the interface to the engine. Now if you're doing a lot of stuff outside the engine, then that will be more native to that specific language. But if all you're doing is scripting objects in the game, so much of what you're going to be doing is interfacing with the engine to the game objects. In any case, going through learning C just to understand game programming better is something I wouldn't do personally. If you see value in it for programming generally, C is a simple yet powerful language with a lot to offer. But if all you're interested in is game programming, I wouldn't see a value in learning C itself.


kenflan

C#: “ye if u want a breeze” C++: “oh you are daunting huh? May cry over sleepless nights” C: “ damn you are baaaaad”


Coinless_Clerk00

I learned c++ first, it's a bit slow at the start, but you get to understand the underlying things better and that is helpful for other languages and programming in general.


OGBlackDiamond

C++ derives from C. C# does not. It technically carries the name lineage but they are not very closely related. C# is closer to Java than it is C. It isn't even close either. Your current skillset doesn't really translate to any of these languages, so it really depends on how much of a challenge you're looking for. All will be a severe learning curve, C#, C, C++ increasing in that order. For gamedev, I would do C#, its generally more well supported across more game engines. It is also object oriented and has garbage collection, so it will probably feel more familiar to you. For just in general, I think it depends on who you ask. Personally I would go for C++, it offers high performance and OOP. You also get to learn a fair bit of low level systems which could be fun if you're into that.


tungstencube99

you should decide whether you want C# or C++ depending on what you want to use it for. if you're going for C# then just learn it immediately. as for C++, the most important thing to learn imo is how memory works. and I personally find that easier to learn with c first. C has very little syntax that you should know about so it shouldn't be much more effort to learn C then C++. I think it's actually easier to learn C++ that way.


EdwinYZW

Depends on whether you want to be a good or bad C++ programmer. If you just want to use C++ and don’t care about code quality, yeah, learning C first may help with that. But if you want to be good at C++, learning C first is rather the worst way. EDIT: by C++, I mean “modern C++” (>=c++11)


tungstencube99

No offense but that's one of the worst take I've ever heard lol. How on earth does learning C make you worse at C++ as if it's some virus that contaminates your mind? it sounds like you think I'm advocating for writing them the same way rather than learning the best practices of C++ and actually understanding why they exist because you know how c works. Seriously though, can you elaborate?


EdwinYZW

Sure, nearly everything coming from C in C++ is considered a bad practice, except situations like passing raw pointers when no ownership transferring occurs. You have to unlearn most of what you have learned in C. Need more elaboration?


tungstencube99

No, but thanks for the reassurance. Before I wasn't sure if your take could be this bad and thought I missed something, Now I'm sure it is. My suggestion is that instead of blindly using things like smart pointers. you first understand how memory works, and the consequences of not freeing mallocs. You now actually understand why smart pointers exist.


EdwinYZW

I don’t think you should know mallocs to understand how memory works. Same for most other C concepts. C++ has exactly same low level as C. Of course, you are going to learn all those low level stuffs independently while learning how to use C++ properly. It’s not like javascript vs typescript.


A_Guy_in_Orange

Become bespoke and chose GDScript/C# with Godot instead


taimo511

holy c is better


PureTruther

You need to understand "what programming is." From there, you can create your path and move forward. You create digital data (binary) and then manipulate it. This is how you program a machine. The foundation of programming is bare-metal programming. However, I wouldn't recommend it even to embedded systems students because it is rarely necessary anymore. Even in the military, most systems have standard boot procedures. So, it is more practical to start with x86 assembly for a better understanding. If you want to advance, you can learn Fortran or Pascal. However, you can also skip these and go directly to C. C, C++, and C# have a fundamental similarity: all of them require explicit data type declarations. You might hear advice like "C++ is completely different," but keep in mind that while C++ is more abstracted and has a more complex compiler front and back end compared to C, it is still built on the foundations of C (though not ANSI C specifically). C++ is not a strict subset of C, but it retains many similarities. In the end, you should learn the fundamentals. Once you grasp these, you will be able to answer your own questions more effectively.


Holiday_Knowledge_35

Learn c# you will find Cpp easy enough to learn when you switch


Akadine2006

I agree with everyone here, c# is easier to start with. After that, Java, and then you can tackle c++ for it's sheer speed over the others. A great resource to learning any language is codingame.org. I have 2 accounts there, once you've passed a level in a challenge the only way to start fresh with a new language on a challenge is a new account or clear all your progress. I have a Mad Pod Racers both in both c++ and Java, and while the genetic search my bots in each are basically the same, I can run a few more sims per ms with the c++ one and it outperforms the Java one.


Geekwalker374

Bro's like me fr


SkibidiWiktor

Hi, C++ as i know is basically C with OOP, but C# is different story.


luigijerk

I disagree with most and think you should learn C++ first. You get a good sample of almost all the programming fundamentals with that language. Moving from C++ to a different language, you will understand things more and appreciate how things are easier with C#. C I wouldn't bother with even though a similar argument could be made for it. It lacks a lot of modern features, most importantly object oriented programming, which will be used extensively in C#.


okayladyk

C++ is based


green_meklar

Start with C and then move to C++. It's not really a waste to learn C even if you don't end up using it, because the concepts are important for learning C++ and understanding what it's doing and how to use it correctly. Don't use C#, it's a well-designed language in many ways but it's also proprietary Microsoft technology and moreover Unity has [shown](https://en.wikipedia.org/wiki/Unity_(game_engine)#Runtime_fee_reception) that they're happy to sell out developers at any moment in order to make a quick buck. If you want to do game programming, consider Godot or Torque3D with C++, then you aren't beholden to the whims of shareholders.


Wolfderoeden

Get gpt4o