How do I get into writing more complicated software?

TheWakeUpCall

Inactive User
Joined
Jun 11, 2006
Messages
1,209
Reaction score
4
Heya,

I am just asking, since I have been writing PHP for about two years now, and I recently was introduced at college to Visual Basic.

How do I get into more harder scripting languages. Which language would I need to learn to do stuff like write drivers for hardware and write extensions of linux and stuff.

What language is linux written in?

I understand I may be many years away from being good at this, but I don't want to have to wait until I get to uni to start this.

I taught myself the basics of PHP, why not try to teach myself this.

Thanks.
 
Heya,

I am just asking, since I have been writing PHP for about two years now, and I recently was introduced at college to Visual Basic.

How do I get into more harder scripting languages. Which language would I need to learn to do stuff like write drivers for hardware and write extensions of linux and stuff.

What language is linux written in?

I understand I may be many years away from being good at this, but I don't want to have to wait until I get to uni to start this.

I taught myself the basics of PHP, why not try to teach myself this.

Thanks.

Drivers and stuff are almost exclusively C or straight assembly language.

Linux is mostly C++ with some C and a tiny smattering of Assembler.

Coding is quite specialist. You very rarely get someone who is good at writing both drivers and applications as the skills required are totally different so my advice would be to make a decision as to the type of thing you want to be getting into and then concentrate in that area. If you are predominently going to write applications then start of with visual basic and then start to get into C++. If, on the other hand you are going to want to be into writing drivers (a very specialised task) then you'll want to start with C and then start looking at assembler languages.
 
If you're interested in developing GUI applications on Linux, take a look at QT (www.trolltech.com). It'll be available in all the distributions as it's what the KDE desktop, MythTV and many others are written in.
 
I'd recommend C over anything else, but maybe that's just because that's what I'm happiest with :). Linux (the kernel, drivers and a lot of apps) are written in C. The rest (such as kde)is C++. It'll give you a good understanding of programming in general, and the techniques are generally applicable to all languages. C doesn't have many of the 'advanced' features of other languages like Java (such as automatic garbage collection), but I think this teaches you to write better code.

As for scripting, just pick one and run with it. In general, they're all much the same, but each with it's own pros and cons. I like python, but that's probably just because I've used it the most.

If you want to get into Linux, one of the most important things to do is to learn to love the command shell. Many people from a windows background find the command line scary and want everything to be done in a nice gui. This misses the point. Given a basic grasp of bash scripting, you get access to a massive range of utilities, which you can string together as you want to accomplish just about anything you would want. Far more than you could do with windows, where basically every task needs a separate application, and they don't inter-operate with each other.

Once you get into linux, you'll actually find that a large proportion of the system is actually just shell scripts stringing things together.

Good luck. (and sorry for going off topic, but I read your earlier post about trying ubuntu and hope to persuade you to give linux another try).
 
I think for now I might look into C.

And for beady, I am willing to give Linux another try, but I think you're right that I find the command line quite scary.

I suppose it's just that I have NEVER had any of it explained to me, so I see someone telling me a command to write in, and i'm just like, what.... where did you get those parameters from.


As to nozzer, I understand, but I think I might be a bit young to specialise. I don't know what I want to go into. I will soon be looking at uni courses, and I can't decide if I should go into building circuit boards or whether I should go into system programming or application programming or what. I have no idea at the moment.

Since I was young though I have always been fasinated in operating systems, so at the moment I am using that as a basis. But I would also maybe like to look into hardware, as I find this interesting too, but I am good at writing applications, so I'm all muddled up.

I thought that writing a driver would kind of bridge the gap. Since I have an idea for a USB device that I could make, I just thought that if I found out how to make a USB driver, I could work out what I might want to go into.

Thanks for all the suggestions :)
 
I am by no means a master but I have a good grasp of C for x86 desktop and embedded platforms.

Assembly Language shouldn't be ignored, it's now mainly used in low-level stuff and for debugging - when working with code with no symbolic debug info (EG. disassembly view in a debug environment).

