Thread: Mozilla C++ Portability Guide - comments please

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    88

    Mozilla C++ Portability Guide - comments please

    I know now most C++ build in features and I did chose C++ as my programming language because it`s fast and used for most programs I like and because it`s portable across platforms...

    Please read Mozilla C++ Portability Guide [warning]It`s much, only do if you are interested and bored - I don`t want to steal your time.[/waring].

    Is it really so hard to to write good code? Or is this just overdesign or just their rite?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Nah, I think they just sit there, smoke some <insert smokable stuff here> and make up some arbitrary rules about how to write code.

    Seriously, yes, writing well-working code that is truly portable to a multitude of machines is very difficult. Since all compilers have their own quirks (non-compliance with standards for example) and bugs (generates incorrect code if you do "the right thing"), if you have enough code, you will run into all of these problems at one point or another.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    A couple things to note. First, that was written in 1998 and updated a few times since. That means that they are quite possibly trying to support compilers available back then that have not been updated much since.

    Second, if an application is going to be uber-portable, then it might need to follow such strict rules. But many applications only need to support recent or relatively popular Windows, Linux, Unix and Mac OS's, and they only need to support one compiler per platform. That means that if you've got a good, modern compiler like gcc that works on the OS's you want to support, then you can write code that works on that and not worry so much about handling ancient or broken compilers.

    So if you want portable code without writing uber-portable code, then stick to standard code, standard libraries and libraries that support the platforms you want to support. There's no need to follow Mozilla's rules unless you are writing for applications that have the same requirements.

  4. #4
    Registered User
    Join Date
    Jul 2007
    Posts
    88
    Btw, what are those 25 different machines? I could not found it in their wiki.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Several linux flavors, windows, mac, BeOS, Solaris, OpenVMS, BSD and its derivatives, probably also some unix flavors,...

    And then there's the world of minicomputers and mainframes... which dwarfs the microcomputers world in terms of OS availability.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Mozilla EULA
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 09-17-2008, 12:43 PM
  2. removing comments of type '//' and '/*'
    By rohit83.ken in forum C++ Programming
    Replies: 3
    Last Post: 10-20-2007, 02:24 AM
  3. I love Mozilla
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 27
    Last Post: 05-25-2004, 07:11 AM
  4. The Art of Writing Comments :: Software Engineering
    By kuphryn in forum C++ Programming
    Replies: 15
    Last Post: 11-23-2002, 05:18 PM
  5. Program Portability (code portability)
    By Perica in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2002, 10:03 AM