tags:

views:

294

answers:

8

Hi, I am totally new to programming as though I have my PhD as a molecular biologist for the last 10 years. Can someone please tell me: Would it be too hard to handle if I enrolled simultaneously in C++ and python? I am a full time employee too. Both courses start and finish on the same dates and is for 3 months. For a variety of complicated reasons, this fall is the only time I can learn both languages. Please advise. GillingsT

Update: A little more detail about myself: as I said I did a PhD in Molecular Genetic. I now wish to be able to obtain programming skills so that I can apply it to do bioinformatics- like sequence manipulation and pathway analysis. I was told that Python is great for that but our course does not cover basics for beginners. I approached a Comp Sci Prof. who suggested that I learn C++ first before learning Python. So I got into this dilemma (added to other logistics).

+2  A: 

If you are new to programming, I would say start with the C++ class. If you get the hang of it and enjoy programming, you can always learn Python later. There are a wealth of good books and Internet resources on pretty much any programming language out there that you should be able to teach yourself any language in your spare time. I would recommend learning that first language in a formal classroom, however, to help make it easier to learn the general concepts behind programming.

Edit: To clarify the point I was trying to make, my recommendation is to take whichever course is geared more towards beginning programmers. The important things to learn first are the basic fundamentals of programming. These apply towards almost any language. Thanks to the wealth of resources available online or in your bookstore/library, you can teach yourself practically any programming language that you want to learn. First, however, you must grasp the basics, and intro C/C++ classes typically (in my experiences, at least) do a good job of teaching programming fundamentals as well as the language itself.

Since you are a beginning programmer, I would not recommend trying to learn two languages at once (especially if you are trying to learn fundamentals at the same time). That's a lot of very similar (yet very different) information to keep track of in your head, almost like trying to learn two brand new spoken languages at the same time. You may be able to handle it perfectly fine but at least for most programmers that I know, it is much easier to get a good grasp on one language first and then start learning the second.

