[Wolves] Programming

James Turner james at turnersoft.co.uk
Sun Dec 14 01:24:47 GMT 2003


On Sat, 13 Dec 2003, Mo Awkati wrote:

> Hi Folk
> 
> Before I go and spend my hard earned money at Waterstones on a book 
> to read over Xmas, I could with some advice please.
>
> I want to start learning to programme under Linux. They way I 
> understand it is that if I want to programme Linux itself so that it 
> runs tasks, then  I need to know C?

Not necessarily - there are lots of programming languages available on 
Linux. C is still the prefered language for writing low-level code such as 
the kernel or server applications, but you may find a higher level 
language less heavy going and more productive. Do you have any previous 
programming experience?

(cue recommendations by the various language advocates on the list)

> I got a book out of the library 
> called Programming Linux in 24 Hours (in my case 12 months) by SAMS. 
> This particular book uses Red Hat. From my very little knowledge it uses 
> gcc. Is this a Gentoo thing?

gcc stands for GNU Compiler Collection, a set of compilers including C, 
C++, Objective C, ADA, Fortran, Java, etc. The term is also used to refer 
specifically to the GNU C Compiler, which is invoked using the command 
gcc. The GNU Compiler Collection should be available for most/all Linux 
distributions.

> Do I need to look for another book if I use KDE as I will probably 
> migrate to SUSE?

Well, does "Programming Linux in 24 Hours" include material on KDE at a 
level you find understandable, in conjunction with a programming language 
you would like to learn/use? For KDE development it shouldn't matter what 
distro you use.

> I think I am clear that if I want to creat applications that will run 
> under Linux I can use KDevelop and Qt.For this I will need to learn to 
> programme with C++.

You may like to have a go at developing with Qt Designer, which lets you 
implement the user interface using a fairly streightforward "point and 
click" interface, then add C++ code to turn it into a working application.

> Top save myself the headache, I know that C and C++ are related but 
> there are differences, do I need to learn both C and C++?

C++ was originally a set of extensions to C, introduced primarily to 
provide better support for object oriented programming (OOP). The language 
also introduced several other non-OOP features, many of which were later 
added to C.

Which of these you learn (if any) depends on what sort of programming you 
would like to do. The object-oriented features of C++ make it the more 
suitable for writing GUI applications such as those commonly found on KDE 
or GNOME desktops, while C may be more appropriate for writing 
certain low-level utilities, tools or contributing to the kernel.

With several minor exceptions, all the features of C are also available in 
C++, so if you have cause to learn C first you can then continue to C++ 
more easily. However, neither are particularly easy "first languages" if 
you're just starting to learn how to program.

I also suggest taking a look at Python, or (if you're interested in 
server-side web programming) PHP.

Does anyone else on the list have any suggestions?

James




More information about the Wolves mailing list