Welcome to MSDN Blogs Sign in | Join | Help
Poll: You learned Java or C++ first?

 At the college you are attending or attended, was the focus on a native language (C, C++) or a managed language (Java, C#)?

The first real language I learned was C++ and later when I had to take a class in Java, I thought it was very easy.

However, I hear of people who have taken a year’s worth of Java and then crash and burn when they try and write something in C++ because of pointers and memory management.

I also wonder as to how successful people are whose school has a heavy focus on managed languages and only lightly brushes on native code. It feels like if you were taught a native language and were forced to learn a managed language, you’d pick it up quicker than someone who was taught a managed language and forced to learn a native one.

I’m curious to hear what other people’s experiences have been. Is it better to learn a native language first? Or is learning an “easy” language like C# a better introduction into Computer Science?

Posted: Thursday, June 28, 2007 8:46 AM by Chris Becker
Filed under: ,

Comments

brian said:

You wrote: "At the college you are attending or attended, was the focus on a native language (C, C++) or a managed language (Java, C#)?" The problem with this kind of question is managed languages are rather new, so except for the newest programmers, managed programming was not much of an option.

I learned C and C++ as a child, many years before ever taking college courses about it. When Java came out, it took quite literally an hour to learn. It was just C++ minus some of the complication. I had about the same experience when C# came out. I picked it up in minutes.

For the last decade I've been doing mostly managed code. I rarely have need to develop OSs, drivers, and other low-level code, so my dependency on C++ is at an all-time low. I view C++ as the new assembly language: once needed, but hardly written anymore.

My recommendation is this: if you are ever going to use a native language, then learn it first before starting managed. If you start off with a managed language, you're going to ruin yourself for native. Not that learning it will be impossible, but that he / she is in for a world of hurt.

With that in mind, I do not trust C++ to new programmers who started off with managed code.

"Or is learning an “easy” language like C# a better introduction into Computer Science?" Non-sequitur. Computer science is not necessarily about programming languages. It is about algorithms, theory, proofs, research etc. Many CS departments emphasis absolutely programming. It is entirely possible that a new CS graduate can not program.

# June 28, 2007 4:34 AM

Chris Becker said:

Sorry, I should have said "...a better introduction to Software Engineering" as a Software Engineer can know little about raw Computer Science but everything about how a program is written and developed.

I find it interesting that you say that C++ is hardly written anymore. Some of the largest pieces of client software are still written in C or C++.

How many applications actually make the jump from native code to managed code? This is not a cheap move for a product and comes at the risk that you will spend all your time making it work again and end up shipping the same product.

Even if one day everything becomes managed code, you still have legacy code to maintain which is usually very hard to drop.

# June 28, 2007 5:03 AM

Zaki Mirza said:

I'll go with native languages. I'd even start with lower level (Assembly?). I started programming/scripting seeing HTML tags. really. I had mates who shared the passion of computing with me. That was back when i was in 7th/8th grade. We were 4. 2 of us went into visual basic and never returned. one started playing games all along and i went to C/C++ (via BASIC, yes i did basic for sometime and i thought it wasnt cool and free enough for me. I needed more challange)... (i never touched vb.. for some odd feelings i dont know what). By the time i was in 12th grade and we were having to learn C, i was considered guru in the class for C. (because after a small exposure to BASIC i left for C/C++ - self learning..hehe) the VB guys had developed some nice applications all this time (ranging from torjans and their controllers to data driven apps) but they never really could grab on to C.

In college it was mainly C/C++ till third year. During this time i had a project from a client which i made in C#. I hadnt touched it before, but there i was flying fullthrottle in C#.Net 2.0 making an app for an seo to manage his stuff ... all that in one month. i was making ASP.Net web server controls in C#. i was doing almost all the things in C#. But my class mates couldnt grab on to some concepts (even though they had a 2 years expereince of C++). Eventually they did though, even if somewhat late.

If you ask me the best way a fresh man can get into the programming world (or the ideal programming path), id define categories for programming languages.

SCRIPTING:

Python, perl, BASIC (not visual basic)

Managed level:

C#, Java, VB/VB.Net (yes i know VB is not managed but lets not get into that. )

Native Level:

C/C++

LowLevel:

Assembly

I'd say get the freshmen started with something like python/perl.(interactive dynamic languages). Give them concepts of varibles and primitive high level data structures (lists, arrays, dictionaries...etc). An alternative could be MATLAB since as a freshmen people are learning calculus,physics etc. as well. so they can relate the two worlds. can be real fun. something i learned in 3rd year of my college. i so regret learning that so late. Once they have this concept and they are up and running with command line utilities and making applications, they can be taken to C/C++ ASAP. shouldnt give them very big assignments to make in these languages, it will spoil them. keep the fun for C++/STL (Not C yet, i dont wanna go deeper into why not, but Bjarne strotstrup advocates that very beautifully in a lot of articles). After a year in C++, they should be exposed to MFC/OpenGL and other frameworks and libraries to develop real world applications as well as C and Assembly. By this time the student should be equiped with best skills that can take him anywhere. Let them be on their own, push them to the limits. (heck, why not give them a big assignment to make in JAVA?). If the student still complains that they need tutorials for java over n over, advice the student to do something else.

Now introduce them to C#/Java for RAD/Multi tiered applications/Web Services etc. as a part of software engineering course and make them read Code complete:p(kill VB please). But only for those things that are really too hard to do in C/C++ etc. like Web Services, Remoting, Multithreaded scalable programming etc.

Oh well, i hope this helps. Just my idea.

# June 28, 2007 9:43 AM

C. Watford said:

In about the 6th grade I was introduced to x86 Assembly and C. Then BASIC and C++ later. College brought OCaml, LISP, Scheme, Haskell, and Java. However, I only received formal education in assembly and C, the rest I had to learn on my own.

I would say that the people I meet who have no assembly or C experience tend to gloss over the lower level issues that still effect software today. Byte order issues in binary files, floating point formats (yes this is still an issue), threading/locking/atomic operations, and many others.

I've been labeled as a "bits and bytes" guy, as some sort of way of saying I would over-engineer a solution. However I've found that if you ignore those bits and bytes, even if a VM handles them for you, you wind up in trouble down the road.

Crack open an 8086/8088 Assembly reference and spend a few hours writing some real mode software. It is really quite fun.

# June 28, 2007 9:52 AM

Zaki Mirza said:

And id go with chris, you cant say C++ is not written anymore (or is comparable to how much assembly is written now). A lot of lagacy code is in C++ but a lot of new is being written in C++ as well. Managed enviornment are immature yet. They cannot really be put to mission critical/real time applications. The managed enviornments themselves are written in C/C++. The Microsoft Visual C++ team iterates over and over again C++ is far from dead. (though i dont really get the idea of managed C++ :s .... or compiling it to IL. Or i still have to polish some concepts of managed C++). Engineering applications are still developed in C++ "under the hood". So yes, C++ has a lot of future and im looking forward to C++0x, hopefully it will solve a lot of problems with C++ (if at all).

# June 28, 2007 9:53 AM

Kim said:

I started learning Java in high school, and then our intro CS course was in Java, and by the time I hit data structures in C++, I had a three year head start with Java... and it didn't help me one bit get through the wall that was C++.

Everyone assumed at that point that we knew how to program already, so picking up a new language wasn't going to be bad at all. Terrible idea. We didn't know how to program in a native language and instead of just learning new syntax we were also trying to wrap our heads around pointers and memory management.

I would much rather have learned a native language first, at the level and pace were it was assumed that I had no or very little programming experience, and been stepped through C++ one bit at a time.

I have no doubt learning Java would have seemed like heaven after that. As it is, I'm still scared of C++ (granted it's only been one semester) even though I got through the class successfully.

