ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Originally posted by Tinkster What kind of projects/target apps is that?
We're programming acoustics data evaluation (about 270KB/s data stream from a towbody)
and have no performance issues using C++ on a P166 with 64Megs even using Motif & the
Xrt class libraries for visualisation.
I deal with graphics. And prefer C. I know that you can write fast progs in C++, but it requires more work than in C.
Quote:
And as for "full control" ... I rather type 3 lines to display
a window saying "Hello, world!" than 200 ... makes debugging/error-checking much easier.
Especially with polimorfism
Quote:
And if you link the external libraries statically you can gain some performance, too. I don't think
that a statement like "C++ is slow" is just :]
External libraries linked statically result in size, unforunatelly. Sometimes this does matter, too. There's balance needed there. And balance, as always, is hard.
The first language I actually became adept with was the BASIC-like stuff on the TI-82. So, I know where you are coming from.
What you learn next is up to you... Everyone has a favorite but that doesn't mean necessarily that these are good languages to learn with. So what I will do here is try and give the pro's and cons of starting with a couple, and you can decide which is best for you!
Now, first off, the difference between C and C++ is that C++ is "object oriented", which means that programming in C++ is completely different from programming in C. While a lot of the keywords you use might be the same, the way you program and the structure you use are light years apart.
So, the main choices you have are, IMO(in my opinion):
Structured-Object Oriented
1)C++
2)Objective C
3)Java
4)Python
Here are your first criteria -- why do you want to learn to program?
If you want to be able to do useful things and learn more about your computer, but aren't interested in persuing a career or anything in Comp Sci, choose from the first group. These are languages put together to get things done. If you want maximum output in a short time, learn these. If you want to make a website, learn HTML and JavaScript -- maybe even PHP. If you want to do cool things with Windows and Office programs, learn VB. If you're interested in administiring Windows, learn batch scripting -- for Unix or Linux learn shell scripting (basically they are lists of commands you enter at the text prompt). Under no circumstances should you ever learn Perl. Haha, actually Perl works like all of the above put together and is really cool, but is very difficult and cryptic to understand as a newbie.
The problem with this group is that learning these teaches BAD programming skills, if any at all. With these you don't create programs, just instructions for other programs. They are tools, basically, and should be used this way.
Now, if you have an academic interest in programming or really want to dedicate your life to being a top-notch programmer, you should start with the second group of languages. You won't be able to do anything productive for a long time, but they will give you the fundamentals to make REAL programs, and incredible systems. Everything worth programming should have been written in C! You can ask other people why, but trust me. Ada, which I learned on, was a great way to learn (and most government / defense / international critical systems are written in it), but no one likes it and finding help will be next to impossible. Pascal is very cool, and lots of people will really like you for starting with it (while most will just laugh).
My guess is, however, you want to be able to spin this programming experience into a marketable skill. If this is important for you, you have to learn OO (object-oriented) programming. I would suggest against C++, b/c it was made so that people WHO ALREADY KNOW C could write object oriented programs. Otherwise it is difficult to crack. If you want to start off and be able to write good OO programs and learn C at the same time, choose Object C -- it is much more intuitive and just as powerful (if not as widespread). Java is the best to learn if you are currently in debt and need to get a job now ! It is incompareably useful today, and not THAT hard to learn if:
1)you get a good book
2)you have access to someone who can answer questions
Otherwise it can be totally confusing, especially as a first language.
Finally there is Python, which is touted as being (and I believe so too) THE BEST way to learn to program. Go to O'Rielly's website to find great books on learning to program by using Python. It is wonderful. The problem with it is it hasn't cracked the business world so much yet, has a comparatively (with Java, C and C++) small following, and can be difficult to get running as a newbie (although Java can be as well).
There is really so much more to it, but I hope that helps!
My question is, how many of you who voted are actually well-versed in all of the choices available? That would be a more telling poll, I think. Sure, any bum can say "hmm, I learned C first and I think I'm doing okay with it, so I'll vote C", but that doesn't mean that they have an informed opinion on which is better to start with. Of all the ones on here, Python is actually the one I learned last, but if I had started with it first I feel I'd be a much better programmer than I am today simply because I would have been able to learn useful things (i.e. concepts, etc.) faster instead of fighting with much less useful things like syntax and compiler/build particulars.
Unfortunately, you can't restrict polls to "only people who have used all these languages" And even if you ask nicely for only those people who are to vote in the poll, people won't follow the directions anyway.
Yes I voted python as well. I have tried C++ and Java but found them difficult to learn, too much to learn in order to use the language effectively. However python is relatively easy to learn, is OO, and has some neat features and a good standardised library. It has been reported that development times in python can be 1/3 that of C++.
I first started progrmming with VB6 which was dead easy to learn and quick to build simple programs then i was taught
Java and have never regretted it.whilst possibly more challenging than VB the power that it affords is addictive. tried my hand at C++ but Java just seemed easier (in java you don't have to worry about the pointers and references Java does all that for you so thers less to learn). plus server apps can be created easily in Java too.
I vote you start with a language that first teaches you the logic of programming, i.e. how to structure your programs, when to write a sub-procedure etc. then give Java a try. if u ever get stuck with java just give a shout there's tons of people who'll be able to help
In my opinion, Python is a good language to start. Syntax is quite intuitive and the indentation of the scripts, which is the only way to separate blocks of instructions, makes the code more readable (good for debugging). I've studied in a engineer school where Python was the first programming language introduced.
Don't forget that learning algorithmic is more important than the language you will study.
the first language i learned was pascal back in high school. i always thought pascal was really easy. then i did c++. c++ is really fun and powerful. then the next thing i did was perl because my job required it. perl is pretty cool too. then i started working on this big mysql driven website for the radio station i work at and i learned php.
i say just go where things take you. forget pascal and all those "intro" languages. if you look on them as "intro" languages thats how you are going to treat htem. just start with what you want. c++ doesn't take any prevoius knowledge to start to learn it. if you can grasp programming concepts in general, regardless of language, you can do any language. thats how it is.
and once you learn a language all the others are significantly easier to learn. its like an instrument.
i would say start with a language has true OO capabilities. The reason i say this is because once u learn to program OO, you know OO and procedural and learning other languages becomes a matter of syntax and library routines. If you start out with C for instance, you still wont know jack about OO design which (to me) is a VERY importan programming thing to know to be a very effective programmer (overall that is).
so, Java, C++, Python or any of those other OO lanuges.
i'm tempted to leave C++ off because it isnt a true OO language (that's what i was taught).
I started with C, then C++, Perl, JAVA and then Python. Now, with a considerable amount of knowledge of these 5, i think any beginner should go for Perl first. It is easy and you don't have to do lot of low-level stuff like malloc() etc etc of C. But the problem I face is, once you get good at Perl, you just don't want to migrate to any other language . Why write int, char, double when perl does a neat work of handling data types accordingly. Python is good but lack of braces { } makes it difficult at first. so, my list is much similar to that of Eric S. Raymond
1. Perl
2. Python
3. C/C++
4. Java
then you can go for LISP. You can also try bash scripting along with Perl.
Originally posted by vanquisher i think any beginner should go for Perl first.
I don't think any programmer should ever learn perl unless absolutely necessary (read: never)
Quote:
Python is good but lack of braces { } makes it difficult at first.
Yes, because braces are such a natural thing and whitespace formatting is not. Oh wait, whitespace formatting is far more telling from a visual perspective.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.