bta
-1: Exactly backwards. Start with something simpler like Python. Learn C++ when forced to.
S.Lott
Agree with S. Lott, I think Python is the best language for a beginner to learn
Stranger
@S. Lott: Simpler things are harder to learn because they are not challenging enough. No challenge == no fun == quickly forgotten lessons. Give me something that will fry my brain, and I'll remember it forever. Give me something easy, and I'll forget it in 5 minutes.
SigTerm
@SigTerm: "Simpler things are harder to learn" Amazing. That makes it hard to interpret "simpler" or "harder". I would think "simpler" means "simpler" which means "easier" and -- by extension -- "easier to learn". If you're saying that "simpler" means "harder" would you also say "bigger" is "smaller"?
S.Lott
@Stranger: " Python is the best language for a beginner to learn". IMO, it will be better to start with something that doesn't (by default) copy half of things by reference. So it is definitely not "the best".
SigTerm
@S.Lot, @Stranger. I am with SigTerm and bta. A beginners cours in C++ is not going to give the full language but it will give you the fundamentals (a lot of stuff that can't be learnt in Python). Once you have the fundamentals learning another (procedural/OO) language then relatively trivial.
Martin York
@SigTerm: "something that doesn't (by default) copy half of things by reference" What? Python works exclusively through references to objects. C++, OTOH, requires you to think through reference vs. pointer vs. primitive type -- a complex set of rules that even experts get wrong sometimes.
S.Lott
@S.Lott: ""bigger" is "smaller"" And here we have a strawman argument. I'll explain: "Things that are were not challenging enough to understand are easy to forget".
SigTerm
@S.Lott: http://www.testingreflections.com/node/view/5126 . To my opinion, this is not a consistent behavior that may result in a lot of fun in certain situations. I prefer to stand on solid ground, which is provided by C++ rules where you can specify exactly how and where value will be avilable. Anyway, I'm not interested in another pointless language war. Bye.
SigTerm
@SigTerm: "Things that are were not challenging enough to understand are easy to forget" Are you talking about retention? If so, why? Retention is widely thought to be a function of repetition, not initial difficulty. And that doesn't seem to be a part of the question or this answer.
S.Lott
@SigTerm: "C++ rules where you can specify exactly how and where value will be avilable." While possibly true, this doesn't seem to facilitate **learning**. It seems to facilitate optimization.
S.Lott
Thankyou all for taking time to answer me. A little more detail about myself: as I said I did a PhD in Molecular Genetic. I now wish to be able to obtain programming skills so that I can apply it to do bioinformatics- like sequence manipulation and pathway analysis. I was told that Python is great for that but our course does not cover basics for beginners. I approached a Comp Sci Prof. who suggested that I learn C++ first before learning Python. So I got into this dilemma (added to other logistics). Any adivise is appreciated.GillingsT
GillingsT
@GillingsT: Please UPDATE your question with additional information. It's your question -- adding to comments is confusing.
S.Lott
@S.Lott: About "C++ vs Python" debate. I was perfectly happy with python until I wrote a large blender export script with it, which made me discover few features I disliked (the way you initialize member variables, "self", "pass" statement, pass by reference, relying on "invisible but important formatting characters", etc). If you want __easy__ language to learn, that'll be pascal/delphi, not python. Pascal is powerful enough, applicable for practical tasks, has OOP, and doesn't have more complex features like operator overloading, templates, or multiple inheritance. It is hard to beat that.
SigTerm
@GillingsT: "Which language is better" is a subject of heated discussions everywhere, so I can't really answer that. Overall... in C++ you have everything structured and separated in hierarchy of concepts, but development is slower. C++ is powerful, but complicated. In python development is faster, it is easier to manipulate lists/sequences (well, C++ has STL, but that is an additional subject), but to my opinion everything will be a bit messy and unstructured - i.e. *I* don't have "standing on solid ground" feel from python program. Also, ...
SigTerm
@GillingsT: ... compared to C++, debugging in python (IMO) is more complicated. Some errors that would noticed on compile time in C++ won't be noticed until run the program AND meet certain conditions in python. It is dynamic language, with dynamic types, which makes things easier to write, but less "certain". Because I prefer power, certainty, large array of "tools"(STL, templates(especially templates), macros) and total control over everything, C++ is my choice (although I use python for small scripts). Which language will be better for you I do not know.
SigTerm
Right language for the right job, 'nuff said. If you need some hardcore number crunching, go with the C++ course. If you need tooling or stuff that's not about pure performance, go with the Python one. PS: My personal experience is, that Python -> C/C++ was easier(as an autodidact).
Ivo Wetzel
@SigTerm: "pascal" What? Was the question updated? "Which language is better"? Again, was the question updated? "noticed on compile time in C++ won't be noticed until run the program" Umm... C++ is full of errors that can't be detected until run time. I'm not sure what the point of all of this is. Was the question updated?
S.Lott
@S.Lott: As I said, I'm not interested in language wars. If you like python, keep liking python, I don't care. Discussion is over.
SigTerm
@SigTerm: I'm trying to understand your points and why you're making them. I didn't see the question get updated. I'm not sure what topic you're trying to address. Please clarify.
S.Lott
The only reason I recommended the C++ course first is because that is the most common course for beginning programmers to take. Thus, it is usually more geared towards those with little to no programming background, and tends to cover more of the language-independent fundamentals of programming. This is purely based on the courses I or my friends have taken, so YMMV. Plus, I found Python easier to learn on my own than C++ (but that's just my opinion).
bta
+6  A: 

You'll get holes in the head.

Python's data structures and memory management are radically different from C++.

Whichever language you "get" first, you'll love. The other you'll hate. Indeed, you'll be confused at the weird things one language lacks that the other has. One language will be reasonable, logical, unsurprising. The other will be a mess of ad-hoc decisions and quirks.

If you learn one all the way through -- by itself -- you'll probably be happier.

I find that most folks can more easily add a language to a base of expertise.

[Not all, however. Some folks are so mired in the first language they ever learned that they challenge every feature of a new language as being nonsensical. I had a guy in a Java class who only wanted to complain about the numerous ways that Java wasn't Fortran. All the type-specific stuff in Java gave him fits. A lot of discussions had to be curtailed with "That's the way it is. If you don't like it, take it up with Gosling. My job isn't to justify Java; my job is to get you to be able to work with java. Can we move on, now?"]

S.Lott
In a beginning C++ course they probably won't get into data structures (unless you're referring to the standard types), and I'd be shocked if they got as far as talking about memory management in terms other than "you declare a variable/array of size X". Of course, if the OP took the C++ course and was somewhat dedicated to learning Python on the side (which means trying to answer questions on python tutor mailing list/SO), I'd be shocked if he couldn't write equivalent (and better) programs in Python by the end of semester. I know I did. Of course I'm still "getting" python things daily ;)
Wayne Werner
+2  A: 

I think that given the circumstances (fulltime employee, etc) studying one language will be hard enough. Pick one, then study another. You'll learn basics from either language.

As for "which language to pick"... I specialize in C++, and know a bit of python. C++ is much more difficult, more flexible, and more suitable for making "traditional" executables.

I'd recommend to start with C++. You'll learn more concepts (some of them doesn't exist in python), and learning python after C++ won't be a problem.

SigTerm
Most of those concepts which are unique to C/C++ (pointers!!, strong typing, separate compilation/execution/headers/linking) are unique because more modern languages like Python have been wisely designed to do without them.
Paul Richter
There are also some Python concepts that don't have direct equivalent in C++. Generator functions and reflection for instance.
Alexandre Jasmin
@Paul, I've never seen a CS 101 course that taught pointers or went into headers much beyond "you type #include <stdio> so you can print to the screen". Pointers are great CS topics, and understanding them is essential to being more than a competent programmer, but in reality a beginning Python course will expose you to more stuff (objects, etc.) simply because it doesn't take so darn long to figure out why `if(x = 3)` is always executing. You learn, you understand, and move on, and that's exciting. In C++ you learn, you debug, you learn, debug, learn, debug, THEN understand and move on.
Wayne Werner
I would also start with C instead of C++. Some will argue that you'll develop bad C++ coding habits this way. But I think having fewer concepts to learn will make things easier. C++ just has so much stuff in it: OO, templates, function overloading, containers classes, smart pointers, const correctness issues, ...
Alexandre Jasmin
@Alexandre Jasmin: "I would also start with C instead of C++." Good idea, actually. Close enough to assembler to be useful...
SigTerm
@Paul Richter: "modern languages like Python have been wisely designed to do without them" I don't think this was a wise decision...
SigTerm
I agree with Alexandre. I think learning C first is a better idea. Then move from there to understanding why container classes exist, and stop using things like C style stings. As long as you don't get stuck in C forever (although some people would claim that's an improvement).
Jonathan Sternberg
A: 

I think it all depends on the level or difficulty of the of the class and that the languages in and of themselves really don't make that much of a difference.

To me, programming is 95% logical and about 5% dealing with syntax and the actual language. I started programming in high school and up through college (a senior a Computer Eng Currently) the focus was all about understanding the mindset of things and learning how to logically think through a problem and then develop a solution. Very few of our classes were a C++ or Java or Python based class. Of course there were some that focused on the more obscure languages such as x86 Assembly, but even then the idea was more of learning how to attack a problem. As a MCB person you should be fine with that.

For the other 5%, which is the actual language, taking two classes in two different languages will lead to crossovers. Of course a lot of what you learn in both can be applied to the others such as loops, conditionals, classes etc. However syntax is what is going to mess you up. You'll find yourself writing the syntax for the other language when you don't mean to. Simple things such as an if statement

Python:

if x > y

C++:

if (x > y)

But other than syntax issues, I really think all languages are pretty much the same. Sure people are going to disagree and that yes different languages are better at things than others but if you're not taking a graduate level class and these are both pretty basic intro classes what you learn could actually complement the other class you're taking.

But of course the biggest question for you to consider is time. Even being a full time student taking multiple heavy programming classes is not smart. Often times assignments are longer than expected or more difficult than first realized. So if you're going to have multiple long involved projects dealing with coding you may want to pick just one class. Especially seeing as a lot of what you learn in one can easily be translated to the other and vice-versa.

Adam
"I really think all languages are pretty much the same" Can't see how that could be true. Why isn't there a C++ to Python translator? I find that having to memory management in C++ is very different from not having to do memory management in Python. Also, I have a lot of trouble with the reference-pointer-primitive type business in C++. Python doesn't even have those concepts.
S.Lott
You're right, Python doesn't have any of the memory management. Which is why it would be considered better for beginners than C++ or even C for that matter. But if you get down to it, almost all languages are built around the same core operations. Conditional statements, loops, and data manipulation. When it gets compiled down to the Assembly that's all there really is. It's just how to get it down there.
Adam
CS 101 is rarely a heavy programming class... though it depends on your level of comfort and exposure to programming/scripting of any type.
Wayne Werner
Depends on who's CS 101 it is... I know the one at Illinois does Matlab then moves into C and deals with pointers and such.
Adam
A: 
Wayne Werner
print "Hello %s! You are %d years old!" % (name,age) is cooler ;)
Brenda Holloway
`print( "Hello {0:s}! You are {1:d} years old!".format(name,age) )` is the future.
S.Lott
Both true, though if I were teaching the course, string formatting wouldn't be their first exposure to printing strings. And @S.Lott, I'm just making the presumption that they're still teaching python 2.6/7 (though that's valid syntax in both versions 2.x and 3.x, and a good instructor would get them in the habit early!)
Wayne Werner
Your answer (after your edit) was exactly the point I was trying to make before my comment list got derailed into a flame war. +1 for making the point more clearly.
bta
A: 