# June 28, 2007 10:16 AM

GregM said:

I taught myself BASIC, then I took a course in programming in college that was taught in Pascal.  That summer I taught myself C.  Somewhere in there I taught myself Perl.  Through college, i did only C.  After college I taught myself C++ when I started working QA at a sofware company that wrote products in C/C++.

I learned Java for a CS course, it was a breeze since I was working in C++ by then.

I've looked at C#, but haven't had a need for it.

Brian, you really can't say that C/C++ isn't used much anymore.  The world isn't all Windows, and even on Windows, C++ is still used in a lot of places.

# June 28, 2007 11:43 AM

fabiopedrosa said:

C->C#->Java :D

# June 28, 2007 11:54 AM

Chris Becker said:

Hi guys,

Thank you all for your feedback. When talking to students or professors, I constantly get asked "What can we do to be successful come graduation?"

The biggest pain point I see is that people get tossed into something thinking they’re good at "programming" but have no idea of what the nuances are of what they're doing. This leads to memory leaks, crashes from mismanaging pointers and many hacks to get something to work right.

I think if schools had a larger focus on native code writing, people would be better equipped to learn non-native stuff.

Sure, you can take this to either extreme. “Then teach assembly only!” “Then teach only managed code so people will be prepared for the ‘future of programming’”

