C# or C

Started by
15 comments, last by mohaakilla51 16 years, 9 months ago
Quote:Original post by _goat
C and C++ will teach you everything you need to know about the "fundamentals" of programming. I'm not talking about paradigms here, or areas of programming - I'm not talking about dynamic typing or advanced (some would argue "complete" is a better word) RTTI - I'm talking about how a computer, physically, does things. Memory addresses, offsets, alignment, registers, etc. C# hides some of these things.
How a computer physically does things is no more fundamental than type systems -- there's a strong case to be made that the type system is rather more fundamental than largely irrelevant implementation details like memory addresses and registers. That C# hides those things should be a strong tip off that the physical details are not fundamental at all.

What is fundamental (as far as imperative programming goes anyway) are variables, control flow and control structures, functions, and basic logic. C# and C++ both have plenty of that.
Quote:All this is true in the theory, but tell me, do you know a c++ programmer who is not farmiliar with addresses or registers ? IMO learning c/c++ implies the learning of basic machine-level programming, and every c/c++ book should at least cover bare minimum of this.
I suppose that depends on perspective. From where I'm sitting, I see a lot of C++ programmers who do not understand registers or memory at all. They might think they do -- they got the textbook explanations of pointers and registers, after all -- but they only have those simplified views and very little idea of the reality of how things work.

C++ -- well, really C programmers -- will deal with pointers a lot. But how many of them understand addressing modes? Segments? Virtual memory? Pages? Page faulting? Translation lookaside buffers? All they know is the comfortable illusion of a flat memory space which has been created for them. A lot of beginners don't even realize that they can't access other programs' memory simply by setting pointers to certain values.

Learning C++ doesn't magically gain you machine level knowledge. If anything, it can create serious misconceptions about how things work.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement
Quote:Original post by RedDrake
All this is true in the theory, but tell me, do you know a c++ programmer who is not farmiliar with addresses or registers ? IMO learning c/c++ implies the learning of basic machine-level programming, and every c/c++ book should at least cover bare minimum of this.


I certainly am not familiar with addresses or registers. Actually, I would say that my knowledge of mainstream CPU registers and of mainstream computer memory layout is insignificant and sometimes nonexistent.

EDIT: to quote Promit, I have no idea what addressing modes, segments, virtual memory, pages, page faulting and translation lookaside buffers are, or how they work.

I do not consider myself to be a bad C++ programmer, though, quite the contrary, and I am extremely familiar with the guarantees that C++ makes over the underlying hardware—the irony of this is that this allows me to write safer and more portable code than the average C++ programmer, because I don't mix up platform-specific details and language-enforced concepts. I have never found the need to know about the specifics of my hardware unless using that hardware was my primary objective—which is why I am also highly familiar with the ARM processors found in 2000-2004 PocketPCs and their corresponding assembly, and also with the hardware and PTX assembly of the GeForce 8800.

But at that point, I'd say a programmer needs to learn about machine-level programming when he actually needs to do machine-level programming, not when learning a self-advertised general-purpose language.
Quote:Original post by Promit
stuff


Quoted For Spartian Emphasis

In today's multi-core, multi-processor, multi-server beowulf clustering environment, individual machines and address spaces, processors, cores and caches are quickly headed towards the "minor implementation detail" bin, as we rack up the virtualization atop those resources to build an environment we can focus on the important stuff of our actual programs on -- it seems impossible to rationalize the C or C++ way being more "fundamental" than C# to programming.

Simpler in it's implementation, sure, but that's not exactly a selling point. In fact, it's quite the opposite, simply because you're forced to pick up where they left off, and they left off very very early compared to your alternatives.

Sure, not every program needs a cluster to run (yet), but it gets at my point: Whatever is fundamental to your programming depends on your platform, not machine architecture. C++ and C# are both a certain type of platform -- C# a far superior one in many many ways.

[Edited by - MaulingMonkey on July 16, 2007 4:51:35 AM]
Quote:Original post by awesty
Im 14 as well and started to learn C++ but had trouble because making console apps is only fun for 5 minutes, so I tried out C# and it is much easier to learn and as far as I know you can do anything with C# that you can do with C++. Although C# is a little slower.


C# is a lot easier to get a hold of though if you don't stick to programming in any one language for you'll find what you're doing is very repetitive in nature just to any one language you're using.

So if isn't consoles that is boring it will be GDI windows thats boring. You have to keep moving and learning new things.

If you want to get into game programming quickly and easily (without all the hassle about multicore this or shader that) XNA game studio express is your best bet. Comes with lots of nice tutorials to get you started too, uses C# as the language.
Yeah, I am not sure how this topic evenm got started, I don't remember creating it... But i was craptired last night so... meh. I have already decided to go with C#, mainly cuz it looks like fun :P. I created the exact same post and got a completely different conversation :P, oh well.. here is my snswer to all the bickering: I really cannot believe that I asked in essence what programming language to use... very stupid move of me. Also, C++ and C# are both good languages (or so I have been told) but I also here that C# is in demand right now and that it is also slightly easier to learn.
Quote:Original post by mohaakilla51
...mainly cuz it looks like fun :P..


Sometimes in the academic bickerings that take place on these forums, we sometimes forget the fundamental reason why many of us program...and why we sometimes choose a language: quite simply, that language is more enjoyable to work in.

Mohaakilla51, to me, it seems like you've hit the nail on the head.
Yeah, now to just bandage up my bruised thumb and i will be good :p

This topic is closed to new replies.

Advertisement