c and c++

Philippart

Golden Member
Jul 9, 2006
1,290
0
0
I'm an absolute beginner, is the knowledge of C# required to learn C++?

Which one would you suggest as a first programming language?

So far I only have experience in HTML, CSS and PHP.

Thanks in advance
 

Philippart

Golden Member
Jul 9, 2006
1,290
0
0
Originally posted by: Woosta
Python.

I'll learn python anyway next year at university (in the computer science course), but if I had to choose between C# and C++, what first?
 

esun

Platinum Member
Nov 12, 2001
2,214
0
0
You don't need to know C# to learn C++ (C# was created after C++ after all). I'd recommend learning C# first, though, since the syntax is cleaner than that of C++.
 

QuixoticOne

Golden Member
Nov 4, 2005
1,855
0
0
I'd say learn the basics of (C) first, otherwise you're going to be in hell when you try to write / understand (C++) code that doesn't quite work. C++ isn't so insulated from the machine that you don't occasionally have to understand things below the nice abstract OOP level to debug / understand it.

Also (C) is dirt simple, so it'll take just a few days of playing with it to get the ideas pretty well down.

Then I'd learn (C#) since it is pretty rich and makes it a little harder in some ways to shoot yourself in the foot than (C++)... Then (C++) which will come very easily once you know (C) and (C#).

Before I learned much anything about any of the specific LANGUAGES I'd study some DESIGN PATTERNS and good programming theory / practice references. Code very defensively, concisely, formally. Design by contract, embedded documentation, et. al. Check everything that might not work right. Make things const if they don't need to change. Make things local if they don't need to be global. etc. etc.
 

Cogman

Lifer
Sep 19, 2000
10,278
126
106
Originally posted by: QuixoticOne
I'd say learn the basics of (C) first, otherwise you're going to be in hell when you try to write / understand (C++) code that doesn't quite work. C++ isn't so insulated from the machine that you don't occasionally have to understand things below the nice abstract OOP level to debug / understand it.

Also (C) is dirt simple, so it'll take just a few days of playing with it to get the ideas pretty well down.

Then I'd learn (C#) since it is pretty rich and makes it a little harder in some ways to shoot yourself in the foot than (C++)... Then (C++) which will come very easily once you know (C) and (C#).

Before I learned much anything about any of the specific LANGUAGES I'd study some DESIGN PATTERNS and good programming theory / practice references. Code very defensively, concisely, formally. Design by contract, embedded documentation, et. al. Check everything that might not work right. Make things const if they don't need to change. Make things local if they don't need to be global. etc. etc.

Don't make anything global if you can (thats not a const that is, and even they should be as local as possible)

Honestly, though. I would say learning c++ would be slightly easier for a beginner then C. cout << "blah" << i << endl; is far easier to me then printf("blah%d/n", i); (looks cleaner too) Yes, there is added overhead, but if you are learning c++ anyways then why not start there?

I have never dealt with c# so I couldn't tell you if you should work with it or not.
 

Jest3r

Member
Jan 18, 2008
85
0
0
I don't mean to totally ninja your thread, just add to it =D

I am also a complete beginner, and I'm wondering how common C is used in the business world today compared to other languages?
 

XxPrOdiGyxX

Senior member
Dec 29, 2002
631
6
81
Originally posted by: Jest3r
I don't mean to totally ninja your thread, just add to it =D

I am also a complete beginner, and I'm wondering how common C is used in the business world today compared to other languages?

It would depend on the industry. I have no experience in the financial industry so I don't know what technologies they use. For all I know they may still be using FORTRAN because it's good at what it does. As far as the Government contracting industry, in my experience, there is a transition to either C# or Java depending on what they are trying to accomplish. As we speak, my company is phasing out and replacing legacy code that was written in C, C++, and VB6. For us, C# has been a godsend and we've been able to fully utilize OO concepts and make use of design patterns that C++ or C would not have allowed us to do.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
Originally posted by: XxPrOdiGyxX
Originally posted by: Jest3r
I don't mean to totally ninja your thread, just add to it =D

I am also a complete beginner, and I'm wondering how common C is used in the business world today compared to other languages?

It would depend on the industry. I have no experience in the financial industry so I don't know what technologies they use. For all I know they may still be using FORTRAN because it's good at what it does. As far as the Government contracting industry, in my experience, there is a transition to either C# or Java depending on what they are trying to accomplish. As we speak, my company is phasing out and replacing legacy code that was written in C, C++, and VB6. For us, C# has been a godsend and we've been able to fully utilize OO concepts and make use of design patterns that C++ or C would not have allowed us to do.

