DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Difference between programming for Linux and Windows?  (Read 14,146 times)

zridling

  • Friend of the Site
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,299
Difference between programming for Linux and Windows?
« on: January 08, 2007, 12:59 PM »
I can't code my name, but I need to be informed: What is the difference between programming for Linux and Windows? Especially the same program. I ran a second Linux box for years, but never made the full switch because several of my most used apps throughout the day aren't coded for Linux. Is it difficult? Do you have to go to 'Linux' school? About the best article I could find was Biculturalism by Joel Spolsky:

What are the cultural differences between Unix and Windows programmers? There are many details and subtleties, but for the most part it comes down to one thing: Unix culture values code which is useful to other programmers, while Windows culture values code which is useful to non-programmers.... This is, of course, a major simplification, but really, that's the big difference: are we programming for programmers or end users? Everything else is commentary.
- zaine
« Last Edit: January 08, 2007, 01:01 PM by zridling »

Josh

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,411
    • Gathering Badge
    • Official Forum Clown
    • Coding Snacks
    • Plugin Coding Medal
    • Volunteers/Staff
    • Military Service Badge - US Army
    • Furry Fandom Badge - Furry Fandom
    • Linux User
Re: Difference between programming for Linux and Windows?
« Reply #1 on: January 08, 2007, 01:06 PM »
win32 style: CreateProcess( <insert 58 million arguments to give the programmer the illusion he has alot of control );

unix style: fork();
Strength in Knowledge

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Difference between programming for Linux and Windows?
« Reply #2 on: January 08, 2007, 01:18 PM »
@Josh  -  Solid!  :Thmbsup:

@Zaine  -  The architecture of programming itself is really very simple. Read >> Process >> Write.  The only difference is really just syntax, so pick your best (most comfortable) language and have at it and see what happens.  Does that help?
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: October 20, 2010, 12:08 AM by CodeTRUCKER »

zridling

  • Friend of the Site
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,299
Re: Difference between programming for Linux and Windows?
« Reply #3 on: January 08, 2007, 01:28 PM »
Now see Farmsteader, that's just it: I don't know. I don't even know enough about programming to ask the question in a specific way, other than the example of writing the same program for each OS platform.
- zaine

tinjaw

  • I'm so glad breakbeat techno isn't an illegal drug
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Military Service Badge - US Army
    • Linux User
Re: Difference between programming for Linux and Windows?
« Reply #4 on: January 08, 2007, 02:22 PM »
Maybe a simple diagram will help frame the question better.

application
---------------------------
API Layer
---------------------------
operating system
---------------------------
drivers
---------------------------
hardware

So when you write a program you have to go through the API (Application Programming Interface) layer. So, even though you use the same programming language (say C++) and eventually end up compiling down to the same machine level code for the CPU (say x86) you get there via different paths.

A concrete example would be writing a program to simply open a window/frame to put your applications GUI (Graphical User Interface) into. The code to do that is different depending on what operating system (and what windowing platform) you are using.

It's a little more complicated than that, but that should provide a good basis for an understanding.

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
Re: Difference between programming for Linux and Windows?
« Reply #5 on: January 08, 2007, 02:36 PM »
Zaine,

Here's an opinion from Paul Turley, creator of the IBasic, EBasic, and Aurora programming languages.  These languages are all designed to create self-contained Windows executables.  Aurora is being further developed by Paul to run on Linux.

I'm sure that some programmers will disagree, but that's what makes it fun.


"Linux is worse for the programmer, always has been.  It is dependancy hell as there are hundreds of libraries that an application may depend on that are not included on all distributions.  It is up to you to package these libraries into .deb or rpm distributions."

http://www.ionicwind.com/forums/index.php/topic,1017.0.html
Software For Metalworking
http://closetolerancesoftware.com

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Difference between programming for Linux and Windows?
« Reply #6 on: January 08, 2007, 02:57 PM »
Ok, right... I thought I just didn't know how to read the instructions on the Redhat box. :P
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: October 20, 2010, 12:19 AM by CodeTRUCKER »

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Difference between programming for Linux and Windows?
« Reply #7 on: January 08, 2007, 03:05 PM »
Josh: you do get a lot of control with the WIN32 API, though - thing is you don't need it most of the time. You can probably do (most of) the same under *u*x, but then you need to hunt down multiple functions to get the same effect; somewhat clearer code, but more user<->kernel transitions.

Then there's the issue of library hell - which is much worse than windows DLL hell has ever been. And if you're a commercial developer who's not into the GPL commie club, it gets much worse - either pay for special commercial license of libraries, or rewrite functionality that's on windows to begin with.

And good luck shipping a binary, with all the various library versions around, which are sometimes incompatible ABI-wise.

Documentation - sucks. manpages are horrible, texinfo only slightly better, so you end up googling trying to find a html'ized version. And no, "aprospos" isn't really a solution.

