LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   good language for beginners (https://www.linuxquestions.org/questions/programming-9/good-language-for-beginners-375633/)

boxerboy 10-21-2005 10:58 PM

good language for beginners
 
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.

freakyg 10-21-2005 11:07 PM

stick with "C".........then move on to Perl.........

titanium_geek 10-21-2005 11:21 PM

python? java? html? find something, jump in and try it.

titanium_geek

shanenin 10-22-2005 12:33 AM

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.

paulsm4 10-22-2005 01:17 AM

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

PS:
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 ;-)

johnMG 10-22-2005 01:25 AM

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?

Hm...

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.

mcgrew 10-23-2005 04:26 AM

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:

Python:
Code:

print "Hello World"
Java:
Code:

System.out.println("Hello World");
PHP:
Code:

echo "Hello World";
Not too bad in any of them. Now I want to capture keyboard input from the console

Python
Code:

in = raw_input(prompt)
Java:
Code:

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print(prompt);
in.readLine();

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.

Orkie 10-23-2005 08:40 AM

Quote:

Originally posted by mcgrew
I'm actually not sure how to do this in php. I've never tried.
I'm not sure if it is the way that it 'should be done' but you can get console input in PHP like this:
Code:

$i = fgets(STDIN);

bglnelissen 10-23-2005 09:10 AM

start at the beginning
 
for noob linux user i think BASH is most usefull

so BASH it is.

boxerboy 10-24-2005 12:39 AM

Re: start at the beginning
 
Quote:

Originally posted by bglnelissen
for noob linux user i think BASH is most usefull

so BASH it is.

ok i would love to learn bash that sounds like it would be very usful since it seems to be used alot. anything like a guide online or something to help me get started with it?

lowpro2k3 10-24-2005 12:48 AM

Work your way through this for a couple weeks, take time when you learn something interesting to play around with the idea:

http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

After you feel comfortable, move on to this one

http://www.tldp.org/LDP/abs/html/

boxerboy 10-24-2005 01:03 AM

is bash something you can write and compile at terminal or should i use anjuta or emacs or ect. and does it use the gcc compiler?

Orkie 10-24-2005 04:20 AM

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.

johnMG 10-24-2005 09:04 AM

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:
Code:

cd ~
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.

tristanm 10-24-2005 09:54 AM

Hi

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.

Whatever you try, good luck.

Cheers
Tristan


All times are GMT -5. The time now is 02:59 PM.