LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2006, 06:10 PM   #1
kajensen
Member
 
Registered: Aug 2003
Location: Santo Domingo, R.D.
Distribution: Ubuntu 14.04 LTS, Xubuntu 14.04 LTS
Posts: 90

Rep: Reputation: 15
Arrow Advice: First Language




I am transitioning out of Win and learning BASH.

I feel it is time to start learning my first programming language. I'm long on curiosity and motivation and short on knowledge.

Where do you advise I begin?
 
Old 07-15-2006, 06:53 PM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
hmm thats always a fun question to ask..

i think that c is the best lang to start out with.. if not c then id say check out java..

good luck.
 
Old 07-15-2006, 07:13 PM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

Java is widely used as the language of choice in Universities / Colleges - it's pretty consistant, the Sun Java compiler gives very good error messages if your program fails to compile, and it's a real object orientated language.

I originally learned to program (BASIC excepted) with Ada95 in my first year of Uni, but I wouldn't recommend anyone goes near it without a compelling reason to do so.

To be honest, it doesn't *really* matter too much what language you choose. C/C++ is the language of Unix, but is a bit heavy going for a first language. Python is popular on Linux, and is easy to learn, but it's odd (e.g. whitespace in your source code actually alters the structure of the logic, which is unusual).

Get a good book on whatever language you choose, though. It's worth the investment. (This book:
http://www.powells.com/biblio?isbn=0072230738
got me through University, for example)

At the moment, most of the programming I do is in the shell (I work for a Unix vendor), with a bit of Java if I want a GUI.

Dave
 
Old 07-15-2006, 07:13 PM   #4
urzumph
Member
 
Registered: Jan 2004
Location: Australia
Distribution: Debian
Posts: 168

Rep: Reputation: 30
This is a tricky question to answer. I personally started with an easy language similar to Python. That said, C is really the language from which all other languages began and you can definately see the similarities.

I wouldn't try learning C as a first language outside a classroom unless you really enjoy 'jump in the deep end' style learning. First first time programmers even things like using GCC and writing basic Makefiles can be a major hassle, and you need that before you write a single line of C.
 
Old 07-15-2006, 08:10 PM   #5
bushidozen
Member
 
Registered: Oct 2004
Posts: 215

Rep: Reputation: 30
Since you're just starting out, you may want to look at languages such as Python or Ruby; they're both popular with a lot of documentation (both in books and online). Once you've gotten comfortable with those (or you simply wish to move on), you can tackle some of the more "mainstream" languages like C, C++, Java, or C# (using mono). If you want to deviate from the norm (or broaden your programming thought process) go for powerful, but different, languages like Lisp or OCaml.
 
Old 07-15-2006, 11:02 PM   #6
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Ignore what every one else has said: the one, the only language to learn is...

...dang technical fault.
 
Old 07-15-2006, 11:02 PM   #7
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
...To be serious all the advice give is good. There is no one starting language, and the answer should come from your goals, as in what do you want to achieve. Each language has a purpose a specific niche that they address. C, Java, Ruby PHP, Python, could all be the ideal language, it all depends upon what you want to get out of it.
 
Old 07-16-2006, 05:09 AM   #8
kalleanka
Member
 
Registered: Aug 2003
Location: Mallorca, Spain
Distribution: xubuntu
Posts: 551

Rep: Reputation: 38
Why not scripting first? Bash for example. Later I would go for c and c++.
 
Old 07-17-2006, 04:00 AM   #9
Hal
Member
 
Registered: Oct 2003
Location: East Anglia, England
Distribution: Dapper Drake / Slackware
Posts: 151

Rep: Reputation: 30
Quote:
Originally Posted by graemef
...To be serious all the advice give is good. There is no one starting language, and the answer should come from your goals, as in what do you want to achieve. Each language has a purpose a specific niche that they address. C, Java, Ruby PHP, Python, could all be the ideal language, it all depends upon what you want to get out of it.
I couldn't agree more. If you find a task you want to complete, then use the language most applicable to achieving that task.

For instance I started off with PHP because I wanted to make web-apps. I started making very procedural scripts, but now that I have completed a couple of projects, I'm learning Object Oriented Programming etc.

It also gives you the motivation.
 
Old 05-29-2007, 02:46 PM   #10
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Sorry to continue an old post, but this is still an long time process thread since it ll be always new linux incomers.

After few step with bash and good knowledge of basic, I am pointing out myself :
ought I start learning gcc or python ?
I just need some playing around with the strings, files output, saving to files, records database, and scripting automatic stuffs ... nothgin very high-tech but just useful.

The python is said to be easy, I am not bored about sthg easy, just mathematic is always the best, for logic ... for programmnig

