Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought I understood what the term Unix programming meant, but now, after reading about it in a kernel/C programming context, I feel like I need to clarify the meaning of this term.

It is not clear to me if it means:

  1. Shell programming,
  2. Unix programming tools,
  3. a particular way/pattern of programming Unix command-line tools (e.g, to agree with the pipeline way of "Unix shell programming"), or
  4. something else.
share|improve this question

closed as off-topic by Gilles, polym, jasonwryan, Braiam, cuonglm Aug 1 '14 at 1:49

  • This question does not appear to be about Unix or Linux within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

You'll have to give a bit of context. Where did you read this expression? Out of context, I'd say it means programming for a Unix OS. – lgeorget Jul 31 '14 at 16:14
This question appears to be off-topic because it is about basic English. – Gilles Jul 31 '14 at 23:12
@Gilles Oh so that is a delimiter now :P – goldilocks Aug 1 '14 at 2:49
up vote 12 down vote accepted

"Unix programming" refers to programming explicitly for a unix environment. This would include programming for shells that conform to a relevant standard (such as POSIX). However, it would also include programming in any language whilst making explicit use of system interfaces and resources that are similarly standardized, presuming that these are specific to the *nix world.

For example, network programming without a third party library in C or C++ is not portable, because neither standard says anything about it. Networking in C/C++ is implemented using an interface dictated by the operating system, and on while on *nix-ish systems this is more-or-less universal, you cannot port that code unchanged to (e.g.) Windows, and vice versa. Hence, doing network stuff in C or C++ means using a portable library, or targeting a platform, and Unix is one possibility in the later case, hence, that's "unix programming" (and C or C++ programming, and network programming).1

However, networking programming in many higher level languages such as perl or python or java is portable; these languages are generally implemented in C, but while the details of the implementation differ from platform to platform, the interface does not. Therefore you can write networking code in perl that should run on any system on which perl runs; on a Unix system, this is translated by the interpreter implementation into the appropriate native calls, and on a windows system, it will be translated differently. Since your actual perl code is not specific to anything but perl, it's not unix programming. It's network programming, and perl programming, but not unix programming.

1. Because of the intimate historical relationship between C and Unix, the fact that C has been the language most used to write operating systems generally, and the nature of what an "operating system" is, there's a lot of stuff in the category "OS specific C programming" -- another everyday example besides networking is filesystem oriented stuff, such as statting files and reading directories. Hence, there's various "Unix Programming in C" type books around, because basic programming in C inevitably involves a lot of OS specific elements. This is not the case with more portable languages such as perl or java; in this case, the subject of the book will likely be "Systems programming in Perl", or more likely, just plain "Programming with Perl".

share|improve this answer
prof goldilocks strikes again! – mikeserv Aug 1 '14 at 0:58
Thanks @goldilocks, this indeed answers my question ;) – Brandt Aug 5 '14 at 10:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.