However, many employers still ask for C/C++ skills and there is no easy street from Java->C++.

# June 28, 2007 3:35 PM

Justin Yost said:

I learned C++ first and found that it makes me a much better programmer learning that as opposed to Java, learned Java 2 years later, C# a year after that and more.

# June 28, 2007 3:54 PM

Allan said:

For the most part I agree with Brian.

There will always be a market for C++, but that market is much smaller now than it ever was before. In the last decade, the only C++ coding that I've done is maintaining old applications. Every new project was written entirely in managed code from the beginning. And of the legacy applications, a significant number of those were eventually scrapped and re-written in managed code.

When I think back to what projects I have done in native code, the main requirement was portability (generally the need to run on both Windows and Linux). However, with the success of Mono, some of those native applications are being rewritten in managed code as well.

For low level stuff there will always be a need for native code. And to a degree maintaining legacy code as well. However, in the last decade, that need has been growing smaller and smaller with each year.

If you know C++, great. If you don't, don't waste too much time over it. There is just not as much need for it anymore.

# June 28, 2007 8:04 PM

Kris said:

My recommendation:

Lisp -> C -> asm -> C++ -> Java/C# -> Ruby

My Education:

C -> C++ -> Java -> C# -> Ruby (currently)

# June 29, 2007 1:43 AM

Vincent Kao said:

C -> C++ -> Java -> C# ->asm

# June 29, 2007 6:34 AM

Daniel Spiewak said:

BASIC -> VB6 -> Java -> Ruby (before it was cool) -> C  -> C# -> C++ -> Scala (working on it)

My recommendation:

Java (good, rigid language.  Excellent starter) -> Ruby -> C

Once you've got the above, you should be fairly comfortable learning just about any imperative language life may throw at you.

# July 1, 2007 2:26 AM

RussianGeek said:

Turbo Pascal -> C++ -> Web Technologies -> C# && Ruby

# July 1, 2007 3:21 AM

Stephan Schmidt said:

My (self) education goes something like this:

VC20 Basic (C64 Basic, Amstrad Basic)-> Logo -> Assembler (6502, Z80, 68k) -> (lots of languages like E and Comal noone knows anymore) ->Lattice C -> Turbo Pascal -> (some university stuff like Prolo, Lisp and Oberon) -> Delphi -> C++ -> Perl -> Python -> Java -> Ruby (in the 90s before everyone used it) -> Java again -> Groovy

I'd start with Java and then learn C if needed from K&R (but never learn C if not really needed, I think it was a pain).

Peace

-stephan

--

Stephan Schmidt :: stephan@reposita.org

Reposita Open Source - Monitor your software development

http://www.reposita.org

Blog at http://stephan.reposita.org - No signal. No noise.

# July 1, 2007 4:19 AM

JD said:

In chronological order:

Basic

Logo ^_^

Pascal

C

Scheme/Lisp

SQL

Asm

C++

Eiffel

JAVA, my college apparently thought 2h were enough... :/

On my list:

Perl

Python

Ruby

PHP

# July 1, 2007 4:50 AM

Artur said:

Basic (C64) > Asm (6502) > Pascal/Turbo Pascal > C | Prolog > C++ > Java | Perl

# July 1, 2007 5:14 AM

Carsten Saager said:

My order (only the important ones) assembler,BASIC,Pascal,C,Modula,Lisp,C++,Java,Scala

In general this bottom up is quite useful as you can learn concepts you can forget about in higher(?) levels:

ASM->C++->Lisp->Scala

This assumes that you want to build applications, if you want to go write low-level code  I propose the reversed order.

# July 1, 2007 5:20 AM

shyam said:

c/c++

# July 1, 2007 7:36 AM

Alexander said:

My order:

BASIC (C64 and East Germany computer models :-)

Assembler (6502)

Pascal

C

C++

Perl

Java

...

However, only some C and C++ was really teached to me in a course, everything else was self-study. There will be always a

market for C/C++ but this is either were the boring stuff

(maintenance) or the really cool engineering stuff (systems/databases/compilers etc.) is produced. Java wouldn't be where it is today without the Hotspot VM, which one of

these large C/C++/Assembly monsters.

# July 1, 2007 7:59 AM

