So, I know both Java and Objective-C quite well, but (perhaps strangely) never really learned C++. Obviously, the languages are all related, but there are syntactical differences that I don't fully understand. Is there a nice document that describes the basics of C++, but still assumes the learner knows a programming language? Perhaps even a tutorial that aims to describe the differences between the languages. This is what I'm looking for.
Also, is there a good tutorial on how to use C++ code inside a Mac or iOS app? The reason I feel the need to learn C++ is I'm trying to port a C++ program, and I heard you can use C++ code and just wrap it in an Obj-C GUI. Could someone point me to some documentation/tutorials on how to do this?
Thanks!
Even though the languages of this family are all related, that does not mean that you can casually move from one to the other and expect to write beautiful code. You have to learn the language's idioms and idiosyncrasies, and experience its strengths and way of thinking.
I would recommend reading Stroustrup's original book (a modern edition, of course). It's the most definitive reference (short of the actual standard) and it is very clearly written. The benefit of this approach is that you will be taught to think "how would I do this in C++", rather than "how do I transliterate this piece of Java code to make it compile". (Also this approach does away with any risk you might have of thinking you should "learn C first". Don't.)
On MacOSX, either download and build the free GCC, or get XCode (which comes with GCC). For iOS I don't know, I have a suspicion that you cannot deploy native code on it.
I would go for a pure C++ route, the quality of the material being the guide rather than finding ObjC+Java->C++ material.
At the university I am working for we have tried both ways for teaching C++ to students with a lot of programming experience, in particular Java experience, for obvious reasons.
The conclusion was that the specialized course did no better in teaching C++ than the generic one with some extra exercise materials. It's the quality of the teaching materials that matters.
Edit: You will probably receive a lot of good answers on the actual differences, also Voo's comment on your question is relevant.
I know what you feel - to have already worked on a couple of languages and learning C++. I was in the same boat too. While I was thinking for a while that it should be easy for me to learn it right away, it wasn't all that easy. So then I went back to the basics and started as a fresher to learn C++. 'C++ Primer' is an extremely good book to start with. Since you know most of the basics of programming, some of the first few chapters can be skimmed through. Once you are through with this, I'd recommend 'Effective C++' book and the C++ FAQs maintained here [http://www.parashift.com/c++-faq-lite/].
In fact, you could go through this FAQ first and see how much of it makes sense, and use that as a guide for figuring out where to do a deep dive.
HTH, K
I need to make a presentation for beginners about the Clojure language. What are your suggestions on selecting topics on it? What are the points I need to include?
Note: By beginners, I mean that they are experienced in other programming paradigms, but not in the functional programming model.
I personally think this presentation is a great introduction to Clojure:
Clojure:Functional Concurrency for the JVM - Howard M. Lewis Ship
And obviously any presentation by Rich Hickey himself, for example
Clojure: A dynamic programming language for the JVM
You've got to think about your target audience. I'm going to make an assumption that they probably know Java.
The best authority on Clojure is the source himself, Rich Hickey. He's written an introduction to Clojure for Java Programmers.
Slides are here.
Him giving the presentation with audio is here and part2 is here.
If need, you can take my presentation about Clojure - PDF is freely available...
I found this blog entry yesterday -- impressive how easy is to make Clojure programs parallel (pmap in place of map :D ). Sadly, on my PC it didn't run on multiple cores but I haven't investigated it yet.
Use examples from books like Joy of Clojure -- they are very idiomatic and well designed. In this book there are also reasons on design of language and -- what is most important to you -- why functions+immutability is better for multithreaded programming than procedures+OO mutability.
Yes, I think parallelism is important to tell. But also -- in my opinion -- it is always crucial to convince non-lisp-listeners that The Parentheses Hell is not a hell but blessing ;) Tell about Beating the Averages and why Lisps are the most powerful languages in the world.
Try not to teach them a language but show why to learn it.
Oh, and prepare that someone in the audience will ask "why no for loop" or "why no constants" or "how come immutability doesn't lead to performance problems".
I would demonstrate the basics of the language by firing up a REPL and running through a bunch of basic language features, slowly building up to something more interesting.
This Clojure quick tutorial gist may give you some ideas.
Should I learn Java first and then pick up actionscript latter (to build flash apps)? I guess I am asking if Java is a "real" language that will be a great base, and is actionscript more of a closed language within flash only.
I have played a little with each, but lately I have been putting all my time into Java.
Thanks!
Java is a great language to learn, and I highly recommend it, but since ActionScript is based on ECMAScript, its syntax is about all they have in common. They're really totally different languages, and you use them in very different ways.
One of the biggest differences is that ECMAScript uses prototypal inheritance. Java was my first language, and I had to spend a week or two to learn how to effectively leverage the unique features in ECMAScript-based languages instead of trying to do things the same way I would in Java.
That being said, I have always found that the more I learn about other languages and paradigms, the better my code is in all languages!
If you want to learn ActionScript, learn ActionScript.
If you want to learn Java, learn Java.
If you want to learn Java and ActionScript, learn Java and ActionScript.
One is not a prerequisite to the other. Both are handy to know.
It will definitely be easier. Why learn java then actionscript rather than just actionscript?
Kinda like learning to drive a stick before you learn to drive an automatic.
They are both object oriented and actionscript is a lot easier than Java
I have a lot of experience with Java/OO. There are tons of C++ tutorials/references out there, but I was wondering if there are a few key ones that a Java programmer might find useful when making the transition.
I will be moving from server-side J2EE to Windows Visual C++ desktop programming.
I have googled and found tons of resources, but am overwhelmed and don't know where to best spend my time. I have only a few days to get a good start.
Is Visual Studio Express / Microsoft Visual C++ the best IDE for me to start with?
Also, any words of wisdom from others who know and work with both languages?
The widely recommended books here are Scott Meyers Effective series. "Effective C++", "More Effective C++" and "Effective STL".
I would also recommend the C++ FAQ Lite and The C++ Programming Language.
I have been in these shoes before and I constantly find myself referring to two sources:
The first is C plus plus reference
Here you will find the basic standard C and C++ libraries that you will always need. They are the bread and butter.
The second is Microsoft's Visual Studio Development Center.
Here you'll find the linker error support for Visual Studio and their built in libraries.
Don't forget to give Visual Assist a try! Quite often intellisense breaks in VS2005 if your doing some serious business, though I can't speak for newer versions.
Good luck!
Visual C++ is a good way to go, you can get the express version for free from here
As far as books It really depends what you want to do. I like the Horton book as far as learning Visual C++, GUI, CLR and Database programming. The Lippman book is a very good tutorial on C++, but it only covers the basic language, which is large.
This will get you going with basic
constructs.(Lippman)
This will get you going with Visual
C++.(Horton)
Once you get past the basics then look at the Meyers books, as stated in other answers.
Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)
There are a couple of others from this author, they are real good but have not been updated in a long time.
A real good online C++ FAQ is here.
If you put a comment stating what you plan to do with C++, we could give you narrower guidance to point you in the direction you want to go in
If to choose only one book for high-quality development - Scott Meyers "Effective C++". Because there are some quirks in C++, and you will definitely hit them without this (or few similar) book. Also reading it is a pleasure (hence you can read it fast), because of a mix of humor and easy to understand insightful points.
But it's not a tutorial though.
I haven't ever tried "fast" tutorial, but here is pretty good looking tutorial. I think it's perfect for experienced programmer - short articles explaining distinct language features with some examples and comments
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Like most people, I learnt C++ after C. I learnt C++ because it was one of those languages which fetched jobs. I am still studying (doing masters) though. One of my cousins has been working as a developer for around 12 years.
He advises me to learn Java so that I can land up in a good job. He says only few sectors like tele communications use C++ and almost all the enterprise software is developed in Java. I am working as a student technician in my university. The job involves Windows programming in C++. I learnt core Java. I do not know any of those Struts, Hibernate or whatever is out there.
To be on the safer side, I am planning to master both. But I think Java is an ocean, though it's easier to program in Java than C++ (this is my opinion. C++ lovers don't kill me).
What do you geeks and professionals out there advise me. Do you think I should learn both of them. Which sectors of the software industry use C++?
Best advice I ever got as an undergraduate was from my languages professor, who told me (paraphrasing here): "Don't memorize languages; don't marry yourself to a language. They're just tools. They all do the same basic things. Instead of learning a specific language, learn the foundations of good software development. Then you'll be able to take any language and be successful with it."
I feared learning new languages before he told me that. Afterwords, I took his advice to heart and it's made all the difference. Languages are just tools in your toolbox. If you can program and write good software in one language, you can do it in another.
C++ is still used extensively for performance intensive tasks. For example, I do a lot of work with video compression and decompression - it's all C++. Partly because we need the performance, and partly because all the 3rd party libraries which need to use are C++ so it's easier to integrate with them if we're using the same language.
A brief off-the-top-of-my-head listing of projects that use C++:
Device driver development
Games
Advanced engines (audio, image processing, etc)
Telecom
Embedded software (devices and such)
C++ is not even close to being dead.
My experience:
Bloomberg, Reuters, and all their bank/trading clients who want low latency market data feeds use C++. (Fidelity, JPMorgan, BNP, Citibank, etc.)
The defense industry uses C++. (among other languages - Java is also popular)
These industries also use java and other languages, but C++ is hard to beat. Note also that there is a HUGE existing C++ code base that will take a long time to go away (if ever)
It is not hard to know and use them both. Don't worry too much about a particular language. That is not the real crux of developing software.
Some site calling itself Google reckons it uses C++ extensively. Thank God they don't need performance to index the few websites out there.
If this Interweb thingy takes off, they'll be in real trouble though. (-:
Seriously though, apart from the current change of channel (reversion?) to C and Perl, the previous four projects were all C++.
a large scale departure control system for several of the world's major airlines (30,000 10MB log files per day)
a flight training simulator and ground based software proving platform for a new military aircraft
a large scale framework for an existing air-traffic control simulator that was used to incorporate the new Aeronautical Telecommunications Network (ATN)
an advanced radar processing and display system for an on-route air traffic control centre
All really interesing.
Video games still use C++. One example that comes to mind is the Torque engine which can be used for iphone and xbox game development.
C++ is not anywhere close to being dead, and as suggested by others, don't marry yourself to a language.
If you're learning C++ in terms of job prospects, I'd rather suggest you pick up a representative of a programming paradigm.
C - Imperative programming
C++/Java/Obj-C - OOP
Lisp/Haskell/Scheme - Functional Programming
Getting adjusted to the paradigms is usually harder than picking up the language itself. Hope others would chime in for other suggestions.
Many defense contractors, especially when dealing with hardware, use C++
Many makers of advanced medical equipment (e.g., MRIs) use C++.
I say learn both if you can. It's good to have the C++ foundation even if you end up in a sandboxed language like C++/C#. Too many people don't understand the basics.
Note that different cities have a majority of jobs in a specific language. Go to the craigslist job boards for the city you think you'd end up in and see what they seek. For example, Pittsburgh is a C# town whereas New York is more balanced.
C++ is still used extensively in engineering applications, such as high-end CAD/CAM systems.
I think the death of native code is much exaggerated. Even Microsoft has backed away from making C++ all about .NET in Visual Studio 2008. It seems to be actively improving its native C++ development tools again as well as making interop with the managed world more easy.
My advice, learn C#. These days almost 50% of the job listings were Java and almost the other 50% were C#, there were only a few listing C++.
That said, the people using C++ know why they are using it and probably have good use cases for it... meaning you would really learn how to use the language at the highest levels... meanwhile companies slogging out business logic applications in Java/C# will probably not teach you as much about programming as quickly.
If you do decide to take a C++ job, make sure the shop uses the STL effectively and that they are using Boost. Not looking at using Boost/STL, but actually using it.
Keywords: Banking (financial institutions), games
Oh, and also particle physicists and other scientists using the (in)famous ROOT framework.
And check out this list of C++ based applications.
Bjarne Stroustrup has a list of companies/applications written in C++.
Your university didn't have any Java based courses? That's odd!!
You should learn not just C++ and Java, but should be exposed to several languages and paradigms
I tend to agree with your cousin. Java definitely is used in more enterprise applications (think things that a bank or insurance company would need), while C++ is used in more "niche" markets. I also agree with you that Java is easier to learn and master than C++. No shame or offense in admitting that.
We use both where I work, writing embedded software in C++, but communicating with it from GUI apps written in Java. There's definitely plenty of room in the software industry for both (and many more) languages.
Most packaged software is still written in C++. That means games, office applications, graphics and video editors, and operating systems. In fact, if you think of the software you use every day that isn't online, chances are it is written in C++ (or C or objective-C). It's not written in Java, Python, Ruby, Perl, etc. While packaged software is becoming less prevalent, it's still used a whole lot and isn't going away anytime soon.
Operating systems, whether embedded or for the desktop are almost exclusively written in some C language. Attempts have been made to write them in Java or C#, but none of those have worked out. All of your drivers are written in some C variant as well. I don't see this changing any time soon.
Java is great until you have to start caring about the details it abstracts away. Most people don't need to do that.
My advice is to master whichever language you enjoy more. I know C++ and Java well, and have used both professionally. However, I would never accept another C++ job because I find C++ tedious and mind-numbing. I rather invest my time mastering more interesting languages.
I've been writing in C++ primarily for internal and external desktop applications within manufacturing and telecom companies for a long time, and only worked full time with Java for about 1 year out of 16.
Java never seemed to take over the desktop like they were predicting back in the mid 90s when it first came out, and now C++ seems to have more competition from .net and AJAX/web applications.
I can't really speak for it's use in back end systems, but I have seen more of it there than I've seen C++, so it depends of what kind of programming you are talking about (e.g. user facing vs. internal systems).
Well I suggest learning more than a couple languages. I work in the communications industry and yes we use C++, however a lot of projects we are working on are in Java as well.
I suggest you learn:
1) C++ / C
2) Java
3) Erlang or Haskel
4) Ruby
This will help you understand concepts that exist in one language but not in another. Also helps with marketability.
Take a look at the tiobe programming index and you will get a feel for languages on the rise.
C++ is heavily used in embedded systems.
It is being used in UI development. For eg. famous QT framework is written in C++.
Ultimately it depends on what you want to do. If you want to work in embedded systems, better learn C/C++.
I use C and C++ regularly at my job where I work on embedded devices. We're not talking super low level stuff, here, either. I do mid-level and UI work. Think Qt, Gtk+, Windows Mobile SDK, etc.
C++ is heavily used by ISVs. Think Microsoft, Adobe, Oracle, Sun, Symantec...
Game industry looks like go with C++ forever.
I had to scroll all the way to the bottom to finally see a post mentioning video games. C and C++ are huge in that industry.
As far as the "What should I learn question." That's pretty open ended, you want to learn as much as possible. So yes, you should learn both of them. As a few people have said, C# is a good one too. You should also learn Python, Ruby, or PHP and some web frameworks (Rails, Symfony, Django, ASP.Net). Web apps are pretty big these days.
If your bubble consists of only C++ you aren't going to be very marketable.
EDIT: Oops, I guess games were mentioned a lot more than I initially saw in here. My bad.
In my career I've developed C++ for:
Server applications (Securities industry)
Embedded software (Wireless telecoms)
Desktop application software (Wireless telecoms)
I've also seen a lot of adverts for C++ developers in the defense industry. There is work out there for C++ developers, not as much as there has been in the past, but still plenty of work.
Though I say it wouldn't hurt to learn Java, it is a good skill to have under your belt.