ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
what is the easiest/less confusing language to learn? i know you cant tell me whats easiest for me to learn but im trying to get ideas on what is a good beginners lang. i started with C but its starting to confuse me a bit with different ways of getting the same output so any ideas on beginners lang. please advise thank you.
I am kind of slow(when it comes to programming), but am able to write a simple python app. It is such a high level language it is easy to learn. It is very satisfying to make a useful program with minimal lines of code. You can hack a usefull script with hardly any effort. their are great tool kits that make writing a gui app fairly easy.
I'm a firm believer in "the best tool for the job" ... I think it makes sense to start out with a project you'd like to do, and then choose the best language for that project. It might be bash, PHP or Perl, it might be C, C++ or Python.
Having said that ... if you were to just "take a class" somewhere ...
I think Java is probably a best "first language". Java is to object oriented programming what Pascal was to structured programming: a "good way to learn good programming habits".
In contrast, I honestly believe C++ is a really, really bad choice for a "first language". There's simply too much you have to know all at once to use C++ effectively, it's just too easy to pick up poor habits.
I'm not saying C++ is a poor language, but I do feel it's too easy to misuse ... and not even be aware you're misusing it. I honestly feel it's much easier for a beginner to "do the right thing" in Java ... and virtually impossible for that same beginner in C++.
IMHO .. PSM
I totally agree with shanenin about Python being a great choice. Depending on the specific project you had in mind, 'C' could be an equally good choice. and of course you already know my opinion about Java ;-)
Depends on what kind of programs you want to write:
device drivers, low-level libraries, games that require every cycle: C or C++
everything else: Perl. ;)
> what is the easiest/less confusing language to learn?
Try a number of languages (ex. Perl, Python, Ruby, Java) -- spend a few days with each one learning the basics and reading about what folks have to say about it. Some languages have a different "feel" to them than others, and so appeal to different sorts of folks. I've never tried Haskell, Scheme, Lisp, or OCaml, but I've heard their names bandied about -- you may want to look into them also. Dunno. There's some links at the FSF directory http://directory.fsf.org/devel/prog/ that might be helpful.
My vote is for Python. PHP may be a good choice as well. Plus, if you learn php, you can use it for web programming too.
Python and java were my first languages. I love Python, Java is not bad, but extremely wordy.
For example if I want to print to the console:
print "Hello World"
echo "Hello World";
Not too bad in any of them. Now I want to capture keyboard input from the console
in = raw_input(prompt)
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
I'm actually not sure how to do this in php. I've never tried.
But I hope I've made my point for Python vs. Java anyway.
If you need more convincing, I was able to write this program within 3 months of using it, which is much more than I can say for java.
Check out php if you're more interested in a language that can be run within web pages.
bash is the terminal on most systems. When you run a bash script, it runs it through the same program that the terminal runs through. It doesn't need to be compiled and you should be able to write a script for it in any editor.
boxerboy -- that's the whole point of a shell script: anything that you type in at the terminal can also be written in a script instead. The standard shell these days is bash. When you type in a command at the command line, bash interprets it. When you run a shell script (that starts with #!/path/to/bash), bash interprets it.
The text file that you create -- the script -- is filled with exactly the same stuff you'd type in at the prompt. They're both interpreted by the same program: bash. Here's an example of a script:
tar cvf bkup.tar my_docs
echo "Done creating backup."
du -hs bkup.tar
You can also put loops and other control structures in your shell scripts. You can do those things at the command line too, but it's just more common to stick them in a script to save you from having to type them more than once.
Hang in there with the language you pick because once you learn one language you will find it much easier to extend that knowledge to others and thus learn them much quicker.
Also consider your choice of bash because I dont think you can write apps with it, just scripts. It also wont give you any idea of object orientated programming.
This comes back to what you will be doing with it. If you will be writing games or apps with GUIs then I recommend starting with C or Java (Java is object orientated (OO) while C is not) and moving on to C++. There are some really great C++ books out there which make it easy to learn if you have some programming background (search this forum for a thread about the books, i am sure i remember seeing one). You may find it easier to start with Java because then you will immediately start think of things in terms of the OO approach.