Fog Creek Software
Discussion Board




"Unix culture values code useful to other pgmrs?"

A while ago, Joel wrote:
"Unix culture values code which is useful to other programmers..."

I understand the point he was trying to make, but I disagree in a fundamental way.  Consider another OS.

Ten years ago, a company I worked for used an AS/400 server for some Client/Server app I was writing.  I thought to myself, "Oh God, I'm going to have to learn a whole new shell for a completely new OS!  This'll take forever."  To my astonishment, I was up an running and creating amazingly useful server-side shell scripts in a half an hour.  What's more, I haven't seen an AS/400 since then, and I still remember everything I'd need to be just as productive today!  On the other hand, I use Unix every day, and, for the life of me, I can't remember certain simple commands.  (What the heck 'pwd' is supposed to mean.  Personal Working Directory?  Present Working Directory?)   

OS/400 culture (if there is such a thing) values code which is useful to other programmers in a way that Unix never will.

Let me very briefly describe some of the amazing features of the OS/400 shell:

* There's just *one* shell!  (BTW, this is a good thing.)  And, it's character based.

* Commands within this shell are completely standardized. 
    Every noun on the system was standardized to a three letter abbreviation:
      'LIB' for Library
      'PGM' for Program 
      'USR' for User
      'F'  for File (one of the few exceptions to the three-letter rule)
      etc...

    Every verb likewise:
      'WRK' for Work with (edit)
      'DSP' for Display
      'DLT' for Delete
      etc...

Every command had the form <Verb-Predicate><Noun-Subject><Noun-Object>.  You can probably guess any command you need!  Wanna copy a file to another library, you guessed it; it's CPYF <Filename> <ToLibrary>

* There are no retarded flags!  Shell commands have parameters!  If you forget the parameters, hit F4, and a list of named argument fields is displayed.  Just fill in the blanks.  Ah, but what if you forget some subtlety of a particular parameter?  Just hit F4 again, and a full description of that parm is displayed!

* There were standard command key usages defined.  F1 = 'Help' *everywhere*!  F3 = 'Exit' *everywhere*!  etc., etc.

* Everything in the operating system is an object of a certain class with well-defined interfaces.  There are no binary files floating around the operating system.  A program is a *PGM.  A source file is a *SRCF.  A library is a *LIB. 

* Oh, and as I recall, the AS/400 compiled it's programs to some intermediate language years before Java or .NET.

I thought to myself, "Do you mean I can sit down and handle an OS through the command line, or through a shell script without my ultra-Unix-geek-secret-decoder-ring???  No insane, incomprehensible man pages???  No list of convoluted flags???"  Praise the Lord!!!  I'd been born again into a world of sanity!  Halleluiah!!!  I'd been saved!!!  "This amazing technology must be the wave of the future", I thought.  "People will see the productivity gains of this well-organized OS shell, and the future will be a Nirvana."

But alas, it was not to be.  In fact new little *nix's are popping up like weeds everywhere - sapping the productivity of every programmer they touch.

My point is that if Unix *really* valued code which is useful to other programmers, it would not have the insane shells that it has.  My theory:  geeks with very little ability at abstract thought are very valuable once they've memorized all the information in the secret-decoder-ring.  If a Unix shell were easy to use, like OS/400's, then their super-geek powers would be rendered useless, and they'd have to compete solely on their ability to solve problems elegantly and effectively.

anon
Wednesday, January 21, 2004

In other news, posters declared that all programming languages should be reduced to one single language, using three letter abreviations. The name assembler was suggested.


Wednesday, January 21, 2004

anon - unlike blanks' reply, I appreciate what you're saying.

YAAP
Wednesday, January 21, 2004

I have a similar opinion about Windows API functions vs. the Unix functions.

Windows API functions have meaningful names: CreateProcess, CreateWindow, GetWindowClass, etc.

Unix functions are very cryptic: fork, spawn, select (for sockets), etc.

MX
Wednesday, January 21, 2004

Not to mention the unix directory structure:

