Linux Today: Linux News On Internet Time.
Search Linux Today
search.internet.com
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Become a Marketplace Partner

internet.commerce
Be a Commerce Partner














The Linux Channel at internet.com
Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Subscribe News
Subscribe PR
Subscribe Security

internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 



Current Newswire:

Linux And Martial Arts Humor - Linus Torvalds Vs. Chuck Norris

Extending Nautilus, Scripting Your Way To UI Bliss

Check Your Mysql Server Performance with MySQLTuner

The Growth of the Newest Kubuntu Support Option

Linux Game "System of Tomorrow" Ships in Two Weeks

Anonymous Proxy Using Squid 3 On CentOS 5.x

Install and Configure Cacti Monitoring Tool in Ubuntu 8.10 (Intrepid Ibex) Server

SimplyMEPIS: The Best Desktop Linux You Haven't Tried

Planning Extensions in TYPO3

How the Linux Kernel Manages Virtual Memory

Sr. Developer, Backend
Professional Technical Resources
US-OR-Portland

Justtechjobs.com Post A Job | Post A Resume
:Joe Pranevich -- Moving to a Linux World
Joe Pranevich -- Moving to a Linux World
Dec 21, 1999, 20 :43 UTC (23 Talkback[s]) (14502 reads)

(Other stories by Joe Pranevich)

By Joe Pranevich

As Linux has gained in popularity, the number of commercial (and free) applications have risen dramatically. A growing number of these applications were not born on Linux but rather on some other, lesser known operating systems. Obviously, this is a wonderful trend and one that I am personally quite happy to see. In fact, this article itself was drafted using Star Office, an office suite for Windows and several other Operating Systems. Call it a trial by fire. However, many of these newcomers to the Linux realm of computing carry with them many of the quirks and traits of previous OSes. This article attempts to describe some of the things that application porters can do to make their applications more Linux-like and play nicer with the conventions already established by the community. It is my hope that someone out there someplace will see this and say "Wow, I was about to do that. How silly I feel now. I'll fix that right away!" and maybe help make the Linux environment that much more enjoyable.

Of course, many of these so-called flaws are present in current Linux applications that are otherwise well-behaved. It's my idea of an optimal world which I have extracted from Linux history. Maybe the writing is on the wall and I'm showing my age and that these ideas, in whole or in part, are obsolete. Whatever you think, please let me know. I'd love to hear from Linux developers who are facing these issues and I hope that writing this will promote thought on the subject.

Dealing with Multiple Users
One of the biggest changes that application developers have to cope with when moving to a Linux environment is the user. Windows doesn't have users, really. Under many other OSes, applications do not generally support separating configuration files, documents, and other files so that different users get his or her own personalized environment. Even on OSes that support multiple users (such as Windows), very few programs bother to make use of these features and instead opt to put configurations in global places. Linux, on the other hand, does have multiple users and applications should always be written with this in mind.