I have also had a dabble with Python although it is too high-level for most that I want it is great for file parsing and automating things.

Had a go with VC++ as well but that's something for the future, I'd rather learn more about C for the moment. It makes HDLs look more like programs as well.
 
I am by no means a master but I have a good grasp of C for x86 desktop and embedded platforms.
Assembly Language shouldn't be ignored, it's now mainly used in low-level stuff and for debugging - when working with code with no symbolic debug info (EG. disassembly view in a debug environment).
I have also had a dabble with Python although it is too high-level for most that I want it is great for file parsing and automating things.
Had a go with VC++ as well but that's something for the future, I'd rather learn more about C for the moment. It makes HDLs look more like programs as well.


How did you go about learning C to start?
 
I thought that writing a driver would kind of bridge the gap. Since I have an idea for a USB device that I could make, I just thought that if I found out how to make a USB driver, I could work out what I might want to go into.

Your actually looking at quite a complex project there because, unless you are doing something very simple, you are going to have to write a USB driver for the PC and the embedded code for whatever your remote device is. The techniques and tools are going to be very different for each part.

The PC end will probably be C code and is likely to be an adaptation of some standard driver. Not too hard in itself except that you are going to have to have some fairly intimate knowledge with the windows device driver SDK and DDK and you'll have to know quite a bit of terminology regarding USB data packets.

Your embedded end will either be an embedded C compiler (usually fairly expensive) or assembler (usually free). In either case you need to be very familiar with your target processor and understand all about the registers for the various timers/UART's etc, not to mention the native instruction set !

I've no idea what you intend to try and build but unless its a very simple kind of USB project (ie PC to PC transfer or something using one of the USB/UART conversion chips (ie FDDI) ) then I think you are going to have an awful lot of research to do.

USB (and drivers in general) are fairly complex things to get your head around (bear in mind USB is effectively a network) and not something I would recommend without having someone thats willing to teach you. Yes, you can learn it yourself but expect to be as bald as me by the time you are 25 !

I'd recommend you put thoughts of USB and drivers on hold until you have got to grips with C and possibly C++. There's loads of good teaching books available for these languages. Sams do a good range as do Sybex and quite a few others. I'd also recommend you get a good book on generic programming techniques. This should give you a good grounding of the most common structures within a wide range of programming languages as well as giving you an idea as to how to go about breaking a problem down into small manageable chunks.
 
How did you go about learning C to start?
I actually learnt Pascal first while at college. Basically I learnt by reading a book a friend lent me and translating my code from Pascal to C. I don't really think you need to formally learn C as such, but it's definitely useful to formally learn programming. There's lots of techniques that you won't get from the 'Learn C++ in 21 days' type books. Bubble sort anyone? But I suppose if you're going to uni to do this sort of thing you'll get it from there. As a matter of interest, what are you doing at college that gets you exposed to visual basic?

Until then, I'd go through a few of the literally countless online tutorials. And get yourself a couple of books (I find it much easier to learn from a book than on screen). Once you know the basics, look through the source code of some simple(ish) programs (this is where linux comes in), and try to figure out how they work.

As with so many things in life though, the best way to learn is to play around and try things. I'm sure if you've taught yourself php, you'll be able to learn C

As for USB devices, things are actually quite easy on Linux. You'll still need to learn C, but libusb makes things fairly easy. Have a look at the docs in there.
 
There are loads of online texts for learning C, there aren't many short cuts and don't try to avoid pointers :).

The GCC would probably cater for your embedded target compiler needs, software wise. Without a Linux machine it can be run under Windows using Cygwin but it is also possible to build GCC to run natively under Windows (or more correctly, I have known "halt" to do that).

The GDB isn't much fun through command line though.

The hardware will be a bit more difficult to come by, you could maybe make it but if you want to build for x86 then your PC will do.

Get hold of a C compiler for Microchip PICs, I think some might still be free, MPLAB is their standard assembly language tool. Try making some drivers for that, make an EEPROM programmer or something.
 
Last edited:
Back
Top