I think you pretty much answered this question yourself:

I was told that Python is great for that but our course does not cover basics for beginners.

In other words, the Python course is not an introductory course -- it assumes you already know how the basics of programming. That's probably why the professor suggested you take the C++ course first.

Nathan Davis
A: 

I come from a computational maths background, and have written sizeable (commercial and accademic) programs in both C++ and python. They are very different languages and I would probably learn one first (or only one).

Which one would depend on what you want to be able to do with the language.

If you want to build something useful with your language that is not (overly) compute or data heavy, go with python, you'll get something useful quicker.

If you need to do something useful that is either compute heavy or data heavy, then you'll probably need to go with C++. But it will take you longer to get to something to do what you need --- It will take a while to learn C++, then additional time to code data-heavy or compute-heavy code effectively.

Now some will say that python can handle data/compute heavy jobs well enough.. but in molecular biology "heavy" can mean very heavy.

Having said this, my suggestion is go with python if you can.

Michael Anderson
A: 

You've got to find out what people in your field are programming with so you can leverage existing libraries/APIs/projects. It won't do you any good re-inventing the wheel in C++ or Python if there's some wicked-cool FORTRAN library out there that is standard in your field. (And, if that is the case, God help you, I'm sorry.) Anyway, the CS prof you talked to might not have any idea what computational molecular geneticists use.

Pete