Generally, a Linux application's configuration can be split into two distinct parts: the master configuration and the per-user configuration. This allows Linux applications to be customized to each individual user's tastes without settings carrying over. The master configuration file or directory is generally stored with the other files for the application (for example, /usr/share/foo) or in the /etc directory if the application is to be considered "low-level". (I generally prefer to not clutter the /etc directory with high-level configuration bits but that's not always the case.) Now, while this file should be considered for default options, end users should have their settings saved into their own home directories. By tradition, this is often done with a dotfile or directory. For example, a user of application foo could likely expect to find their per-user configuration bits in .foo/ (a directory with multiple config files) or .foorc (or some other similarly named file.) This separation is easily enforceable as most user accounts should not have write access to the directory where the application is stored.

Some Linux applications, when run as the root user, will modify the master config files rather than the per-users files. This would make any changes done as the root user global. Application writers can consider this approach for simplicity of administration, but many administrators are comfortable with merging in changes by hand as necessary. (Provided they are human-readable, see below.)

When writing install programs, it's important to remember that not all applications will be installed globally. Often, a particular user will want to install the program for him or herself only and the install should be smart enough to know the difference. When running as root, an installer should expect to put the application in a public place (for example, /usr/share.) When running as a user, the installer should suggest putting the application in a directory off the user's home. If the installer suggests root's home for a global install, no one is likely to have access to the files and the entire purpose of running as root is ruined. This type of separation work does take extra time to code but the benefit to end users in the Linux world is enormous.

Working on the Command Line
The devil, as they say, is in the details and it is often the subtle flaws in an application that can make it more painful for the Linux end user. Most of these flaws are readily avoidable and not difficult to fix.

One such annoyance is with command-line options. Now, I'll be the first to admit that not all Linux applications are consistent when it comes to options and how they are formatted. However, there are some general rules to follow. Under Linux, the forward-slash is a path delimiter and not an option mark. Thus, while "foo /bar" is acceptable in the Windows world, it can be quite confusing in the Linux world. For the end user, it is quite difficult to determine whether /bar is an option or a full path. Some shells may get confused. And what if you do need to pass an actual path (for example, a file to open) to such a program? How is it to figure out (besides cruel hackery) what is a path and what is an option?

The answer, of course, is to use GNU-style option syntax. For long options, use double dashes. With the example above, the new syntax would be "foo --bar" For shorter options, Linux applications generally use a single dash. "-b", for example, might be an abbreviated form of --bar.

If you are porting a program from the MacOS or Be, it might be useful to think about adding command-line options to your programs. Linux users demand some level of batch control in their applications. In its most simple forms, these can be nothing more than options to open a file by default. However the perfect Linux application will have plenty of options that can allow the end user to have some flexibility in the way that config files are loaded, what input files to open by default, and just about anything else that would allow him or her to use your program in a customized environment.

By the same token, many applications written for alternative OSes do not take advantage of the standard input and output devices. Applications that are written for the Linux environment should not forget that these devices exist for the convenience of the end user. In a customized environment, standard input may be the best way of getting data into your application (for example, from a pipe.) If your application supports batch processing, having an option to write to standard output is a wonderful idea. Just because your application is a windowing application shouldn't mean that it's disconnected completely from the power of the command-line.

In my opinion, applications written for many other OSes are constricted by artificial barriers and shortsightedness. These applications' uses are limited to the imaginations of the programmers. A good Linux application, on the other hand, should be flexible, well-designed, and limited only by its user's imagination.

Documentation
Documentation under Linux can be a tricky subject. I don't want to get into any flame wars over manual pages and info pages or about any budding standard. In my mind, convenience is the number one reason for documentation and help that cannot be read can't be construed as very helpful.

If you are porting an existing codebase to Linux, you probably already have plenty of documentation available in either your own format or the format of the previous OS. In some cases, such as OSes with HTML help, you'll have no problems translating help there to help on Linux. In other cases, I recommend that you try and steer away from any proprietary formats on a Linux system as most Linux applications natively do. Don't limit your users to use your specific help browser (even if there are some features, such as a macro-based tutorial, that can only be accessed through it), but rather allow them to see the information in some other way (without all the dazzle.) There are indexing tools and other oddities in the Linux world that many users use and keeping documentation readable keeps these options up to the end user, your customer. For documentation, I recommend HTML or plain text; Linux readers are available for postscript, portable document format (.pdf), and other formats but many users will find these limiting in some way or another.

If your program has command line options, you should consider making up a one page summary of the options and storing it in manual format. This gives the user a quick reference in the traditional format. It should probably contain a pointer to "real" documentation, the software company's website, and anything else appropriate. Simple things like these make the difference between a good program and a great program.

Configuration Files
To a Linux user, being able to configure a system in whatever manner you prefer is important. To that end, Linux applications generally have config files that can be edited using a standard text editor. While there is no set standard for Linux configuration files (for example, Windows's old .ini format), any format that is generally understandable is appropriate. What is definitely not appropriate is registry-like binary files that require specific applications to edit them. Back in high school, I worked in a computer store as a technician for a couple years and there is no problem on the face of the earth more annoying than trying to get Windows to start up when the registry file is corrupted. Using the Linux ideal of text files, you at least stand a chance at being able to edit the file into working again.

Frankly, I just like text files because they can be edited easily in whatever program I prefer. I'm a vi man myself, although pico is quite nice. Emacs scares me, mostly because I'm not allowed to use it at work. (Please, don't anyone flame my employer. I like my job.) But it's not just a matter of text editing, it's about having options. What if someone wants to write a configuration GUI that makes your program easier or more integrated into the OS? A difficult file format stands as a barrier between you and something that can improve on your product.

Linux isn't Windows
This simple rule is hard to express too much. Linux isn't Windows. Linux isn't the MacOS. Whether you are writing documentation or dialog boxes, don't get your terminology confused. Many Linux users can become annoyed or confused when confronted by MS-isms. For example, Linux doesn't have folders. Instead, Linux has directories. We're not afraid to say the word directory. Similarly, we don't generally call things shortcuts. (They're symlinks.) There are more examples, of course, but the point is that using "cutesy" words for concepts when we have perfectly good words already can be confusing to users, especially those who have not come from whatever world you did.

By the same token, hiding extensions from users can be annoying. Sure, Linux "desktop" developers may choose to make this mistake, too. But that doesn't mean that everyone should. Similarly, putting your own VFS (Like with the "Desktop" on top.) on top of the existing system for file dialogs may seem easier to understand, but the lack of consistency across applications will cause confusion. Hiding the filesystem (or just about anything else) from the user is, in my opinion, a bad move.

Don't Reinvent the Wheel
A growing trend in newer ported applications seems to be that they hang onto their roots very strongly, even artificially. Some applications deliberately make their widgets look more like the widgets on the old system. Some applications even go so far as to draw their own windows so that they can use little minimize buttons. Linux users don't need these things. In fact, many Linux users will find this artificiality disconcerting. They destroy the standardization of the user's look-and-feel. In general, it's a bad thing.

When porting an application to Linux, one has a lot of widget options to choose from. Motif may be a bad move as it's commercial, but Qt and Gtk+ are both good options and both supported on most distributions. (Flamewars aside, they are both wonderful widget sets.) Writing your own widget set from scratch may seem like a good idea, but it's a wasted effort with so many other options abounding. (People will be sending me email saying that having a desktop full of some Qt and some Gtk+ is bad and that Linux users should just make up their minds. I think that I'd rather have the option and at least Linux widget sets are being used. Besides, both sets are themable to look like the other, more or less.)

In a somewhat more extreme situation, some ported applications even take pieces of their former OS with them. For example, StarOffice adds a Start button. This blatant MS-ism not only is unnecessary (a menu or a toolbar would be just as functional), it gets in the way of my Gnome panel. To me as an end user, this actually reduces the functionality of the application to such an extent that either the Gnome panel or the StarOffice "Start" bar has to be hidden and worthless to me. I appreciate that they want to make Linux familiar to Windows users, but it would be nice to make Linux familiar to Linux users.

Everyone has a Port
Linux users are turning more and more towards platforms other than x86. I personally have Linux running on an Alpha and an old m68k system. While I can admit that I am not necessarily a typical user, I cannot understand why companies would choose to limit their own customer base when they do not need to. The sad fact is, however, that many commercial (and source-less) Linux applications are available only for Linux/i386 and no other port. Now, I can understand that it isn't reasonable to support each and every piece of hardware that Linux does; that would be impossible! But even handling the "big" ones (like Alpha, PPC, and Sparc) would increase the number of paying customers at almost no cost. As I keep saying over and over again: Linux users like their flexibility.

Some Notes about Wine and WineLib
Let me start off by saying that Wine, the Windows emulator (or non-emulator), is a great product. I use it at work to run Lotus Notes. I've written a good amount of code for the project. I'm in the authors' list (quite proudly!). But, when it comes to porting applications to Linux, it's not a good long-term option. For a first release, Wine is great. It gets the product into people's hands. But what it doesn't do is provide a good Linux experience. It's quite frankly a lot of overhead and doesn't mesh well (yet) with Linux applications on a side-to-side basis. A true Linux application should be written for Linux and I guarantee that it will be a thousand times better that way. Of course, that's just my opinion. Anything that gives more options, even options in emulation, is a good one and Wine is a wonderful option. (Especially to get around silly things like corporate email policies that don't consider other OSes.)

Conclusion
These are just my thoughts on porting applications to Linux and tangentially on Linux application programming in general. I'd love to discuss this list and see what your own personal gripes are, what you feel is right and wrong, and where you think Linux is going. Maybe a Gnome or KDE developer would be willing to chime in his or her two cents. If there's enough interest, I'll write a follow-up story about how wrong all my opinions are. In the end, I hope that through writing this I have given someone pause for thought.

Thanks. Happy New Year!

Joe Pranevich (recently relocated to Boston. Yay.)


Index Mode   |   Flat Mode   |   Thread Mode   |   Thread Flat  
  Talkback(s) Name  and Date
My main gripe with KDE is that tries to  ...   KDE too much like Windows   
K. Patton
Dec 21, 1999, 21:27:44
 
Whenever you can, don't make applica ...   To generalize slightly more   
damaged justice
Dec 21, 1999, 21:29:53
 
Then try WindowMaker.  The features your ...   Re: KDE too much like Windows   
krakken
Dec 21, 1999, 21:45:52
 
Yes!  It drives me NUTS when I hear peop ...   Folders   
David F. Skoll
Dec 21, 1999, 21:49:49
 
And let's hope these terrible 'm ...   MDI   
Trojan
Dec 21, 1999, 21:53:35
 
My pet annoyance with applications porte ...   My pet MS-centric peeve   
Dave McCracken
Dec 21, 1999, 22:01:03
 
Sure, supporting non-x86 platforms will  ...   Qualifying on multiple platforms   
Jon Leech
Dec 21, 1999, 22:13:46
 
One other thing I find very important:   ...   Avoid binding your apps to a single wm/de   
Chepati
Dec 21, 1999, 23:41:18
 
I can attest to a few things here. 

1)  ...   Alternate platform support   
Eric Lee Green
Dec 22, 1999, 00:06:14
 
I have to say that the term "folder" is  ...   folders <--- glad to have this term replace direc   
Wayne Bell
Dec 22, 1999, 09:04:38
 
Developers need a well-designed collecti ...   Standards and Guidelines   
John Sowa
Dec 22, 1999, 17:33:19
 
If I understand correctly how filesystem ...   Re: folders <--- glad to have this term replace d   
L. Ravitch
Dec 23, 1999, 10:03:59
 
I think that you hit the nail on the hea ...   Re: folders <--- glad to have this term replace d   
Bruce Bigby
Dec 23, 1999, 14:09:22
 
As one of the older folks in the crowd,  ...   Standards   
Peter Smith
Dec 23, 1999, 19:18:20
 
"A directory is a massive compilation us ...   Re: folders <--- glad to have this term replace d   
Eric O\'Dell
Dec 24, 1999, 08:36:25
 
I disagree.   A desktop is where you pla ...   Re: LT: Re: folders <--- glad to have this term r   
Wayne Bell
Dec 24, 1999, 09:45:06
 
"folders is a microsoft term"

er...  ma ...   folders   
kevin lyda
Dec 26, 1999, 11:02:18
 
Hi !What I see here is precisely the rea ...   Re: Nuts & Folders   
Eric
Dec 26, 1999, 18:53:26
 
Hi,I&#39;m a new user of Linux and I&#39 ...   Config files   
Diego Novati
Dec 28, 1999, 13:08:22
 
I think your comment could be condensed  ...   Re: Eric   
Alastor
Dec 30, 1999, 00:26:25
 
Config file parsers (of the name=value,  ...   Re: Config Files   
Richard Corfield
Jan 12, 2000, 13:38:32
 
I disagree with Wayne, Ravitch, and Bruc ...   Re: Re: folders <--- glad to have this term repla   
Bolan Timothy Lewis Meek
Jan 17, 2000, 17:50:46
 
Joe, thanks for sharing your essay. It&# ...   Hiding the file system   
Ion Chalmers Freeman
Feb 12, 2000, 23:00:01
 
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!






..............................


All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers