Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
eric95204

Is it difficult to learn C after learn C# ?

Recommended Posts

Posted · Original PosterOP

Me and my friend have been learning C# for a few weeks now and we were interested in making a compatible driver for a game for the raspberry pi since its graphic drivers are open source. I looked into most linux driver tutorials and they use C. I was wondering if learning C after C# is to difficult and if its smart?

Link to post
Share on other sites

I started out using C. It is really not that much harder. It might take a little to get use to the some differences like C has no booleans, no classes and less pre defined functions. The hardest part is going to be able to understand pointers and understand how to  make your own data structures. As far as being smart to learn, it's not a bad language to learn especially if you want to work with programs that require low level access like graphic design or kernel programming.

Link to post
Share on other sites

No, once you learn one language it's easy enough to transfer over the skills. I starter off with VB.NET and from there went on to learn Java, C#, ASP, JSP, PHP and many many more.


--

Link to post
Share on other sites

C is what I first used.

 

Basically, C is like C# but a little more dumb, it does not have classes, you will be using more procedural style of code.

 

There are many libraries out there that you can use.

 

The hardest part will be learning pointers.

Link to post
Share on other sites

C doesn't have objects, nor does it have actual booleans, it is a big learning curve to c#. Allocation of memory, dealing with buffer overflows, etc. It's for sure a more difficult language.


i want to die

Link to post
Share on other sites

Yes and no I would say.

 

By knowing C# you have a good understandig of programming allready. C is more complicated and you can be a bit weirded out about how it behaves, maybe.

There are much to think about in C that you don't have to care about in C#.

 

So, it can be a steep learning curve, but worth it, it will give you a better understanding of programming and how everything works


Ryzen 9 3900X     Corsair H115i Platinum     ASUS ROG Crosshair VIII Hero (Wi-Fi)     G.Skill Trident Z 3600CL16 (@CL14 and other tweaked timings)     

ASUS ROG 1080TI Strix    Corsair AX 860i     Samsung 970 EVO Plus 1TB     Samsung 840 EVO 500GB     Seagate Ironwolf 10TBx2     Seagate Ironwolf 6TB 

Acer XB271HU 27" 1440p 165hz G-Sync     LG M2352D 23" 1080P TV     LG C8 55" UHD TV     Phanteks Enthoo Evolv X Glass     Logitech G810 Orion Spectrum      Logitech MX Vertical      Corsair HS70      Windows 10 Pro x64

Link to post
Share on other sites

C is procedural. And has that thing that is feared by many - pointers ^____^

Memory allocation is made "by hand" and there is no garbage collector.

But when you get a hang of it - it is not that hard.

 

PS Happy cleaning! :D

Link to post
Share on other sites

I would suggest try to read some driver source code to see if you can understand them. It's very different from writing applications in C#. 

Link to post
Share on other sites

The most difficult part is actually going to be to get into the right mindset. Everything in C# is object oriented, in C you don't get classes, inheritance or polymorphism. You will also have to get used to pointers and having to allocate and clean up memory yourself.


- Max Oomen

Link to post
Share on other sites

I would suggest try to read some driver source code to see if you can understand them. It's very different from writing applications in C#. 

Woah-woah-woah. A driver? Don't you think that is way too harsh?

Link to post
Share on other sites

I would suggest try to read some driver source code to see if you can understand them. It's very different from writing applications in C#. 

Like what @Darko_Nerivar is thinking....I don't think if he is just beginning to move to C he should be looking at source of any drivers lol. Maybe try converting some of his small C# apps to C would maybe be a start.

Link to post
Share on other sites

Just wanted to point out (C what I did there?  ^_^) that strictly speaking you don't have the exact equivalent of classes, but there is something like "struct", which can make your code look a little more object oriented.

But yes, I have programmed in both C and C#, and even though the name is similar, the programming languages and concepts aren't. It would for example be easy to go from C# to Java or the other way around, but not to C. In any case, making a driver immediately would be way too difficult.

 

Wikipedia: struct

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


×