C and C++ are still the high-performance languages of the server world. There's a heckuva lot of stuff written for servers in scripting languages -- but all their execution time is in C/C++-coded stuff. So... as usual... the value of C/C++ depends on what you want to do.

Edit: Flamewar prevention: Some java too...
 

irishScott

Lifer
Oct 10, 2006
21,568
3
0
I'd reccomend the route I took.

Java first, then c++

Java will "hold your hand" so to speak, in the sense that you can mess around with the conceptual without having to worry much about low-level problems (manual memory management and such). It also provides more comprehensive error message (ie: Java will tell you "ArrayIndexOutOfBounds", and provide a backtrace. C++ will tell you "segmentation fault", and you have to use a separate debugging program to get the backtrace).

The syntax is virtually identical, so the initial transition is easy. Once in c++ with a solid grasp of programming concepts, you graduate to the more technical lower-level concepts.

It's a nice route to take. In college, when everyone else was learning syntax and OOP, I had already progressed to pointers (took APCS Java in High School).
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Originally posted by: Jest3r
I don't mean to totally ninja your thread, just add to it =D

I am also a complete beginner, and I'm wondering how common C is used in the business world today compared to other languages?

Depends on the business.
In electronics C is used more than C++ since it is closer to the hardware than C++.
I think they should require beginning programmers to work with some embedded micros to learn programming.

It provides instant results that are easy to understand and teaches the programmer not to write bloated code, which is becoming a problem now that people feel they have gobs of memory to play with.

 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
In electronics C is used more than C++ since it is closer to the hardware than C++.

I don't think C is closer to the hardware than C++. There's just less compiler overhead, and it's easier to control the layout of structures in memory. It's also available for more embedded platforms than C++, I think.
 

Modelworks

Lifer
Feb 22, 2007
16,240
7
76
Originally posted by: Markbnj
In electronics C is used more than C++ since it is closer to the hardware than C++.

I don't think C is closer to the hardware than C++. There's just less compiler overhead, and it's easier to control the layout of structures in memory. It's also available for more embedded platforms than C++, I think.

C is the closest language we have to Assembly which is actually the preferred language for most micros. There isn't a whole lot of c++ support in most of the embedded market. To start using c++ you have to start moving into the more recent cpu like the AVR and ARM .

Heres a link showing a couple C programs for the Pic micros for the curious.
http://www.ccsinfo.com/content.php?page=compexamples
 

slugg

Diamond Member
Feb 17, 2002
4,722
73
91
Well, I'm a computer science & mathematics double major... I used C a lot in courses that used Matlab and/or Mathematica. If you ever go into embedded systems, C is the way to go. I did a few things with Java in Mathematica (via J-Link), the Lego robotics kits, and a few projects here and there. I had a class over the summer in which the ongoing project was a stock market analysis program (pattern recognition, etc) written entirely in C++. All the really arithmetically intensive stuff (matrix and vector transforms, like discrete wavelet/cosine/fourier) is usually done in ASM, or at lease in-line ASM.

So basically, every language has its use... As for which ones to learn and when, it's really up to you, but here's the path I took:

1. Basic (never actually learned it, it was just better than psuedo-code)
2. Java, including Object Oriented Programming concepts and data structures
3. C, basics + some memory management and basic data structures.
4. C++, including OOP concepts (super easy since Java syntax is similar, I learned C, plus I already knew all the OOP concepts).
5. more C, more data structures in C
6. *some* ASM (which implies some basic data structures)

^^ And that's where I'm at right now... I've been getting A's with flying colors in my classes. Obviously, since this worked for me, I'd recommend something like it for you

If you want to learn C# instead of Java, that could work too. Really, if you learn one, the other is REALLY easy to pick up. I've never had any reason to program in C#, but I can look at C# code and fully understand it without any issue. The most I'd have to do is look up what a couple methods are, that's about it. One good thing that Java has over C#, though, is that Java is more academically friendly.

Generally, I'd say I'm learning in a "top-down" fashion - meaning I've started with really high level languages (Basic, Java, etc), then slowly worked my way to lower level languages (C, ASM). This works for me because I started out with an abstract understanding of programming, then later filled in the gaps. I just think it flowed pretty well, but your brain might think differently.

Hope this helps!
 
Sep 29, 2004
18,665
67
91
<== 8 years in the world of software development. Learn C++. If you figure out that, you can easily move onto C# and/or Java.
 

alocurto

Platinum Member
Nov 4, 1999
2,173
0
76
Originally posted by: IHateMyJob2004
<== 8 years in the world of software development. Learn C++. If you figure out that, you can easily move onto C# and/or Java.

