Like Tree2Likes
  • 2 Post By Mario F.

Which Language

This is a discussion on Which Language within the General Discussions forums, part of the Community Boards category; Hi guys, i am new with c programming and i try to decide to learn which one.thats why i have ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    5

    Which Language

    Hi guys,


    i am new with c programming and i try to decide to learn which one.thats why i have a question.whats the difference between c,c++ and C#.which one is more useful nowadays?

    thanks.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    That's kind of a loaded question... You're about to get everyone touting their favorite language and possibly a firestorm debate about the merrits and flaws of each.

    C, C++ and C# are all "C-like" languages, but they are different languages.

    Speaking only for myself...

    I would rule out C# because it is an interpreted lanugage that realies upon a rather massive .NET infrastructure to work.

    C++ is very popular right now because it works on the "Object Oriented Programming" (OOP) model and makes code re-use and code-hiding very easy. It has the advantage of a greatly expanded run-time library but it also suffers the complexity of a greatly expanded run-time library... learning C++ is a real challenge and even though I work on it a little bit each day, it still overwhelms me.

    I've chosen (for now) to stay with C-99, "standard C" as it's a function based language with enormous capability from a relatively small compiler and library. However, it's not in high demand anymore, having been largely replaced by C++.

    My advice --if I dare in this case-- would be to learn standard C first then make the jump to C++... The advantage being that C++ compilers will compile C programs so by the time you get to C++ you're half way through the new language.
    Last edited by CommonTater; 04-28-2011 at 11:38 AM.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,450
    I am moving this thread to General Discussion, but as CommonTater noted this kind of threads tend to spiral out of control, so don't be disappointed if the thread is eventually closed.

    Quote Originally Posted by Lisyus
    i am new with c programming and i try to decide to learn which one.thats why i have a question.whats the difference between c,c++ and C#.which one is more useful nowadays?
    Why do you want to learn programming? If it is purely out of interest, then forget about what is useful. Pick one, then another, then another, and just have fun. If there is also the academic element, e.g., you will be learning something in school that involves programming, then what is useful is to find out what programming language will be used, and learn that. If you have something more specific in mind, then what is most useful to you could be determined by that.

    Quote Originally Posted by CommonTater
    My advice --if I dare in this case-- would be to learn standard C first then make the jump to C++... The advantage being that C++ compilers will compile C programs so by the time you get to C++ you're half way through the new language.
    That said, if you attempt to make use of your C knowledge too much when learning C++, you may actually retard your progress because you would reach for C-style solutions where C++-style solutions are more appropriate in C++.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    Quote Originally Posted by Lisyus View Post
    Which Language
    English.

    No, really. Even if you are programming for another idiom, always use English when naming variables and other objects or making comments on the code.
    Salem and whiteflags like this.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Learning C will provide you with a more fundamental education as far as lower level computer science concepts are involved for a number of reasons:

    1) because the memory management is manual
    2) because of the nature of c-strings
    3) because there is an emphasis on the use of bit manipulation (shifting, flagging, etc).

    That may or may not make the language more useful -- for some things, it makes it less, but according to TIOBE Programming Community Index for April 2011, C is actually used about 60% more than C++ and twice as much as C# worldwide:

    TIOBE Software: The Coding Standards Company

    So, contra to some claims, it is far from a "dead" or outdated language. C would be the language of choice for high-performance applications with a minimal memory footprint, and provide the broadest range of possible settings for its use.

    C++ can be less tedious to program in, and performs as well, but tends to use more memory (even if some people are in denial about it, lol). It's also more complex. I started learning C, then C++, and it's a path I recommend, but if you are really drawn to C++ now then go for it.

    C# is I think not used much except on Microsoft systems, so if you are looking for a language not bound to (and controlled by) a specific corporation, don't choose C#.

    Quote Originally Posted by laserlight View Post
    if you attempt to make use of your C knowledge too much when learning C++, you may actually retard your progress because you would reach for C-style solutions where C++-style solutions are more appropriate in C++.
    This is true, the temptation is always to do something in a way you know works, rather than investigate something new. However, if you are conscious about it and make an effort to see the difference, you can decide for yourself the value of some particular "c-style" solution in relation to its potential counterpart. Sometimes I see the C++ light, other times I think it is a little obsessive compulsive. C++ is very interesting, fer sure.
    Last edited by MK27; 04-28-2011 at 01:51 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,444
    To follow up with what laserlight and MK27 have said, the difference between learning C and C++ well is not just some minor syntactic differences, public and private members, inheritance, etc. The difference between procedural programming (C) and object oriented programming (C++) are really more about different ways of thinking and solving problems. The language used is just a tool for implementing those solutions. I personally grew up on Pascal and C for far too long before being introduced to serious OOP, and have had a very difficult time making the transition. I still write OOP with a procedural influence, kind of like speaking a foreign language with an accent. My grammar and vocabulary is quite good, but you know I'm not a native speaker. As for yourself, learn them both, perhaps somewhat in tandem. Find a problem to solve, and try it in C, tackling it in a procedural manner. Try solving it in C++ using good OOP methodologies. Once you have a solid grasp of both languages and problem solving paradigms, see how many OOP features you can implement in C. I think the following site has some good info/advice on learning programming: Teach Yourself Programming in Ten Years.

  7. #7
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    Do you want to learn OOP? Of course at this point you probably have no idea. Do you want to focus on low-level programming? Maybe again this question is pointless without starting programming.

    Let's set up an environment for both options. For this you need C++, not C. With C++ you can compile, as mentioned, low-level code and OOP code. So you keep your options open. If you decide later on to go purely to C, then you can skip C++. Learn the few differences of C++ and C and that is it.

    Furthermore, somethings are much easier in C++, like using a string. This can be nice for a beginner that wants to do something simple as an input/output without having to worry about ranges. Again, there are more options in C++ that are helpful to teach programming.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Language And A Scripting Language
    By DarkSpy in forum C Programming
    Replies: 9
    Last Post: 06-26-2003, 08:05 AM
  2. Which Language ?!?
    By Moni in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-22-2003, 04:20 PM
  3. Your first language...
    By funkydude9 in forum A Brief History of Cprogramming.com
    Replies: 36
    Last Post: 10-06-2002, 05:37 PM
  4. Language
    By nvoigt in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-29-2002, 02:28 PM
  5. Computer Language VS Spoken Language
    By Isometric in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 02-04-2002, 02:47 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21