/etc  (what the hell?)
/usr  (for users, nope!)
/usr/local (for local users? nope!)
/home (ok, this one is reasonable)
/opt (at least I don't have this one on my Linux)
/var (and var stands for what?)

There is no programmer love in this structure!

Almost Anonymous
Wednesday, January 21, 2004

In defense of Unix:

Many of those commands were named with command lines in mind.  Which would you rather type many, many times: "ls" or "GetFileListing"?  "pwd" or "PrintWorkingDirectory"?  "pgmrs" or "programmers"?

Unix felt wonderful to me.  It was no harder for me to learn the meanings of awk, grep, ls, select, fork, cat, chmod, sccs, kill, ps, csh, sh, more, cut, tail, head, ed, sed, date, sort, touch, cd, lcd, ftp, rlogin, telnet, du, su, set, and gcc, than it was for me to learn any other thrity words in English.  Easier, in fact, because there was nothing ambiguous about these commands.  And pipes could be used to fit them together like Legos.  They were like toys.

Frankly, I'm inclined to agree more with "blank" than with "anon".  anon's article reads a lot like a troll.

Paul Brinkley
Wednesday, January 21, 2004

Yikes.

s/thrity/thirty

Carry on.

Paul Brinkley
Wednesday, January 21, 2004

Paul - Yes, Unix is great. I love it! I love the command line aspect of it. I love the fact that I can control everything via text files. I love pipes. I don't like the fact that something meaningful to some AT&T guys thirty years ago is still used. I don't like the directory structure. I don't like the security model.

I would say Unix has been a work in progress, but really only for the hardware, not the user.

/dev/null
Wednesday, January 21, 2004

OS/400 programmers value their darklord Satan.  That's as much as I can figure having had to interface to an AS/400.

Andrew Burton
Wednesday, January 21, 2004

To truely understand Unix, first read "The Unix Haters Handbook". It's about 10 years old and somewhat dated but very valuable as background information. Then go find the Gospel according to Eric S Raymond, that is "The Art of Unix Programming", a much more recent publication. In both tomes you'll find the central theme is that "unix culture values code useful to other programmers".

old_timer
Wednesday, January 21, 2004

MONGO NOT UNDERSTAND /USR. MONGO WISH COMPUTER HAD DOS. MONGO LIKE COMPUTOR.

MONGO.
Wednesday, January 21, 2004

>> "Which would you rather type many, many times: 'ls' or 'GetFileListing'?  'pwd' or 'PrintWorkingDirectory'?  'pgmrs' or 'programmers'?"

Question is irrelevant & misleading,  Would I rather type "ls" or dspdir?  I'd rather type 'DspDir'.  There are no 15 letter commands in OS/400;  maximum of 9 chars I believe.  Gosh, I'd have to type four more characters. 

But this buys me uniformity, clarity of thought, and not having anything at all to memorize.  I could simply type 'dspf' and know that I'm displaying a file - without having to memorize 'cat' (whatever the heck that means.)  'pwd' => 'DspCurDir'.  You can see that with very few extra keystrokes, you can create shell commands that no one will ever forget - and more to the point, even if you've *never* used a particular command, you know what its name is in advance. 

And you don't ever have to type in a cryptic sequence of flags again.  No need to memorize, just hit a key and fill in the blanks.  Why not standardize?  You can't possibly be suggesting that a person can more easily comprehend a compile command 'gcc' with an incomprehensible list of flags rather than 'CmpSrcF lang(java) debuginf(*yes)...'.

>> "And pipes could be used to fit them together like Legos.  They were like toys."

On the AS/400, pipes were rendered useless and cumbersome  It's the twenty-first century.  We're not bound to teletypes anymore.  If you wanted fifty commands to be executed in sequence, on separate command lines, type:

CMD1 out(outputfile)
CMD2 in(outputfile)
CMD3 in(outputfile)
CMD4 in(outputfile)
.
.
.
CMD50 in(outputfile)

Then hit enter!  (And, prior to hitting enter, each line would be checked for syntax errors.)

BTW, why is that people in the holy order of Unix call every Unix-infidel a "troll"?

anon
Wednesday, January 21, 2004

old timer:

Every lofty goal espoused in "The Art of Unix Programming" can be achieved in a shell like OS/400's.  I challenge you to name one thing you can do in those goofy teletype shells that can't be done in as OS/400 style shell.

anon
Wednesday, January 21, 2004

" I challenge you to name one thing you can do in those goofy teletype shells that can't be done in as OS/400 style shell."

Use non IBM terminals?

njkayaker
Wednesday, January 21, 2004

>> "Use non IBM terminals?"

Back in 1993 there was some sort of terminal emulator that I used to work from my PC at home.  Today, I still know people at that company, and everyone uses a PC with nary a terminal in the building.

anon
Wednesday, January 21, 2004

English is so complicated. Who knows what words with cryptic names like "i", "you", "it", mean? Why do they have to be so short? Just to save a few syllables?

I wish "i" were replaced with "PrsnFrst", "you" with "PrsnScnd", and "it" with "ThngLast".

And sentences! There are a million ways to organize them! I wish there was one rigid structure:

[Subject] [Verb] [Object]


</troll>

A one-size-fits all approach leads to a slow interface that  doesn't really fit any given task well at all.

Unix is like English. Common things are simple. It's hard to learn. But once you do learn it, you can express powerful things quickly and easily.

Mike Schiraldi
Wednesday, January 21, 2004

"* There are no retarded flags!  Shell commands have parameters!  If you forget the parameters, hit F4, and a list of named argument fields is displayed. "

Egg f'ing zactly!  Try that with "man set"  where command "set" does different things dependant on which shell you are in. 

Can you imagine if IBM would have tried to make OS400 as portable as Unix.  Who in the hell would run Unix if they could run something decent like OS400.

*nix weenies can rant all they want, but they're still weenies.

Mike
Wednesday, January 21, 2004

Mike Schiraldi posts:
>> "Unix is like English."

I mean, I don't even know how to respond to something like this.  I can't believe someone would compare an artificial language to English.  English is groovy for writing your hep cat, beatnik poetry, and it's super swell if you're trying to capture the myriad nuances of the complex tapestry that is romantic love.  It's not so darn useful, though, if you're trying to move a value from the processor to a memory location.  If you're doing something like that, you're not going to want the expressiveness necessary to distinguish between the subtle shades of exactly how you feel about moving the value. 

Dude, when I want to copy a file, I just want to copy the file, I don't want to be impressed at how ultra-creative the Berkeley hippie was who created the bebop shell command.

anon
Wednesday, January 21, 2004

I personally think that Unix systems value code that is useful to the people BUILDING THE SYSTEM, not for those who are just trying to write software for the darn thing.

Unix is, and has always been, a work in progress. If you don't want to put on a hard-hat and start welding, you'd best stay out.

Me, I just want to get my job done, ya know?

Chris Tavares
Wednesday, January 21, 2004

* Oh, and as I recall, the AS/400 compiled it's programs to some intermediate language years before Java or .NET.

Yup, that's a feature IBM compilers had since at least the early 80's; "What once was old is new again."

MR
Wednesday, January 21, 2004

have any of you guys ever had sexual intercourse? in your lives? do you think you ever will?

Biff.
Wednesday, January 21, 2004

>> "have any of you guys ever had sexual intercourse? in your lives? do you think you ever will?"

When I have sexual intercourse, I generally want to have it with someone sleek and elegant, easy to communicate with, and responsive to my requests - a low maintenance beauty.  I tend to stay away from sex with crusty old, wrinkly Berkeley hippies from the 60's, with hideous growths, who only respond to my advances if I beg in just the right way.  If you don't beg these smelly old bags in exactly the correct fashion, who knows, they might just erase all the files in your directories.

The moral of the story:  In women and operating systems, if you're smart, you choose the ones with pleasant UIs. 

anon
Wednesday, January 21, 2004

Yes, there are IBM terminal emulators (our company has used them forever too).  But it's still the peripheral/emulator accomodating the OS (i.e. the OS is inflexible).

njkayaker
Wednesday, January 21, 2004

"Dude, when I want to copy a file, I just want to copy the file"

But what about when you want to copy a directory? How about when you want to copy a directory and include all subdirectories? Except those which are symbolic links? And when you want it to print out the names of the files being copied, so you can follow progress? Or when you don't want the names being printed, so you don't get fifty pages of output? And when you want to preserve timestamps? Or when you want the timestamps of the copied files set to the current time? Or when you want to be prompted about making a backup? Or not prompted, having the file overwritten?

Should i be forced to type
CPYF (in, out, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE)
or somesuch? I'd rather type "cp -rv in out".

Mike Schiraldi
Wednesday, January 21, 2004

>> "Should i be forced to type CPYF (in, out, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE)?"

Why the heck do have eight explicit parameters?  Do you think that IBM doesn't have the technology to implement new-fangled 'default values' in its OS shell or something? 

You've obviously never used OS/400, but then again, this is a trait of all Unix Holy Warriors.  "Even if I've never seen or used it, if it's not Unix, it must be purged!  If it's not 1970's teletype, it's not developer friendly.  Come fellow Unix users, we will fight the great Jihad to rid mankind of usable UIs!  You will be assimilated by the command prompt!"

anon
Wednesday, January 21, 2004

"Me, I just want to get my job done, ya know?"

Remember Shlemiel the Painter (from http://www.joelonsoftware.com/articles/fog0000000319.html)?
Here's an epilogue:

"Schlemiel, you can save an unbelievable amount of time and energy on something you spend all day doing if you'll just learn the technique of moving your bucket."

"What? That's too complicated. I'm a painter. Why should i have to learn about buckets just to be able to paint? Here in the real world, we have jobs to do, and i can't waste time fooling around with bucket-moving."

Mike Schiraldi
Wednesday, January 21, 2004

Mike Schiraldi:

I suppose when you wrote 'epilogue", you meant "summary".  But, at any rate, your encapsulation of "Shlemiel the Painter" cautionary tale is nonsensical.  An accurate recounting of the moral of the story would be:

As a developer, make sure you know what's going on under the hood, because you might be surprised by the inefficiency of some of the underlying code you never see.

When speaking to the usability of a UI, what's happening under the hood has absolutely no bearing.  ABSOLUTELY NO BEARING!  The 'CpyF' command is doing the same thing as 'cp' command, only you don't need the my ultra-Unix-geek-secret-decoder-ring to use 'CpyF'.

Geez!

anon
Wednesday, January 21, 2004

anon, you have never had sexual relations.

BIFF.
Wednesday, January 21, 2004

BIFF-ster:
I believe the answer to your droll, sophisticated & bitingly sarcastic question was provided in an earlier post...  But please, keep posting.  We all benefit from your incisive commentary.

anon
Wednesday, January 21, 2004

anon, you said you "want" to have it with streamlined (?) women. you didn't say you actually had it. I stand my ground. you are still a virgin, and will most likely stay that way. do you make enough money to afford hookers?

BIFF.
Wednesday, January 21, 2004

Ah-h-h-h, touche BIFF-inator; I've sustained another deep cut from your rapier wit.  Indeed, I fear, a fatal cleavage, BIFF-man.  Alas, BIFF-orama, I an unarmed man in a battle of wits with someone of your caliber.  I acknowledge defeat, and regrettably cede my point.  You have demonstrated, beyond all shadow of a doubt, that Unix has a far superior UI, and so should remain as it is.  On this day, let it be written that, for all of eternity, the most elegant and usable UI is the teletype.  Woe is me BIFF-yTheVampireSlayer.  Woe is me!

anon
Wednesday, January 21, 2004

When i said "epilogue" i meant "epilogue" -- as in, "A short addition or concluding section at the end of a literary work, often dealing with the future of its characters."

The point was, i often hear people say, "This tool sucks -- it's hard to use, and i don't want to take the time to learn how to use it, because unlike you, i have Real Work To Do." Oftentimes they're being foolish, because the time spent reading the manual would pay off a thousandfold in time saved through new efficiency.

Larry Wall calls it "false laziness."

Mike Schiraldi
Wednesday, January 21, 2004

>> "When i said 'epilogue' i meant 'epilogue'"

If you meant 'epilogue', why did you write a summary?  And BTW, the rest of your post is nonsense.  Please address the point.  For crying out loud, all things being equal, you'd have to be a complete f'ing idiot to waste hours of your time reading a manual to use VCR #1, when you can spend five minutes using the  intuitively designed VCR #2 TO DO EXACTLY THE SAME THING!

anon
Wednesday, January 21, 2004

I'm starting to think you're a troll, since what i wrote is clearly an epilogue, not a summary.

Re: VCRs, if #1 takes one minute to program but requires thirty minutes of manual-reading, and #2 takes five minutes to program but no manual reading, you're better off with VCR #1 if you intend to recording much.

Mike Schiraldi
Wednesday, January 21, 2004

seriously anon, I think you should save up for some hookers.

it is obvious from your postings that you are still a virgin.

getting laid will give you some perspectives on what is and isn't important. you should think about it, before it is too late.  having to pay for sex isn't anything to be ashamed of. this is a tough industry for meeting girls.

BIFF.
Wednesday, January 21, 2004

>> "I'm starting to think you're a troll, since what i wrote is clearly an epilogue, not a summary."
Fine, whatever.  I don't want to argue about that which is irrelevant.

>> "VCRs, if #1 takes one minute to program but requires thirty minutes of manual-reading, and #2 takes five minutes to program but no manual reading, you're better off with VCR #1 if you intend to recording much."

* First, there's no reason to assert that VCR #2 would take any longer to program.  In fact, if we leave the analogy for a moment, when constructing a long sequence of commands, there's every reason to believe that, since OS/400 does syntax checking up front, you'll save all the time you'd waste on a teletype going through the command looking for that missing space, or dash, or whatever.

* Second, if it's a high-end recorder, there's going to be a lot of functions you don't use on a daily basis, but which you'd like to use occasionally.  Every time you use a new function, or every time you forget the ridiculous sequence of button pushes required for an occasionally used function, you can add more and more hours of manual reading onto your user experience.

* Third, again leaving the analogy aside, on even your most used commands, odds are you don't remember every stupid flag.  Not necessary in OS/400.  F4... fill in the blanks... you're done.  In Unix, man CMD... read page after page of unformatted nonsense... finally find the obscure flag you're looking for... back to the command line... mistype argument... back to man...

anon
Wednesday, January 21, 2004

I think "BIFF" is right, anon. Renting some hookers would be a good idea.

yikes
Wednesday, January 21, 2004

Ah, i thought your point was, "AS/400 is better because it's easy and intuitive, even though getting stuff done may be slower and more plodding." That's the core of our disagreement -- if i believed that a seasoned AS/400 user could get things done as quickly and easily as a seasoned Unix user, i would agree with your other points as well.

But i don't think that could be the case. For example, this F4 menu does not sound like it could be anywhere as fast as "cp -rv in out". So it pops up a menu of options. How do you get to the option you want -- down arrow? What if there are thirty options? Hit it dozens of times? Hold it down and try to time it so the cursor stops in the right place?

Even if there are hotkeys, this must make shell scripting a mess.

And i can't see how pipelines could possibly be easier. I type "x | y | z<enter>" and i have a pipeline. What's the AS/400 equivalent? "x out (tmp)<enter>y in(tmp) out(tmp2)<enter>z in(tmp2)<enter>"? That's an awful lot more to type, and a lot more opportunity for typos.

And using intermediate files is no substitute for pipelines. What if someone else is using "tmp" as their filename? Or what if you don't want to leave the file laying around, don't have the disk space, or are worried about clobbering an existing file -- you'll have to try to make up a seperate unique filename each time. Yuck.

Mike Schiraldi
Wednesday, January 21, 2004

Responding to a question made dozens of comments ago (but same day, I believe)...

I found this website to be quite useful in understanding the difference between /usr /home, /var, etc.  (also /etc).  It turns out there's an official standard.  All of a sudden I got it. 

Filesystem Hierarchy Standard.
http://www.pathname.com/fhs/2.2/

Will
Thursday, January 22, 2004

Well *sigh* why don't you just write an OS/400 shell for *n*x?


Thursday, January 22, 2004

"why don't you just write an OS/400 shell "

There is the prevailing Unix attitude. You don't like our half finished house with the standard bath, add on your own bath. Some people just want shelter, not to fiddle with plumbing.

man man
Thursday, January 22, 2004

>> "So it pops up a menu of options. How do you get to the option you want -- down arrow?"

The parameters are input in actual fields on the screen; tab three times to get to the beginning of the third parameter field.


>> "For example, this F4 menu does not sound like it could be anywhere as fast as "cp -rv in out"."

Mind you, you need not hit F4.  (I only used it because I was a newbie.)  Only hit F4 in the cases when you'd need to consult a man page - and I don't think that there's any argument that man pages are awkward and clumsy.  Otherwise the command looks exactly like a UNIX command.  Perhaps there are four or five extra characters you have to type.  I don't believe for a second that that will add much burden to a typical developer's routine when using familiar commands...  And suppose it did.  Suppose that 'CpyF' is so much more of a burden to type than 'cp'.  You can create your own custom commands on the fly in OS400.  Rename the 'CpyF' command to 'cp'.  Change the default parameters.  Add extra parameters; add extra functionality by associating a shell script to the command.  OS400 shell is as configurable as Unix shells.  Seasoned AS400 users, I'm sure, only use F4 as much as seasoned Unix users use man pages.


>> ""What's the AS/400 equivalent? "x out (tmp)<enter>y in(tmp) out(tmp2)<enter>z in(tmp2)<enter>"? That's an awful lot more to type, and a lot more opportunity for typos."

OS400 isn't bound by 1960's teletype technology.  If you want to execute fifty commands in a row (see a previous post) type the fifty commands on separate lines.  Each line will be verified for syntax as you type - which drastically cuts down on typos - and then hit enter.  If you decide that this is a useful sequence of fifty commands and you'd like to keep it, open a new source file, hit the 'recall' command key, save, compile, and you're set with a fancy new script (or CL program, I think they're called).


>> "And using intermediate files is no substitute for pipelines."

I don't know if, out of the box, OS400 supports pipes.  Maybe somebody who uses it can fill us in. 

But even if OS400 doesn't support pipes, that doesn't change my argument one iota.  My argument is not that we should all be using OS400, it is that if the Unix culture *really* valued code useful to other programmers, there would be an OS400-like shell.  My point is that Unix culture values the cryptic nature of their retarded shells (most likely so that the mediocre among us can maintain job security) more than it values developer friendliness. 

This isn't the 1960's, and our human-computer interaction shouldn't be bound to teletypes just because Unix lacks the imagination to create a better mousetrap.  (For that matter, what's up with Windows?  The same argument applies to MS.  If they cared about developers, there would be a much more robust character based shell.)

anon
Thursday, January 22, 2004

"Some people just want shelter, not to fiddle with plumbing."

Those people can use OS/400. Why should someone else do something for you?


Thursday, January 22, 2004

"Why should someone else do something for you?"

Er... because you pay them! Not everyone uses free software. Some people like to "outsource" kernel issues to a vender.

m
Thursday, January 22, 2004

"why don't you just write an OS/400 shell " 888

I like that idea for a spare time project.  How do you start up an open source project?  Anyone done that before?

anon
Thursday, January 22, 2004

I'm finding the comparison of a UNIX interface to a teletype to be something of a straw man.  I don't think anyone uses a teletype any more.  Even finding a green-screen terminal takes a little doing.  Last I checked, we had lots of nice screen interaction, full screen editors, and even GUIs.  Maybe I'm wrong, and those weren't GUI applications that I was using on my OpenBSD box.  Maybe that copy of emacs was all an acid-induced Berkeley dream.

I also thought I saw something about a TSO port to Linux.

As for the whole intercourse issue, I really think that some people's time would be better spent doing it with a partner than doing it to the quality of discussion on this board.

Clay Dowling
Thursday, January 22, 2004

>>> (For that matter, what's up with Windows?  The same argument applies to MS.  If they cared about developers, there would be a much more robust character based shell.)
<<<

Well, it's coming. Take a look at session ARC334 at
http://msdn.microsoft.com/events/pdc/agendaandsessions/sessions/default.aspx

Chris Tavares
Thursday, January 22, 2004

"I like that idea for a spare time project.  How do you start up an open source project?  Anyone done that before?"

Starting coding.  When you have an alpha-level product completed, come back I'll tell you what to do next. 

Almost Anonymous
Thursday, January 22, 2004

*  Recent Topics

*  Fog Creek Home