That said, platform specific stuff can usually be abstracted if you think about the problem in the right way. Even for advanced stuff like I/O Completion Ports, FreeBSD has /dev/kqueue and linux has /dev/epoll ... well, if the user has a recent enough kernel version (I be there's more people running 2.4 kernels without epoll than people running win9x :), though ).
- carpe noctem

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Difference between programming for Linux and Windows?
« Reply #8 on: January 08, 2007, 03:13 PM »
BASIC: Beyond All Sense, Incomprehensible Crap. Donald Knuth, iirc, has quote where "BASIC" and "brain damage" go together. Yes, fortunately today's BASICs are less hideous than the original ones, but it's not something you should touch unless you have to (ie., VB required for a job).
- carpe noctem

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: Difference between programming for Linux and Windows?
« Reply #9 on: January 08, 2007, 04:09 PM »
BASIC: Beyond All Sense, Incomprehensible Crap. Donald Knuth, iirc, has quote where "BASIC" and "brain damage" go together. Yes, fortunately today's BASICs are less hideous than the original ones, but it's not something you should touch unless you have to (ie., VB required for a job).

I haven't touched BASIC in 27 years, and I am still scarred by it. For whatever reason, my first instinct is still to think in BASIC code rather than whatever language I am working in. And I am not referring to VB either...I am talking about that BASIC stuff they taught in schools back in 1980.  :-[

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Difference between programming for Linux and Windows?
« Reply #10 on: January 09, 2007, 05:15 AM »
BASIC: Beyond All Sense, Incomprehensible Crap. Donald Knuth, iirc, has quote where "BASIC" and "brain damage" go together. Yes, fortunately today's BASICs are less hideous than the original ones, but it's not something you should touch unless you have to (ie., VB required for a job).
I agree the BASIC on the old C64, TI994A, etc. was arcane, but the Emergence BASIC that Mike has crafted his fine app with and I'm really getting excited about is a whole new animal.  For me, it has made programming fun again.
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: October 20, 2010, 12:24 AM by CodeTRUCKER »

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Difference between programming for Linux and Windows?
« Reply #11 on: January 09, 2007, 10:48 AM »
Fortunately, todays BASICs aren't as bad as the original; you can do relatively structured programming in BASIC today, rather than the intertangle GOTO mess and line numbered source of yore.

There's still problems with the mentality, though. I can't remember the specifics since it's many a years since I had to deal with VB, but if you look at some problems and the recommended solutions - christ. No doubt that things can be done cleaner, but when the general responses on "teh intarweb" (or even a teacher) are kludges, things are bad.

There's also a lack of expressiveness in the BASICs I've seen. This again leads to kludges ("use a DLL"/"write it in inline assembly") rather than working with the BASIC language itself. Either you have a pretty bare-bones BASIC that isn't much interesting, or you have one of those frankensteinian BASICs that includes everything and the kitchen sink - or you have to rely on external libraries, probably written in C.

There's hybrid BASICs, but then you might as well use a better language :)

It might not be total brain damage to learn some programming with one of the more modern BASICs, but you'll have to ask yourself how much of the knowledge you can re-use if moving on. Especially if it's one of the frankenstein BASICs with a zillion library functions to make life easier.
- carpe noctem

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Difference between programming for Linux and Windows?
« Reply #12 on: January 10, 2007, 03:23 AM »
The real acronym goes this way... Beginner's All-purpose Symbolic Instruction Code. <CT winks at f0dder>

Maybe an exploration into the world of coding would be most instructive and helpful? 
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: October 20, 2010, 12:18 AM by CodeTRUCKER »

zridling

  • Friend of the Site
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 3,299
Re: Difference between programming for Linux and Windows?
« Reply #13 on: January 10, 2007, 06:13 AM »
Fantastic links and analogies, thanks guys! The last languages I learned was my freshman year in college — FORTRAN and COBOL — and by the time I graduated the Mac hit the market, two years later home PCs were affordable, and FORTRAN and COBOL were worth a warm cup of donkey spit.

But Farmsteader I'm not looking to start programming. I honestly don't have the brain capacity for it. But you're right, I'd love to spend the next two years weaning myself completely off of Windows. Apps like UltraEdit, NewsLeecher, ACDSee, Screenshot Captor, et al. may run quite well under Wine or Codeweavers Crossover. Hardware, drivers, etc., are another challenge. But it was this thought that motivated the question of the difference between coding for them.

I've always thought of the difficulty of switching from the installation and hardware side; that is, until a Linux distro (which, compiling proprietary drivers with Open Source software goes against the whole idea for the most part) can make it as easy to install a program and change hardware as Windows does, then it's still the province of those who have time. If it were simple, I'm sure more software devs would simply port their apps to Linux. But that's not the case as Michael Rainey and I know about UltraEdit!
- zaine

CodeTRUCKER

  • Bush Flying... where I'd rather be.
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,086
    • Participated in NANY Challenge Once
    • Military Service Badge - US Navy
Re: Difference between programming for Linux and Windows?
« Reply #14 on: January 10, 2007, 08:05 AM »
Hey Mike!  Ever had a crack at the *new* UE Studio?  I'm curious as to how it adds, if anything, to the standard UE?
DISCLAIMER - I have made and make many threads for questions and even project posts across the Internet. Unfortunately, many are in limbo because I cannot remember where they are at. If anyone knows of an open thread or an unanswered inquiry, please PM me. Thank you.
   
Notice: Unless stated otherwise, I receive no compensation for anything I post here.
« Last Edit: October 20, 2010, 12:13 AM by CodeTRUCKER »

mrainey

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 439
Re: Difference between programming for Linux and Windows?
« Reply #15 on: January 10, 2007, 11:32 AM »
I haven't looked at UE Studio.  Not really being a hardcore programmer myself, I'm happy keeping three or four source files open in UltraEdit and compiling my project as needed from the IBasic IDE.  Pretty basic stuff (no pun intended).  ;D
Software For Metalworking
http://closetolerancesoftware.com

Original address: https://www.donationcoder.com/forum/index.php?topic=6929.0