Alper said:

I first met PASCAL nearly a year passed with it. Thought for introduction to Programming Languages. I think its understandable (keywords other than symbols) felt comfortable. But after a short time we were introduced to C. I like it so much. But at that time Java came into play and I went for it. Until this year I never look back. My thesis should be implemented in C. I was very frightened but after some time its gone. I think some background and practice on low level languages is needed. After that you can go for some high level language and return easily if needed...

# July 1, 2007 8:47 AM

Michael Nischt said:

C++ -> Haskell, C -> Java -> ASM -> C# -> Groovy

Currently, I'm interessted in learning Scala and Erlang.

On the on hand I really like static typing, but IMHO the future lies in functional languages without variables.

However, when it comes to daily work, I'm still enjoying Java the most..

# July 1, 2007 10:19 AM

Jing Xue said:

BASIC -> Assembly -> Pascal/Prolog/LISP/FORTRAN -> Eiffel/C -> C++ -> Java/PHP/Ruby.

# July 1, 2007 12:17 PM

Zack said:

C++ then Java & C#, ya learning a native language first made things MUCH more easier..

# July 1, 2007 7:43 PM

Jónas Tryggvi said:

I learnt C++ first, then Java, but after 6 years of programming I'd recommend starting out with something like Python to learn the basics of programming (getting the grips of loops and abstract thinking).

Being able to show a CS student this code; http://www.norvig.com/spell-correct.html - early in their studies and show them just what is possible if they understand what they are doing would be so awesome. Then later on, they can learn to use Java to create more serious applications, and then learn how to use C++ for implementing advanced containers and algorithms, as the students that want to go into operating systems or computer games will most likely have to use C++, or just if they want to do basic AI like search and stuff where memory counts then C/C++ is the only way.

I remember a lot of students having endless problems with their compiler or IDEs and spent most of their time getting over that hurdle when they were supposed to be learning how to program. Thats why things should be kept simple at first so the students can learn the concepts without battling with the C++ compiler or Java classpaths.

But this "which language" discussion is pointless, programmers should learn many languages and use them as they like. I use Perl, Java, Ruby, C++ all the time, I've seen my friends do very cool things with Scheme, ML, Prolog.. its not the language that counts, its the programmer. People should just learn more discrete math, probability theory and graph theory - study computability theory and understand what NP-Complete really means, and how Computer Science is mostly about modeling a continuous world in a discrete manner and trying to find good approximations to hard problems!

It always amazes me how obsessed programmers are with their favorite programming language, cause programming languages are just tools - and although I might like my hammer, I shouldn't try to use it as a saw. Just learn how to use all the tools, IDEs, databases and operating systems - they are all good!

# July 1, 2007 8:25 PM

jfb3 said:

My evolution:

College:

Fortran (G1/F77), PL/1, Cobol, Assembler

Post College:

More Cobol variants (including 68/72), Basic, RPG, Algol/DCalgol/NEWP, C, Visual Basic, PHP, C#, Java, Python, Ruby, and other miscellaneous little languages.

Yep, I'm older than you.

# July 2, 2007 12:40 AM

GG said:

From the earliest to latest:

C

C++

Asm

Java

Lisp/Prolog

# July 2, 2007 6:59 PM

shaoxp said:

this is mine.

C->C++->Perl.

i also learned Java and C# for some time, i think it is not easy for me to understand them like C/C++ and it feels freer to use C/C++.so i chose to focus on them in my future career which just begined.:)

# July 5, 2007 5:37 AM

James said:

You say that C++ --> Java is the way to go, however people who learn C++ then go on to java can find it difficult due to the sloppy programming practices such as using random C functions in C++ rather than OO programming. Java --> C++ really is not that bad

# October 30, 2007 8:24 PM

Chris Becker said:

What's a random C function though? You mean using printf instead of cout?

Java has the same problem with deprecated functions.

But Java doesn't have any type of memory management concerns. Having to learn the concept of pointers (I think) is much harder after having been ingrained in a managed language

# October 30, 2007 8:27 PM

Castigator said:

Can you all write Assembly language programs correctly with your eyes blindfolded and one hand of yours tied at the back?

If you can do that then you are real programmers; if not start a new occupation :-(

# June 24, 2008 3:11 AM

Chris Becker said:

Technically, yes. Microsoft Visual Studio supports the same accessibility features as other Windows applications and can be used by someone who cannot see by using a screen reader.

# June 25, 2008 10:03 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker