I’m currently enrolled in a C++ class in college, Intro to Programming. At the end of the semester, what will I be able to do?? Make games? Graphics? A cursory inspection of the book by me, and I do mean cursory, indicates that I will be able to add and subtract, and display it all. Woo-hoo! I’m sure that I should be able to do more, but, I’m too lazy to go in depth right now, because there isn’t a section telling what this class can help me do, as would an html class, or something similar.
Can you make me hip, baby???
Thanks,
hh
If you work harder in class you might be able to get a B-
You won’t be able to do much unless you get a job that uses C++.
It’s hard to know without knowing things like your book, and even the professor’s preferences can make a lot of difference. Some really like collections, others are obsessed with recursion, and others still focus on design patterns (though that’s usually an intermediate-advanced level concept since you can’t successfully really discuss patterns without a strong foundation).
Generally the best I can say is that college programming courses don’t teach you programming so much as they teach you how to learn to program. They teach you important concepts, and how to use the tools in that language, but you can’t really “do” much with one semester of programming. Not to mention they don’t teach you languages, the teach you frameworks. I’m more Java than C++, so I’ll use it just out of familiarity. A lot of classes will teach you swing, now you probably won’t actually use swing much, but it’s a very good teacher to make you figure out how to do stuff, in another environment you may use GWT (Google’s framework, for their Google Apps) or a proprietary language/framework.
You probably won’t be able to do games, mostly because (as far as I know) most games aren’t written purely in C++, usually it’s a mix of some mid-level language (usually C++), some higher level (of C#, possibly Java), and a scripting (Python, I think Lua is probably the most popular right now). So you need a lot more to do something like that, though you probably could be a low level monkey.
Graphics is an almost definite no, generally for graphics you need a pretty good Linear Algebra background and often a dedicated course. Granted if you had access to a program and you do well in this class you could probably poke around* and figure it out, but with just the class probably not.
Things you’ll probably learn will be sorting algorithms, concepts like Linked Lists and Arrays and Binary Maps, maybe a bit of recursive logic, development styles (MVC, Test Driven Development, Agile) and things like that. But again, it depends on your book and instructor (and their department’s) preferences.
- This is what I meant when I said it teaches you to learn to program. “C++” is a broad concept, you can’t teach someone C++. The courses give you a foundation, which gives you the tools to be “fluent” in reading code and figuring out what it does.
Short answer in no, you won’t learn to code games or graphics (well, depending on what you mean by games and graphics I guess) with Intro to Programming. That’s just the first step toward those skills.
I’m a programmer, and we use C++ for some of our projects. But it’s just one of the languages we use. (I work in mapping software.) So it all depends if the company you want to work for uses it or not.
Um…maybe. You need the linear algebra to program the graphics primitives, but nowadays that’s all been pretty much done for you. I’m pretty sure most graphics packages abstract the low level stuff away nowadays.
It’s not true that you’ve wasted a class if you don’t land a job using C++. Learning to program is not just about learning a programming language. More importantly you need to learn some algorithms and data structures, and then become proficient with the development and build tools, learn the core libraries, some operating system concepts, and that’s just the basics. Once you get here it becomes much easier to learn other programming languages besides C++.
I figured he meant a complete graphics engine from scratch, not sure WHY I thought that mind you, but I did.
A good class on programming teaches you how to become proficient at programming. If I want to teach you something, I’m going to come up with a project for you that specifically targets an idea while minimizing superfluous stuff. This program is almost certainly not going to be useful in any way.
So assuming that your teacher is decently good at his job, your entire course will consist of making miniature programs that do very little more than print a few lines of text to a console.
A one semester course on programming, directed at non-programmers, and based around C++ isn’t going to teach a huge amount. I used to teach programming at university level , so I am pretty familiar with this. One semester is about long enough to get familiar with the main concepts of a typical imperitive language, like Pascal, Modula-2, C, C++, Java, Ada.
So, the usuals, basic types, syntax, control flow, iterration, recursion, simple IO, complex types, basic OO - inheritance, classes. That is a pretty full semester.
What is missing is how to use these. We typically taught a data structures and algorithms course after that. This course assumes you know how to program if we tell you what to write. I.e. if I say to write a program that uses a for loop to itterate over an array of integers, and add them up. You could write it. But that level of programming skill is really only the beginning. The next level of skills taught are typically a mix of sorting and searching and tree walking algorithms. This includes basic computational complexity analysis and some element of learnng how to problem solve with these algorithms. That is another pretty solid semester of work. It is also the most important single semester of work a programmer will ever study.
After that you can go on to learn more complex algorithm theory, i.e. graph algorithms (not to be confused with graphical algorithms) but also more specialised stuff, like computer graphics, real time and embedded programmng, data bases, more interesting programming paradigms, and so on.
Personally, and from annecdotes from colleges who have tried, teaching C++ as a first language is not a happy experience. There is so much noise in the language that you need to master to get even simple programs to run, that it distracts from the main game. So the course starts to bet bogged down in the systax ofthe language, and the many many rules, and loses sight of the real goal. But arguments about a suitable language will rage until the sun goes cold. Java is probably the least worst of the common ones.
My other complaint is that too many courses get distracted into OO theology far too early. C++ provides an almost infinite scope for such distraction.
My question to the OP is why is he taking a C++ course and what he is going to take next. I agree with ** Francis Vaughan** that to learn to program well you need classes on the concept after the first programming class. When I was in grad school we started people on Pascal as a way to focus on the basics. (The first C report from Bell Labs had just come out at the time.) I suspect after this class someone would be able to program, but not program well. If this is going to be the terminal CS class, I’d think a scripting language would be a lot more useful.
Very, very agreed. C++ is a brutally complicated language for beginners. There’s a whole host of very detailed rules you need to learn and follow just to keep even the most basic programs from causing your computer to burst into flames. The trick is that all C++ compilers will “accept” (often without so much as a warning) a vast number of very, very bad constructs that result in a program whose behavior is completely undefined by the C++ standard. Example: fail to explicitly define a virtual destructor for a polymorphic base class for which operator delete is ever called? Ding ding! The compiler could turn your program into an executable that causes demons to fly out of your nose, and this would be a perfectly valid result according to the standard.
That and a zillion other rules are waiting to make your life painful. Learning all these rules at the same time you’re trying to come to grips with basic programming concepts is hard. And if you don’t learn all these details early on in your C++ experience, they will come back and bite you in the ass later. Hard. That’s largely what makes it a not-so-good language for teaching to beginners.
This happens a lot with Java classes too; they jump in and start preaching class-based OOP within the first week or two as though there were hardly any other way to program. It hurts, I tells ye.
My other complaint with teaching OO paradigms early, is that it is vastly easier to teach them to a student who has a bit of graph theory and basic computer architecture under their belt. Then I find it is possible to cover most of the ideas in about an hour. But without these underpinings it takes ages, as students either just rote learn the rules, which is pointless, or they keep making really weird mental models of what is going on.
I find the only way I cope with the vagaries of C++ when coding some stuff is to keep a mental handle on what it is trying to do from such fundamentals. Otherwise one spends ages reaching for the language guides and getting more and more annoyed.
I also get pretty fed up with the zealots who think that OO is the be all and end all of programming. Typically they have never been exposed to anything else, and spend a huge amount of time trying to hammer a screw into a brick with it.
I agree that teaching OO languages in an introductory course is idiotic. And C++ is especially idiotic. A lot of computer science departments have this idea that they should teach using the latest technologies, and they produce graduates who maybe can write some semi-competent Java code, but have absolutely no clue about the fundamentals of programming. I had to work with a guy once who claimed a 3.8 GPA from a prestigious state university, yet didn’t know how pointers work. All his CS education was in Java. How do you teach a guy about a system’s data structures if he doesn’t understand pointers?
</rant>
Anyway, to echo the above, you’re not going to write useful programs in an Intro to Programming course. Probably nothing even worthy of showing anyone. The point of such a course is to learn very basic techniques: flow control, conditional branching, loops, functions, yada yada. Every program you write will most likely be an exercise in these basic techniques, while the actual problem being solved by the program is very trivial.
C++ is indeed a bit of an unusual choice for an introductory course, but there’s something to be said for it. Sure, it’s not the most modern language anymore, or the most popular choice for real-world software development today. But it is still a good contender for the most versatile language in the world, which means that you can use a single language to teach almost any kind of programming concept.
While it may not be the best tool for every job, you can use C++ for any kind of programming task, from regular application development to down-to-the-metal coding where performance is critical and the programmer needs to have bit-level control over the memory structures he’s manipulating. Of course, the latter concepts won’t come up in a “Programming 101” class, but if there are going to be followup classes then it makes sense to choose a language which can handle them all, instead of having the students learn another language for every next course. You can use C++ for graphical desktop applications, server-side batch processing, embedded development for mobile phones, web applications (although it’s not very popular for that), operating system kernels, and just about any other kind of programming you can think of. And yes, it is also a popular language in game development, although in practice it will of course be combined with other languages.
You can use C++ for classic imperative-style programming or for object oriented development. Yes, it’s a bit hairy, but that does force the student to understand how this stuff actually works at the CPU level, an understanding which is sadly lacking in too many programmers today. It has explicit pointers and memory allocation, knowledge of which is absolutely required for the student to grasp how a computer actually works beneath all the nice abstractions. It has templates, namespaces, recursion – once you know C++, you can just about any other programming language in a couple of days.
Basically, all of the important low-level concepts which are abstracted and hidden away in more modern languages, are right there at the surface in C++. When working with professional programmers in real-world software development, it’s always easy to distinguish the ones who have a C++ background from the ones who only ever learned Java or C#, because the latter tend to have a poor mental model of how their code gets translated to the machine level, which tends to hurt them when some low-level concept (such as integer overflow) pops its ugly head through the surface, which happens surprisingly often.
If I were teaching mathematics, I would demand that my students learn how to do arithmetic with pen and paper before they get to use a calculator. If I were teaching shop class, I would make sure that every student has to do at least one project with very basic woodworking tools, before I let them use the electric bandsaw or the computer-controlled milling machine. Along those same lines, there is something to be said for choosing a low-level language such as C++ when teaching a programming class.
I agree with that sentiment exactly, but would prefer to see C or even some variety of assembler used instead. I think OO stuff just adds an unnecessary layer of complication when teaching fundamental stuff.
It’s possible to just do an introduction course using just the C++/C intersection. That’s what I got at my C programming course. Of course, that course was called “C programming”. Definitely useful, but even then I don’t know that I’d recommend it as language to teach complete beginners. Still too much stuff that would get in the way of learning the basics of just programming/algorithms.
I’d think using a fairly straightfoward language that at least does memory management for you, has “automatic typing”, and does not force you to use OO all over the place would be a lot better. So, Python, or Scheme, something like that, depending on whether you want to emphasize imperative or functional styles.
Really? I found learning OOP made programming much easier. I mean I’m no expert and haven’t taken classes, but I program as a hobby and learning OOP made everything I do easier to conceptualize, faster to produce, and easier to debug. If I had to relearn everything I know about programming OOP would be the first thing I would want to look into. It certainly didn’t seem to add an unnecessary layer of complication. It made programming coincide with how I already thought of the concepts I was implementing.
I’ve heard the “OOP adds complexity” idea a lot. But to me it always seemed to do the exact opposite.
Yup, if you want to teach the basics, choose C, or Modula-2 or even Pascal. I wholeheatedly agree that teaching kids Java or C# only is going to consign them to the cannon fodder, hack programmer, end of the food chain. It is a serious problem.
Programmers can (and do) get taught C++ without ever seeing explicit memory allocation. They get taught all about classes, and never structs. Constructors and destructors, and never new and free. All the points cited for teaching C++ are the C parts that show through. The C++ dross layered over the top is the problem. The problem with C++ as an intorductory language is that you need to teach it about three times in order to cover everything. In that time you could have taught a lot more valuable stuff. No doubt C++ covers a lot of bases, but using it as the vehicle for teaching them is another matter.
There is a lot you can’t do in C++ as well. Not without essentially writing an interpreter in C++.
Often when C++ is used in difficult areas (embedded and OS for instance) only a very carefully selected subset of the language is used. Often little more than concrete classes and polymorphism. That makes it a pleasant enough low level language.