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.
View Poll Results: Best Beginning programing lanquage?
Everyone is recommending their favourite language, but no-one is stopping to ask what you intend to do with whatever language you learn. The answer to that will make a huge difference to the direction you should take.
If this is just a stepping stone to learning programming in general, and other languages will follow, then you should start with something which is relatively simple, and has plenty of tutorial resources. I hesitate to recommend VB, but it does fulfil those criteria. Another option would be Pascal, as it is a traditional teaching language, though it is somewhat neglected these days. PHP is also good for learning, and I'd also suggest you look into Javascript, especially since you're starting from a position of knowing HTML. But really if you're learning general programming techniques, then pretty much any language will do the trick as long as you've got suitable source materials to learn from.
If you want to write script programs that run on the command line, then any of Perl, Python, Ruby, or a bunch of others would be good starting points.
If your aim is to start writing GUI programs to run on the desktop, I'd start off by saying you need to keep your expectations low, at least to start with, as it will be a long learning curve. You can produce quick results with WYSIWYG window designers like VB, but you won't produce a good program for a while. And VB in particular tends to encourage sloppy and lazy programming techniques. QT Designer has a good WYSIWYG designer; it's not as easy to use as VB's, but in the right hands it can produce good results. It is based on C++, which isn't the easiest place to start, but if you follow their examples, you should be able to make good progress with learning it.
If you're aiming to learn web programming, you absolutely have to learn Javascript, because that's where all the on-screen magic happens. You'll also want to get to grips with CSS; it's not a programming language per-se, but it is an important part of the whole web front-end experience. Then you'll need a back-end language: I'd recommend PHP, but you might be tempted by the dark side of the force, and try ASP.NET.
Readability is important, but if readability is the utmost important factor, then I'd have to suggest COBOL.
You want code to be readable, then it's up to you to document it and space it properly. I've been told that my C++ code is the easiest to read by several different people. Fact of the matter is that using a language like C++, you have to MAKE your code readable, whereas COBOL it is difficult to not make it readable.
*flips his pennies on the table*
I found it possible to write COBOL code that's nearly identical to 'human speak' but I don't see a reason to recommend it as a starting language.
Getting into programming imho requires climbing levels and you shouldn't attempt to go to the next level without mastering the previous. If you look at most books about a language they'll start with control of flow, variable assignment and manipulation, then strings, arrays, basic IO, then functions/procedures, error handling, etc. They don't start with OOP.
Learning programming is learning to analyse and think and re-think. Someone suggested UML in this thread and I think that's a really good suggestion because you can visualize your thinking.
I also like to emphasize 'good' programming habits and use them from the start. Descriptive variable/function/object names, indentation, logical program flow, input checking, error handling, commenting, coding standards, etc. you know the drill, you probably agree it's useful and now only have the discipline to actually do it...
With a solid base in programming fundamentals you can master every language and concept, regardless whether it's web, database, Windows, low level, shellscript or OO programming. I'm not too familiar with the latest & greatest so I won't recommend a single language. I'm usually more concerned with setting up a nice development environment than with choosing a language (that's generally done by the company I've to work for).
i think if you want to be a programmer, the fundamentals are important. that's why i think that a language like C is the best to start with. it forces you to write semantically correct code, to explicitly define all of your functions and variables, and is very, very powerful (why is almost everything written in c/c++?!). You also learn a great deal about how a computer works, using pointers and simple data structures, and can be transformed into OO once you get comfortable with programming.
I think that PHP/Perl are great scripting languages, easy to write, easy to debug, fairly easy to read. but the fact that you do not have to explicitly define all (or any) variables, it sometimes can be a chore to debug, and you gain no understanding of what is going on in the program, if you don't know a core language.
I also believe that assembly language, in some form, is very necessary if you want to be a serious programmer, or engineer. you learn what the actual cpu does, how to make things efficient, and learning assembly will help you create better programs in the higher-level languages. This is a TERRIBLE language to start with, however, in that if you don't know the basics of programming (program flow, decision making, data typing), it will be very difficult to get anything working.
I vote for BASIC, because it was the first language I learned, and it was quite easy to learn. Now, it's not particularly useful for doing too much ... mostly for making some quick programs on my graphing calculator while listening to boring lectures.
Somehow, I cannot recommend C or C++ to a beginner programmer. Try those as intermediate or better. These also take many years to become proficient in and decades to master ... if ever.
Python seems to also be a good choice, because it's also quite easy to learn, and the syntax is usually quite readable, and if it isn't then you're not doing it right. You can also make useful and relatively powerful programs quickly and number of bugs is usually low. (performance is another thing and unimportant in this case)
I can't recommend too many others, because I don't know that many. (I also know bash, but it's mostly for scripting and system administration ... useful, but not sure if is appropriate for a beginner, because it's not quite a complete language ... is it ?)
Last edited by H_TeXMeX_H; 07-01-2007 at 11:23 PM.
You know what i think, i think this thread or poll should stop.
@OP, the only way to know which is good beginner language for you is to study them one by one and choose one that suits you and your programming tasks at hand
Last edited by ghostdog74; 07-02-2007 at 01:37 AM.
You know what i think, i think this thread or poll should stop.
@OP, the only way to know which is good beginner language for you is to study them one by one and choose one that suits you and your programming tasks at hand
Actually, that's what I'm currently doing. I'm looking for a programming language that meets my needs ... and I'm still looking, and I'm might be looking for quite some time. But, I think 'a programming language that meets your needs' is very different from 'a programming language that is easy to learn', IMO.
Just to comment on airswit's post, I believe what he says about declarations in PHP is true, but in Perl you can (and should) use the cmd
use strict;
at the start of the actual code. This forces you to declare variables.
In addition, either use the -w switch eg
#!/usr/bin/perl -w
or use the equiv cmd
use warnings;
after the 'use strict;'
These will greatly help debugging. In fact you can compile a Perl prog without running it like this:
perl -wc file.pl
Thirdly (hah) you can add
use diagnostics;
to get longer error msgs.
Of course, if you go with another lang, ignore this post
One more thing I'd like to add is that C is indeed a very worthy language, very powerful, useful, fast. I wonder if it's possible to teach it to beginners easily. If so, then you'll certainly get your money's worth. If you feel up to the challenge, it's very much worth it. Just beware that it may not be easy ... don't give up ... it will make sense ...
First programming language I attempted to learn was C++ and stopped after I got to the if and else stuff. When I wanted to learn again I started with C and found it better for some reason then C++ but I have yet to move onto other languages other then looking at python and didn't like what I saw.
I started computer programming with BASIC, and apart from a slight tendency to put line numbers in front of everything and a homicidal aversion to GOTO, I've experienced no ill effects.
But I wouldn't recommend it as a beginners language, hell I wouldn't recommend it at all, go for something like Python.
Then, when you feel you want something more advanced, go for C or C++.
(IIRC, the computer industry (especially for games) use C and C++.)
Actually, Perl is easy to learn I'd say if you get the Llama book.
It's a little different to some languages, but very powerful, widely used and prob avail on more OSes than everything except C.
See my prev comment re being strict with declarations though.
(It's my main lang at work)
Here's the 'all you ever wanted to know' link: http://perldoc.perl.org/
As per top left menu there, go through Overview, Tutorials (some), FAQs and away you go.
there's loads of examples
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.