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.
I'm 15 and I'm fairly certain that I want a job in computer sciences, so I've decided to learn to program. At my school they offer programming classes. But before they teach you C/C++ you have to take 2 years of Qbasic and then Visual Basic. Well I'm no fool, and I have no interest in learning these "useless" (atleast in my mind) languages. So I'm going to teach myself. But what language should I start off with? After doing many a google search, and bothering numerous people on IRC I've narrowed it down to either Python or SmallTalk. Which of these languages would allow to jump right into C/C++ and Java. Thanks in advance!
I suggest first searching for the older list, there should be already several detailed and overall debate (I remember there is a pretty similar post early this week).
Hmm, I started with Turbo Pascal and I think it's a good way to start.
The compilers are newbie friendly because it checks many errors whereas C usually thinks that the programmer knows what he's doing. As you wanna learn programming this is most often not the case.
TP is no program language that is used very widely in the industry but it teaches you some strict standards and helps you understanding what can be done and what not.
Firstly, you need to determine what you want to do.. if learning C or C++ (they are very diffferent languages, just as C is different from java), or java is your goal, why learn something else first? You're going to have to learn syntax and structure of any language you learn, plus the method/function calls, so why not just start where you want to start?
Though, I will give you my opinions on learing perl/python (I don't know smalltalk) as opposed to learning C/C++/Java.
Perl/python (from here on out known as PP ::smile:: ) has the distinct advantage of being able to easily and quickly jump right in and do quite a bit with a fairly insignificant time expenditure. The BIGGEST advantage is the memory management features. When defining/using variables in PP, you have very little to do with how memory is allocated, and making sure that memory is released.. this is the major drawback to C (which, btw, happens to be my favorite language, with perl coming in close second). But, C/C++ are faster on execution and such, because they are not interpreted. Just in case you aren't familiar with the difference (not trying to insult your intelligence, just to make it clearer), compiled languages like C and C++ create an executable that requires no further compilation, aside from (I don't know the precise method of execution) executing the binary. PP are interpreted, which means that there is no need for compilation, the source code (or script) is the executable, which is run through an interpreter every time the code is executed.. this can have substantial processing delays, depending on how the code is written, and what libraries/packages are used in the code.
Java is a little different because it's both compiled and interpreted. Java source code is compiled into bytecode, which can run on any platform with a supporting interpreter. This bytecode makes the execution of the code a little faster than PP, but not as quick as a compiled app, like from C or C++.
Anyway, here's my further opinions on each of the languages I've mentioned thusfar:
-----------------------
DISCLAIMER
The following remarks are based on my personal experience with each of the languages, and my thoughts/views on what I experienced. Some things may be wrong, some things may be right, some may be skewed, the only thing I can guarantee is that they are my opinions. If you disagree with me, that's fine, but THIS IS NOT A FLAMEWAR!!!! If you disagree, be civil.
---------------------
perl - Interpreted - My second favorite language. Very easy to code, very difficult to read code, because of the abbreviated nature of symbols and variable references. Was initially designed for linear execution, but has OOP ability, though it can be pretty ugly at times. I like the flexibility of this language, but as I said, it's difficult to read. Code will take tweaking to run on multiple platforms, though it's pretty good for this.
python - Interpreted - I'm not an expert with python, but I can get around good enough. Most people say it's better than perl, but I've yet to see a good argument for this. The people who like it generally tend to say "no brackets for code blocks!" which I don't really care for, but to each their own. Python code is pretty easy to read and write, but I don't hold their OOP any higher than I do perl's (flamers, please remember, this is my opinion), though I *believe* it was designed as an OOP langauge. I don't know how a script will work across platforms, I have no experience with this.
C - Compiled - My favorite language, but takes a lot of coding to do a little bit of work. Speed of executable the biggest plus here. Very non-OOP. Memory management takes alot of code time. Pointers are tough to grasp, but very powerful. Lots of C support around, because it's the most widely used compiled language (linux was written in C). Cross-platform coding can be hairy at times.
C++ - Compiled - I personally find C++ intolerable. To me, it's trying to force OOP into a non-OOP language. There are alot of people who like it, but not me. (= As for the language, the syntax is familiar to anyone with a C background. The OOP, though, is pretty powerful, though adds additional overhead to the executable. Memory management has been loosened up. Object creation tends to be overly complex (IMHO). Definitely good if you're looking for a fast binary with an OOP language, though. Cross-platform ability similar to C, from my experience.
java - compiled/interpreted - Now this is what C++ should have done for implementing OOP. Very solid language, though very verbose. OOP is finely tuned and easy to understand, with learning curve (as any language has). The verbosity causes the coder to spend alot of time coding, but it very easy to read. Very nicely structured language. memory management good. Very flexible and powerful classes available. -- The bytecode is S-L-O-W. Don't let anyone tell you that java bytecode runs almost as fast as a C or C++ program, it's just not true. If you've got a fast, powerful machine, this won't be too much of an issue, though. Bytecode, though, should run on pretty much any platform with a java interpreter. Another plus is the ability to write java applets, if web-based coding is your thing.
As for smalltalk or any other language, I don't know them...
I hope this helps!
Oh, and btw, this topic of discussion comes up about every week, so if you'll do some searching, you'll find lots of debate (some heated) on the topic.
And in conclusion, I'd like to say to you:
1. Pick a language you feel comfortable with. If you don't have one, try one, spending a week on something to see what you think won't hurt.
2. It is important to choose something with enough support to make it enjoyable. Obscure languages may give you a sense of pride, but a language is only as good as the support. (MHO)
3. Don't let someone else tell you that your favorite language is old, passe, boring, or a waste of time. If you like it, you will be more productive..
4. IMHO, it's better to really spend the time to get to know a language than to jump around quickly. I've heard it said that it takes 2 years to really get to know a language, and I agree. I've been coding in C for 10 years, perl for 3, and I still learn things in both.
5. Have fun with it! Coding is great fun and very satisfactory to see the results of your efforts!
6. Never be afraid to ask questions, no matter how dumb they seem. EVERYONE who codes has been there, and will help you out.
Every time I see one of these "which language" or "how do I learn to program" threads I want to direct people to this paper but I never get around to it. Anyway the more I think about it the more see that this paper offers a lot of good advice on the subject, so here is the link.
If you just have to start with some language before trying C/C++ or Java, then Python is probably the better choice. It's a young language with clear syntax that is very easy to learn. SmallTalk, while still in use, would be much more enjoyable to learn from a historical perspective (being the first OOP language).
Like has already been stated, it depends on what you want to do in the end, since each language his its strengths and weaknesses. If you really want to get to C/C++, then just go ahead and start with it. While it's "hard" language, it's not THAT hard to start working with it.
Also, there is nothing bad about VB, it's actually a fairly popular language, and i know a lot of people who use it often. Check out Perl ofcourse if you want to do more internet scripting.
Quick question: how/where do I find Python in my Redhat 8 distro (with pretty much all development stuff installed)
or do I have to download it and install?
No problem. (= Usually when a this topic comes up, there are so many people posting their preferences (which I sorta did), I wanted to try and give a clearer picture of the languages of which I am familiar.
IMHO:
for compiled languages:
C is completely perfect. There is nothing i have seen IMO that is an improvement in any way over C (no i dont consider OO an improvement). i would just do C.
im not much of an interpreted language person but i think python would get you started.
IMHO:
for compiled languages:
C is completely perfect. There is nothing i have seen IMO that is an improvement in any way over C (no i dont consider OO an improvement). i would just do C.
What about LISP, Objective Caml or Haskell? They're all compiled and loads nicer than C (and the first two are comparable in speed, as well). I do like C, but I think it's no longer a good language for applications (as opposed to kernels, say) because it lacks high level features.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.