33

I've been programming both in Unix and Windows environments. Mostly I've worked in Unix, where I've learned Unix Philosophy, which can be summarized as

  • Write programs that do one thing and do it well.
  • Write programs to work together.
  • Write programs to handle text streams, because that is a universal interface.

There seems to be a clear difference in programming cultures between Unix and Windows worlds, for example:

  • GUI vs CLI
  • Registry vs config files
  • Lots of tools specializing for any given need vs group of generic orthogonal tools which can combined

Is there equivalent of "Unix philosophy" in Windows world? What Unix-programmer can learn from Windows or should be aware of when moving to programming in Windows?

I would like answers to focus on the best practices of Windows programming (and not a fight between Windows and Unix).

Maglob
  • 3,839
  • 1
  • 24
  • 27
  • 15
    Should be aware of? "Things will suck, suck bad." – Orbling Feb 07 '11 at 08:23
  • You'll see a lot of functionality duplicated from Unix... poorly, only accessible through restrictive interfaces and basically what Orbling said, nah I'm kidding, Windows is great! – ocodo Feb 07 '11 at 09:06
  • 3
    Only one philosophy that, there is no philosophy. ;) – Mudassir Feb 07 '11 at 09:47
  • 6
    Actually Powershell has brought some of the Unix philosophy into Windows, particularly writing small programs (actually cmdlets in Powershell) that only do one thing, and combining them with other cmdlets that do other things. Of course, most casual users still don't know how to use Powershell, but that kind of depends on what kind of software you're writing. – JohnL Feb 07 '11 at 10:27
  • 5
    We will get it right the third time. – aufather Feb 07 '11 at 14:50
  • 8
    The philosophy of Windows is to bring revenue to Microsoft. – dan04 Feb 08 '11 at 14:15
  • What is powershell?:) – Herr Jun 25 '11 at 12:55
  • Worth noting is that while powershell does indeed add several of these points, the Unix concept of 'everything is text' is not one of them. Everything in powershell is an object. This has advantages and disadvantages. It's generally disliked by long time Unix fans. – Magus Apr 17 '14 at 18:01

7 Answers7

29

There is actually something like "Windows philosophy". Mostly it is about the composition concept and the user interface part - design programs for users not for other programmers.

That means:

  • Simple and intuitive user interfaces
  • Natural workflow
  • Should work out of the box
  • No technical knowledge required there where it is not required

Here is a good read:

Biculturalism

With the proliferation of Windows the hacker approach to coding started to become unfavored. First it was writing C/C++ programs in the most complex and obfuscated manner, so that only the hardest brains could understand them, as a sort of a rite of passage. Under Windows things started to change and that "code style" is now highly unfavored. Not sure if its direct Windows influence or rather the new level of understanding of the code quality, but at least timely they coincide.

  • 7
    I don't think any of those bullet points apply particularly well to Windows. – Tom Hawtin - tackline Feb 07 '11 at 13:10
  • 4
    @Tom: It's a philosophy; it need not apply to anything. Nevertheless, I believe it applies very well to most things in the Windows world. – Allon Guralnek Feb 07 '11 at 13:21
  • @Tom I agree with @Allon more because to me it seems like the OP's question is more Console vs GUI programming. – gideon Feb 07 '11 at 13:26
  • 7
    What?!? Take a look at good old BSD and AT&T sources. Clean, simple, elegant. And I've never seen anything more obfuscated than a typical bloated MFC code. – SK-logic Feb 07 '11 at 17:39
  • Even tough there is no single correct answer, I liked this one best. Joel's blog post was great. – Maglob Feb 08 '11 at 09:59
  • It is more like, design programs for total-beginners not for experts.That is, it is better that a noob can use it, and then never develops any farther, than it is for a noob to struggle, but get better and faster over time. It is optimised for the first 3 to 4 weeks. In user interaction design there is to types of easy to use: Easy to learn, and easy to use. The first one is practices far to much. – ctrl-alt-delor Jul 22 '22 at 09:48
8

I think the differences you alude to in your question are more about the users of these systems than the programming styles of their developers. For a long time, *nix has been the field of either the programmer or the computing enthusiast. There was very little in the way of "casual" use. Where as Windows has [home] user numbers orders of magnitude greater.

Casual users don't want to remember a dozen different command line flags to run a program. They want to click on a button.

Casual users don't want to worry about their systems configuration files, or how Fluffy Kitties remembers their favourite breed of feline.

Casual users will generally use something as long as it does what they want, even if there are "better" products available.

I think my main point here is... Windows is very much about creating for the user, rather than the creator. Don't go against the long-standing paradigms that exist in Windows development. Don't pollute the users My Documents with crap, or insert yourself into their startup for no reason.

Maybe of a similar importance: write user documentation.

TZHX
  • 5,052
  • 2
  • 25
  • 32
  • 7
    User documentation? Users of successful programs won't ever have to touch any documentation. –  Feb 07 '11 at 08:49
  • @Developer Art - this is true to a point, but when you're writing software for say, particle physics that has to be understood by people of various nationalities, the ability to say "click here for description of what we do with your data here" if easier than writing a telepathic computer that will be able to extract the users expectation from their mind. – TZHX Feb 07 '11 at 08:54
  • 3
    "Don't pollute the user with crap." - fairly ironic. – ocodo Feb 07 '11 at 09:08
  • 1
    how so, Slomojo? – TZHX Feb 07 '11 at 09:11
8

Raymond Chen's blog, The Old New Thing, and his book with the same name is a great insight into the philosophy, history, and best practices of native Windows programming.

Andreas Rejbrand
  • 1,791
  • 1
  • 10
  • 7
4

Compromise & Customize

It isn't the best at anything, but if you are willing to put in the time and make some unpalatable decisions in some places there is little you cannot make it do. If you do not like what it is currently doing you can probably change it. There are few places where there is only one way or even a way that is always best.

Good enough for the user to start

Very few things are phenomenal out of the box, but most things are usable. Unix tends to go the direction where nothing works until you configure it and Apple makes everything pretty polished, but at the cost of some configurability / flexibility.

Expect a log support tail

Windows users do not upgrade just because there is a newer version. They don't even always upgrade because of a vulnerability or bugfix. Windows users often need to be forced to upgrade, but if you force them to upgrade quickly they will seek alternative products

Users have a vast range of skill levels

Unix has a high perceived barrier to entry from a technical level from the point of view of a casual home user. Apple had a very low perceived required skill level, but does not encourage the casual user to do much in the way of customizing their OS. Windows is in between. It is only slightly harder to begin using than Apple products, yet there is a lot of simple information available, sometimes right in the install itself, on how to go about changing some pretty in-depth system configuration. This leads to a rather random skill level in the middle tier of users because if they are confident enough to try something there is a good chance they can figure out how to do it. It also leaves the more timid users without any experience in some cases because they are wary of the warnings that things my go wrong.

Bill
  • 8,330
  • 24
  • 52
3

Windows was built with explicit support for IBM's Common User Access (CUA) standard to guide application development.

Which, of course, was an attempt to create a Mac-like experience for the user.

Steven A. Lowe
  • 33,808
  • 2
  • 84
  • 151
1

UNIX long ago was for programmers and people like that and windows always was for users who don't know how to write bash scripts.

Therefore, in Windows you should care about users, that means make one tool for all task, so that the user does not need to worry how to configure programs to work together.

lennon310
  • 3,132
  • 6
  • 16
  • 33
Dainius
  • 340
  • 1
  • 8
0

I'm not sure if it's a philosophy, but IMHO there's a sort of density of thought that goes with Windows programming. There's also a sense of surprise at how things work sometimes.

I'd recommend patience if you're embracing Windows development, and taking a bit more care about your assumptions.

John Bickers
  • 773
  • 3
  • 7