Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-04-2006, 03:52 PM   #1
Registered: Mar 2006
Posts: 30

Rep: Reputation: 15
Programing in linux

I would like to learn how to write shell based programs to interface with hardware, primarily serial, printer, and usb ports. What language would be a good start? I have a good understanding of Linux and very basic programing skills. I used to make simple dos shell scripts and program in BASIC. I'm currently running slackware 10.2
Old 12-04-2006, 04:32 PM   #2
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Rep: Reputation: 55
Usual programming language is C or C++, but everyone has different preferences. Some people like to use Java, Python, Perl... any of these will work.

I personally like C/C++ because it's most common and I've used it most often.
Old 12-04-2006, 04:42 PM   #3
Registered: Nov 2005
Location: Canada
Distribution: Mint, Debian
Posts: 168

Rep: Reputation: 32
If you want a scripting language that's broad enough for your purposes, python is good. Perl is less universal than it used to be (tending to be supplanted by python), but it's still good. Bash scripting would serve you well for some things, and is worth learning.

I'd recommend you dip into all three of these.

I'm an old school C coder, but I'm interested in doing more with those 3 myself.
Old 12-04-2006, 05:47 PM   #4
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 64
It very much depends on what you want to do. If you're looking to do very low-level communication with the parallel port / serial ports then you'll probably want to do so with C or C++ (C if you want to write a device driver).

If what you wish to do is utilise libraries and operating system interfaces to these devices, you have a lot more freedom. The rule of thumb I use is - use as high a level language as possible for a given task. My rationale is that errors per lines of code is more or less independent of and language used, so for a given problem you'll have fewer bugs with higher level languages than lower level ones. It'll also probably take less time, everything else being equal (like your proficiency with a given language).

The flip side of this is that the higher level languages are more abstracted from the hardware, so there's less of an opportunity to do low-level fiddling, which constrains your ability to do some tasks.
Old 12-04-2006, 08:52 PM   #5
Registered: Mar 2006
Location: Nashville, Tennessee
Distribution: Salix 13.37 with KDE
Posts: 258

Rep: Reputation: 36
Learn C programming first, it's easier than C++ and C has such a broad spectrum of use, especially at the hardware level. Once you become proficient in C, try Python, it's very powerful, popular and widely used today.
Scott Nash
Old 12-05-2006, 08:12 AM   #6
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 64
Consider having a read of The Art of Unix Programming. Free online book.


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
programing in java on linux phoenix_wolf Linux - Newbie 21 01-26-2005 06:35 AM
Serial programing in c on Linux OS branens Programming 2 01-19-2005 05:35 AM
Programing in Linux sdat1333 Linux - Newbie 4 12-14-2004 11:23 PM
Programing in Linux for Windows FireInTheDark Programming 3 10-31-2004 01:31 AM
Programing in Linux jimbob1989 Programming 1 10-10-2004 10:53 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:46 PM.

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