Hence, I would rather start with gcc, since it is like "universal" and allmighty ... but might be unappropriate between strings foolling around ...

DIfficult choice for the moment, python or gcc !
(Maybe I am wrong, I am n00b)

Regards
 
Old 05-29-2007, 05:00 PM   #11
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
First minor point gcc is a compiler the language would be C or possibly C++

Given what you want to do I would suggest a scripting language like Python or Ruby (not to forget Perl or PHP either but a scripting language) The reason for this is that you "need some playing around with the strings, files output, saving to files, records database, and scripting automatic stuffs ... nothing very high-tech but just useful." A scripting language will get you results much faster than a compiled language such as C.

For example in C managing strings is (for a beginner) non-trivial, you need to allocate the memory (never use more than you have allocated!) then assign the data into the variable, remembering to ensure that the string is null terminated (thankfully the majority of the functions that you will learn to use do that for you) Then you will want to pass the string around and so you will need to remember to pass it by reference when you want to be able to modify it and... okay I guess that's sufficient for you to understand that C takes more effort to achieve a simple task and results are important.

Finally, by selecting a scripting language you will be learning more about programing and developing your skills in that area so if you then want to travel the path of C / C++ (Java etc) you will be able to reuse much of what you have learnt.
 
Old 05-29-2007, 05:28 PM   #12
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by graemef
First minor point gcc is a compiler the language would be C or possibly C++

Given what you want to do I would suggest a scripting language like Python or Ruby (not to forget Perl or PHP either but a scripting language) The reason for this is that you "need some playing around with the strings, files output, saving to files, records database, and scripting automatic stuffs ... nothing very high-tech but just useful." A scripting language will get you results much faster than a compiled language such as C.

For example in C managing strings is (for a beginner) non-trivial, you need to allocate the memory (never use more than you have allocated!) then assign the data into the variable, remembering to ensure that the string is null terminated (thankfully the majority of the functions that you will learn to use do that for you) Then you will want to pass the string around and so you will need to remember to pass it by reference when you want to be able to modify it and... okay I guess that's sufficient for you to understand that C takes more effort to achieve a simple task and results are important.

Finally, by selecting a scripting language you will be learning more about programing and developing your skills in that area so if you then want to travel the path of C / C++ (Java etc) you will be able to reuse much of what you have learnt.
So a python (scripting) would be better than gcc ... hmm
The fear is that most of Unix & linux are written in C. Like ./configure ; make ; make install , the C would be so valuable to understand what is going on and what is happenign really & fix it.

Besides I found the C tootally pure langage : these { } ; are making it very well structured, but I still didnt look the strings HOWTO.
I am right there : http://www.eskimo.com/~scs/cclass/notes/sx4a.html

It goes fast since I know basic, pascal, vb6 ... and GFA Basic (ST). Damn if we had a gfa basic editor in this C langage that could be useful. It bound you to avoid any failures while programming. It obliges you to write correctly and obliges (oups obliged) you to have right tabulation...
which is pain in .... at the beginning but afterwards, you get a wonderfully well structured program that can be well readed after lines to years of code.

Anyhow, I fear that I havent look yet these Strings things with C....

Otherwise,
/usr/bin/run
as sth like:
Code:
#!/bin/sh
clear
gcc "${1}.c" -o $1  ; ./$1
might be rather fine no ?
Code:
run myfirsprogram
Oups for long code ...

==
btw you have strings examples in C... (?)



program.c:3:20: iostream: No such file or directory
program.c:4:18: string: No such file or directory
program.c:3:23: iostream: No such file or directory
program.c:4:21: string: No such file or directory
program.c:5:22: sstream: No such file or directory

Last edited by Xeratul; 05-29-2007 at 05:42 PM.
 
Old 05-29-2007, 07:02 PM   #13
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
here we go again.
 
Old 05-29-2007, 07:33 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
My thoughts entirely ....
 
Old 05-30-2007, 07:10 AM   #15
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Start simple, Python is a great choice, I consider it the BASIC of the new century. If we had Python back when I started it would have displaced BASIC. It can do a lot, but you can start simple and it's very readable.

You can learn shell scripting at the same time as you do administrative things with your system.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
New Linux user (developer) looking for language advice? Rightnow Programming 1 04-17-2006 04:04 PM
Which language? rooman Programming 4 10-21-2004 08:11 PM
need some advice on language choice(Perl vs PHP) coolman0stress Programming 8 11-17-2003 04:41 AM
What Language? Svha Programming 3 10-08-2003 08:08 PM
what language TravisB Programming 2 03-29-2002 04:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration