LinuxQuestions.org
Visit Jeremy's Blog.
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 05-07-2004, 12:41 AM   #1
ninadb
Member
 
Registered: Feb 2004
Location: Mumbai, India
Distribution: Debian Stretch XFCE
Posts: 67

Rep: Reputation: 15
how and where to start programming in linux?


Hi
Basically to introduce myself I am an accountant who is interested in computers and programming.
I do programming in my spare time.

I can write very basic programs (very very basic) in C and java. i havent gone any further.

In the initial days (during college/early bachelor days) non availability of software under windows like VC++, VB etc was the reason it was difficult to learn it and also to buy this original software one had to shell lot of money. the only option was pirated versions of the same.
Open source and free software existed but was not popular in my country in the 90's.

I was introdiuced to linux and have never given up.

I would like to learn programming in linux.

Maybe writing small programs. This is just for fun and as a hobby and also for learning

No commercial aspect

Even console based programs would be great

The problem is where do i start? and what programming language and tools do I use???

Any guidance and links would be highly appreciated

Thanks and Regards
Ninad
 
Old 05-07-2004, 01:10 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
There are many programming tools included with every distro. There are also many languages you could learn also. C is the native language of the linux kernel. C++ is used for many KDE programs. There are other languages you have like perl, python, the bash shell, and on and on and on.

Some people will write their programs in vim, other swear by emacs. There is an ide called kdevelop that you could use.

Here's a link to download the publication Advance Linux Programming.
http://www.advancedlinuxprogramming.com/alp-folder

There is also a how-to on linux programming for beginners.

Here is a link to an IBM site. The page is called New to Linux. It covers what languages are available and how to get started programming on linux.
http://www-106.ibm.com/developerworks/linux/newto/

Hope this helps you get started!

Last edited by jschiwal; 05-07-2004 at 01:15 AM.
 
Old 05-08-2004, 07:33 PM   #3
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
Lots of good resources here:

http://linoleum.leapster.org/

 
Old 05-08-2004, 09:09 PM   #4
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
Ninad,

Since you say you're doing it mostly for learning and fun, and since you're sticking with GNU/Linux, stick with C and practice procedural programming for now (that is, simple programs that call functions which may call other functions -- no objects or classes or anything like that). Build your programs with gcc.

As for tools, learn to use "make" and write simple makefiles.

Learn to use RCS and keep archives/versions of your programs (most of your projects will be just a few source files all in the same directory, so you shouldn't need anything like CVS/GNUarch/Subversion to keep track of your source code).

Learn to use gdb (the gnu debugger). You run your programs "inside" of gdb -- well, gdb sort of manages and oversees your program as it runs -- and lets you watch as variable values change as the program runs (but you can run the program one line at a time).

As for your text editor, use NEdit. To help you navigate around your source code, you run a program called "ctags" (see the very well written man page) and load the resulting "tag file" with NEdit.

There. That's it. C, gcc, make, RCS, gdb, nedit, and ctags. That's all you need. Personally, I use C++ (with the C++ front-end to gcc (g++)) instead of C, and will soon start using GNU arch instead of RCS, but that's only because my projects are starting to get pretty large, and also because I prefer *object-oriented* programming with C++.

You *could* use C++ instead of C, but if you want to start using the object-oriented features of C++, it's going to take you much longer to become proficient at programming. Of course, there's nothing wrong with just using C++ as a better C (i.e. write your procedural C programs, but start slowly adding in C++ features as you learn them -- all the while compiling with g++ instead of gcc). Actually, that's a very good idea.

After you learn to use the tools mentioned above, you'll then probably have developed more specific interests in what you particulaly want to do with your programming, so the next step will be to start using libraries that deal with what you're interested in.

Enjoy!

Last edited by johnMG; 05-08-2004 at 09:18 PM.
 
Old 05-10-2004, 01:36 AM   #5
ninadb
Member
 
Registered: Feb 2004
Location: Mumbai, India
Distribution: Debian Stretch XFCE
Posts: 67

Original Poster
Rep: Reputation: 15
Hi

Thanks for this great reply johnMG.

Just a query which after reading so many posts which I wanted to ask

Almost all the posts here insisted to start with python.

Is python a really good starting point and then moving on to C++

Also is Java on Linux used widely

Can u suggest any links to using gdb/g++ etc which u mentioned.

In short links to programming on linux.

Thanks and regards
Ninadb
 
Old 05-10-2004, 01:57 AM   #6
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
> Is python a really good starting point and then moving on to C++

The reason folks recommend Python first is because C++ is loaded with a
lot of details and special corner cases. It's easy to get bogged down trying
to understand syntax or usage, and not see the more general design issues
at hand.

My recommendation is, if you're interested in:

- actual system programming (i.e. tinkering around with programs that ask
the Linux kernel to do stuff for you, like changing file permissions, dealing
with process ID's and ownership, etc.),

- writing Linux device drivers

- high speed OpenGL graphics

- understanding how your operating system *really* works

then you probably want to use C or C++. OTOH, if you just like tinkering
with generic programs to compute numbers, draw 2-D pictures, interact
with the user, or solve problems in some other domain (like accounting
or science -- i.e. non-low-level non-system software), then Python would
probably be a better choice.

> Also is Java on Linux used widely

No, not so much. Although, Java is seeing some activity among folks who
want to compile it to native machine code (see GCJ and ClassPath). I don't
think there's any support for Swing yet though.

> Can u suggest any links to using gdb/g++ etc which u mentioned.

That linoleum site that Genesee pointed out looks pretty good. You could
also start be reading the info pages (see "man info" or "info info") on
g++ and gdb (though, you probably won't actually start using gdb until
your programs become large and complicated enough to need to be debugged
with gdb :). Also, on these program's respective websites, there's usually
a documentation page to get you started.

And, of course, google is your friend. There's lots of tutorials scattered about
on the net. :)

Last edited by johnMG; 05-10-2004 at 02:02 AM.
 
Old 05-10-2004, 04:12 AM   #7
Axion
Member
 
Registered: Jan 2003
Location: Albany, NY
Distribution: Slackware 9.1, Gentoo 2004.1
Posts: 153

Rep: Reputation: 30
Thank you for the information and great links. I am also interested in starting to program for Linux. My experience only includes a year of PHP, however. I was looking for a good starting point, and bumped into Python. It sounds great, but I'm not sure if it is the right place for me to start. I'm very interested in learning the workings of networking protocols and how clients/daemons function, ultimately being able to write a client/server, perhaps FTP some day. I want to start with a language that isn't difficult to get deep into, but I don't want to hop around learning bits and pieces of different languages...basically, I want something that isn't going to give a novice programmer a headache as soon as they get into it. If it's worth noting, I would like something that I could apply GTK to when I am comfortable enough with it. I would appreciate any advice at all.
 
Old 05-10-2004, 09:39 AM   #8
kooch
Member
 
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77

Rep: Reputation: 15
Wow, a fellow Albany-ite...

Axion can do any of the things you expressed desire to do, in Python. Python might be a little more straight forward and allow you to focus on the problems that you're trying to solve. With C you'll have to worry a lot(at first) about saying what you think you're saying to the computer. Segmentation faults, bus errors, memory access(w/pointers) are just a few of the joys of C programming.

Either language is a powerful tool to have at hand.
 
Old 05-10-2004, 09:50 AM   #9
irfanhab
Member
 
Registered: Jan 2004
Location: Pakistan
Distribution: OpenSuse 10.2, Slackware 11, Solaris 10
Posts: 415

Rep: Reputation: 34
I recommend these books to get you started with linux development:
Sams Linux Programming Unleashed
http://www.amazon.com/exec/obidos/tg...84968?v=glance

C++ GUI Programming with Qt 3 - Prentice Hall

These books will get you started in linux development.
 
Old 05-10-2004, 10:10 AM   #10
kooch
Member
 
Registered: Mar 2004
Location: Upstate NY
Distribution: Slackware/YDL
Posts: 77

Rep: Reputation: 15
IMHO, stay the hell away from Sams Publishing books. I've never read one that was worth _anything_.

Advanced Programming in the Unix Environment by Richard Stevens
(not that advanced and applies well to Linux)
and
Linux Application Development by Johnson and Troan
(not great but I would recommend it for someone who isn't just migrating across platforms)
 
Old 05-10-2004, 10:30 AM   #11
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
Axion, by using Python, you'll definitely be moving in a direction where you'll soon be able to easily write client/server network stuff. Though, you won't be using the actual C sockets library calls, but instead will be using whatever objects that Python provides for such things (the implementation of which no doubt make use of the sockets calls). Since network progams tend to be bandwidth-limited (that is, the speed of the program is limited to how fast you can get data across the network), Python is plenty fast for such things.

> I want something that isn't going to give a novice programmer a
> headache as soon as they get into it.

Heh. Well, C++ is known to provide headaches. :)

> I would like something that I could apply GTK to when I am comfortable enough with it.

Of course, there are GTK+ bindings available for Python. And, usually, folks become comfortable with Python very quickly.

What I've heard some progamming shops do is, when they want to get a prototype up and running as soon as possible, they code the thing in Python. Then they fiddle with the design, make changes to see what works best, and finally re-implement the thing piece-by-piece -- as needed -- in C++ if execution speed is an issue.

What you might also consider (if using C++) to keep yourself sane, is to limit yourself in what language features you make use of in your own projects. You might consider avoiding:

- Any other sort of inheritance besides public.
- Multiple inheritance and virtual base classes.
- Templates, but *do* of course make use of the STL.
- Operator overloading unless it will *really* make your life much easier.
- Don't overload new, new [], delete, delete [], or use placement new.
- RTTI.
- Exceptions.

Doing that makes the language quite a bit smaller and simpler. Of course, you still may run into those things in other people's code... :)
 
Old 05-10-2004, 10:37 AM   #12
johnMG
Member
 
Registered: Jul 2003
Location: CT, USA
Distribution: Debian Sarge (server), Etch (work/home)
Posts: 601

Rep: Reputation: 32
> IMHO, stay the hell away from Sams Publishing books. I've never read one that was worth _anything_.

In general, maybe so, but in particular:
Linux Programming Unleashed, by Kurt Wall, et al. (for GNU/Linux programming in general) and
Linux Programming Starter Kit, by Warren W. Gay (primarily for Linux system programming)
are, in my opinion, both pretty good books.

If interested in learning low-level C system programming, a *great* book to get started with is "Understanding Unix/Linux Programming, A Guide to Theory and Practice" by Bruce Molay.

Last edited by johnMG; 05-10-2004 at 10:58 AM.
 
Old 05-10-2004, 12:09 PM   #13
Axion
Member
 
Registered: Jan 2003
Location: Albany, NY
Distribution: Slackware 9.1, Gentoo 2004.1
Posts: 153

Rep: Reputation: 30
Many thanks...Python it is, though eventually I will buy a book on C...and some pain reliever.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Where to start for learning linux programming. joelloh Programming 5 07-20-2011 12:37 PM
Where to start Linux programming cliff76 Linux - Newbie 2 06-30-2005 02:24 PM
How to start programming assembly in Linux? lowpro2k3 Programming 3 04-05-2005 12:10 AM
Newbie desperate about how to start Linux programming in C sanki_man Programming 5 08-11-2003 05:51 AM
Where to start learning about real Linux programming. JoeLinux Programming 5 05-19-2002 03:02 PM

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

All times are GMT -5. The time now is 09:34 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