Jump to content



Photo

C++ as a base language....!


  • Please log in to reply
11 replies to this topic

#1 Rock12

Rock12

    Neowinian

  • Joined: 30-January 13

Posted 30 January 2013 - 22:36

How C++ can play an important role as a base language in order to understand the modern programming languages such as C#, Java, J# etc?


#2 Colin McGregor

Colin McGregor

    Neowinian Senior

  • Joined: 02-September 11
  • Location: Ontario, Canada
  • OS: Windows 8 x64, Gentoo x64 Sometimes
  • Phone: Samsung Ativ S WP8

Posted 30 January 2013 - 22:42

How C++ can play an important role as a base language in order to understand the modern programming languages such as C#, Java, J# etc?


I actually learned C# without knowing anything at all about C++. Didn't even know what cout or cin was lol. I only knew a little bit of C but no OOP at all.

#3 OP Rock12

Rock12

    Neowinian

  • Joined: 30-January 13

Posted 30 January 2013 - 22:44

I am looking for answer of that question.. But, I am unable to find the answer yet. :(

#4 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 30 January 2013 - 22:50

I'm fairly sure that this is a homework question for a CS class you are taking, so I'm not going to give you a direct answer. Regardless, if you Google the question you can find answers here and here. I recommend that you consider C++'s explicit memory management and object-oriented design in your answer. Thinking through the pros and cons of each language is likely to help as well.

#5 OP Rock12

Rock12

    Neowinian

  • Joined: 30-January 13

Posted 30 January 2013 - 22:52

I'm fairly sure that this is a homework question for a CS class you are taking, so I'm not going to give you a direct answer. Regardless, if you Google the question you can find answers here and here. I recommend that you consider C++'s explicit memory management and object-oriented design in your answer.


Hey budy you are right. But, I am looking answer for one of my friend. She can't do it because of some problem so I am asking for help. I will be very thankful to you if you provide me the answer..

#6 +SharpGreen

SharpGreen

    Now with built-in BS detector.

  • Tech Issues Solved: 1
  • Joined: 20-August 04
  • Location: North Carolina
  • OS: Ubuntu 14.04, 12.04 and Windows 8.1
  • Phone: Galaxy Nexus

Posted 30 January 2013 - 22:57

You don't need to know anything about C++ to be able to learn C# or Java. If anything C# and Java might help in learning C++ because of the similarities in syntax.

#7 Colin McGregor

Colin McGregor

    Neowinian Senior

  • Joined: 02-September 11
  • Location: Ontario, Canada
  • OS: Windows 8 x64, Gentoo x64 Sometimes
  • Phone: Samsung Ativ S WP8

Posted 30 January 2013 - 23:07

You don't need to know anything about C++ to be able to learn C# or Java. If anything C# and Java might help in learning C++ because of the similarities in syntax.


nope. I recommend C++ first. I did C# then I did C++ afterwards and I felt a huge leap backwards. Like every shortcut I was taught in C# I was being shown the long way in C++.

#8 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 30 January 2013 - 23:53

You don't need to know anything about C++ to be able to learn C# or Java. If anything C# and Java might help in learning C++ because of the similarities in syntax.


I don't think the question is suggesting that its necessary to learn C++ first; its merely asking what some potential advantages of learning it before other languages may be. For the serious programmer, its probably best to understand the basics before moving on to something more abstract. Abstraction is great - the bread-and-butter of modern programming - but there is no substitute for understanding how things work underneath. Even with a greater level of abstraction (and therefore ease-of-use) provided by many other modern programming languages, a programmer who understands the cost of each instruction will (hopefully) write more efficient code.

Its somewhat similar to having working knowledge of the architecture of your machine (usually in the context of assembly) when doing embedded device programming. For example, using a int in C on an 8-bit microcontroller has much higher overhead than using an unsigned char because an int is both 16-bits wide (so it can't fit in a single register) and signed (so the sign bit must be explicitly manipulated), translating into more assembly instructions. Most loops could be just as easily be written using an unsigned char to keep track of the number of iterations as an int. On modern 64-bit Intel processors this particular restriction has no bearing, but the concept is still the same: know thy architecture.

#9 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 10
  • Joined: 26-October 05

Posted 31 January 2013 - 00:11

It's an example of terrible language design and makes you realize how lucky you are if you can program in anything else than C++ (except perhaps PHP). It's a good language to start learning programming because at that point you don't know any better and can't realize how miserable and unproductive you are because of its flaws; it also makes it a joy to discover other things that aren't complete **** such as C# or Python. It's always better to start neck-deep in the **** hole and climb out than the other way around, so learning C++ first can be a good way to go about it. Also, the more time goes the more people realize they don't actually need for C++ for much of anything, and there's still a whole bunch of software written in it, so if you have forever renounced to all pleasures of life, writing C++ is something that pays very well today.

#10 Riva

Riva

    Neowinian

  • Tech Issues Solved: 1
  • Joined: 11-February 07

Posted 31 January 2013 - 00:16

C++ wont teach you C# or Java. In fact C# and Java have been shaped around the limitations of C++. Having said that, C++ applications run faster as the runtime is not virtualised (.NET CLR, JRE) and if you are doing Windows development you will notice that you have a greater set of APIs for C++. Looks like Microsoft are working on a new runtime that doesn't need virtualisation and an OS that executes in that runtime. Hell it even has more than one kernel (as many processing units you can have on your machine)

#11 +Karl L.

Karl L.

    xorangekiller

  • Tech Issues Solved: 15
  • Joined: 24-January 09
  • Location: Virginia, USA
  • OS: Debian Testing

Posted 31 January 2013 - 00:20

People use C++ because it can be high performance (depending on how good the programmers who wrote the code were). That's why the video game industry uses it almost exclusively: they need all the performance they can get. Like Dr_Asik said, its nowhere near as easy to use as Python, but there is a huge industrial code base written in it.

#12 Andre S.

Andre S.

    Asik

  • Tech Issues Solved: 10
  • Joined: 26-October 05

Posted 31 January 2013 - 00:32

That's why the video game industry uses it almost exclusively: they need all the performance they can get.

State-of-the-art multiplatform engines are written in C++, mainly for portability to consoles but also in good part for performance, indeed. However, these engines usually allow writing much of the actual game logic in some other language - UnrealScript, Lua, C#, Boo, etc. Civilization IV was largely written in Python, for instance.



Click here to login or here to register to remove this ad, it's free!