Agreed. I would stay AWAY from C as it isn't object oriented and will put you on a path that MIGHT make C++ and C# more confusing down the road.
 

abubakarm

Member
Mar 9, 2008
36
0
0
Originally posted by: Philippart
I'm an absolute beginner, is the knowledge of C# required to learn C++?

Which one would you suggest as a first programming language?

So far I only have experience in HTML, CSS and PHP.

Thanks in advance

Get some introduction to C language book, like Thinking in C. Dont go into programming theory a lot, that can bore you if you know what I mean (you can phd in programming later), but it also depends. You are trying to do self learning, I say *code* is your best friend. Get a good book and just start learning and make simple programs. C is very simple language, there are few rules and you will enjoy a lot. C++ is a *huge* language, there are tons of concepts. But do not be afraid, once you are writing algorithms in C language and various C concepts are on your finger tips, than the C++ is going to look simple. Basically C++ has *object oriented* as a very strong part of it and C does not have that. Object Oriented (OO) requires first to understand the theory behind it which is also pretty simple and can come naturally if you are reading a good book (and writing a lot of code ). So thats it, read a lot and code a lot in C, you'll have a good time and if you do it the write way, every other programming language you learn in life is going to look simple .
 

sao123

Lifer
May 27, 2002
12,648
201
106
from an instructors POV, C++ is the best language to learn first.
It takes all the best from the unmanaged languages (like C) and adds OOP/Data structures concepts. Once you successfuly learned C++, you can apply what you have learned to ALL other programming...

The syntax, may change slightly, from C++ to C# to Java, but C++ is the best starter language. It is the most thorough, and the most flexible of the group.


Also again from an instructors POV... Deitel's programming books are among the best.
 

hans007

Lifer
Feb 1, 2000
20,212
17
81
Originally posted by: Markbnj
In electronics C is used more than C++ since it is closer to the hardware than C++.

I don't think C is closer to the hardware than C++. There's just less compiler overhead, and it's easier to control the layout of structures in memory. It's also available for more embedded platforms than C++, I think.

C is closer...


then again ... if you just use C++ and dont use any of the C++ specific things it'd be the same.

the only real difference is that c++ has classes with inheritance and such. so the compiler has to search through vtables. If you read about how that works, classes are very much just structs with lookup tables in certain places that the compiler has to check first.


Anyhow, I am in agreement with most people here that you should learn the lowest language you can first. its hard to "move backwards". I mean its easier to understand a concept that has been abstracted away in a language like python in terms of C++ than it is to learn these things in python and figure it out the other way.

Then agian Im biased since i learned the lower level languages first, and it seems that schools are really emphasizing these abstracted away dynamic languages more .

which makes sense since the job market is filled with jobs like that now. I'm primarily a java and c++ developer, so I have noticed this.

then again we have all the processing power in the world for the mos tpart so it has its place, but not knowing how to do it the more low level and strucutred way is a handicap.

so yeah, basically learn the hardest thing you can. depends on how smart you are.
 

Atheus

Diamond Member
Jun 7, 2005
7,313
2
0
Originally posted by: hans007
Originally posted by: Markbnj
In electronics C is used more than C++ since it is closer to the hardware than C++.

I don't think C is closer to the hardware than C++. There's just less compiler overhead, and it's easier to control the layout of structures in memory. It's also available for more embedded platforms than C++, I think.

C is closer...


then again ... if you just use C++ and dont use any of the C++ specific things it'd be the same.

the only real difference is that c++ has classes with inheritance and such. so the compiler has to search through vtables. If you read about how that works, classes are very much just structs with lookup tables in certain places that the compiler has to check first.


Anyhow, I am in agreement with most people here that you should learn the lowest language you can first. its hard to "move backwards". I mean its easier to understand a concept that has been abstracted away in a language like python in terms of C++ than it is to learn these things in python and figure it out the other way.

Then agian Im biased since i learned the lower level languages first, and it seems that schools are really emphasizing these abstracted away dynamic languages more .

which makes sense since the job market is filled with jobs like that now. I'm primarily a java and c++ developer, so I have noticed this.

then again we have all the processing power in the world for the mos tpart so it has its place, but not knowing how to do it the more low level and strucutred way is a handicap.

so yeah, basically learn the hardest thing you can. depends on how smart you are.

To rephrase that quote, I would say:

"In electronics C is used more than C++ since it is simpler and easier to implement on embedded systems than C++. "

I don't think either is closer to hardware really. You could make C++ do anything that C does if you use an appropriate compiler.

Learn C first, than build on that knowlege with C++.

Or learn Java first, then go back to the hardware with C, then you can easily put your OO and memory management skills together should you ever need to.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |