Slashdot Mirror


Applications and the Difficulties of Portability?

insane_coder asks: "I'm a software developer who writes a lot of freeware utilities in C/C++ which are all cross platform and work well. Lately some of my users have been pestering me to stop wasting precious development time supporting minority OSs like Linux, and get more work done for the majority — the Windows users. Now all of my utilities are simple tools that perform various operations on files such as compression or rearranging. I've also made a few frontends for them using the excellent Qt library to allow the user to select a file and process using a simple GUI. In the dozens of applications I wrote, most of them several thousand lines long, I haven't written a single conditional for any particular OS. When I release, I just compile each app for all the OSs I have access to and post them on my website. I barely expend any effort at all to achieve portability. So the question I have to ask is: Why do the masses perceive portability as something that requires effort and a waste of time?" "Most applications don't do anything fancy or need to talk to devices and therefor there is no need to do anything special other than compile them on a particular OS to run on that OS. So why are there so many simple apps using native APIs to do simple things like file reading instead of the standard ones? Why are we projecting an image that one must go out of their way or switch to a different language in order to achieve portability?"

145 comments

  1. Leaky Abstractions. by Anonymous Coward · · Score: 0

    How about because the differences are difficult to hide.

  2. As long as by Anonymous Coward · · Score: 0

    the API for getting the first post on slashdot is simple enough, who cares? :)

    1. Re:As long as by Morphine007 · · Score: 1

      oh, I'm sorry, but thanks for coming out.

  3. It's Windows development tools by Todd+Knarr · · Score: 4, Insightful

    It's the Windows development tools. By default they generate code that uses tons of Windows-specific APIs that aren't portable to anything but another version of Windows (and sometimes not even then). If you start with OS-specific code, then yes supporting other OSes looks difficult. Combine this with Microsoft's business need to make portability look as difficult as possible to discourage developers from aiming for it and the results are predictable.

    1. Re:It's Windows development tools by RAMMS+EIN · · Score: 1

      Also, Windows is the odd one out in that it doesn't support the POSIX API out of the box. Many other OSes have at least enough support to make portability easy, including some non-Unix-like OSes, such as VMS, BeOS, and SkyOS. Having said that, you can get POSIX functionality on Windows by installing Cygwin or Services for Unix.

      --
      Please correct me if I got my facts wrong.
    2. Re:It's Windows development tools by borfast · · Score: 5, Interesting

      Exactly. Add to that some ignorance from those people who say it's difficult to write portable code (perhaps because they have only ever been exposed to that confusion of code generated by MS tools) and you get a mass of people who are willing to sacrifice the minorities for... well, for nothing, really, because they won't get anything more than they already do - but they don't know this. They think that dropping support for other platforms will allow the developer to focus more on the functionality or stability of the software.

      And these people are not necessarily your average fresh-out-of-school programmer. Sometimes even people with several years of experience fall into this category and refuse to work on cross-platform code because they say "it consumes more resources". An example I have dealt with recently is Garage Games and their Torque line of products.

      Garage Games makes game engines and they used to announce on their website that their game engines run on Windows, OS X and Linux. Long story short, the Linux version is far from the quality of the Windows and OS X counterparts (when it runs at all) and the company dropped Linux as a supported platform, "because it consumes too many of their resources". Instead, the Linux version is now supported by the community - but it bears the same price tag, nonetheless...

    3. Re:It's Windows development tools by radtea · · Score: 5, Interesting

      It's the Windows development tools...Combine this with Microsoft's business need to make portability look as difficult as possible to discourage developers from aiming for it and the results are predictable.

      Amen.

      I write only portable code (currently very happy with wxWidgets, and have used Qt in the past) but MS fud is so thick that I have at times had to convince clients that using platform-neutral code would be faster than an "all Microsoft solution."

      I've also encountered an amazing number of developers who have no real interest in writing good software. They simply want to do things the easiest way possible that requires the least thought, and MS caters to those people and always has.

      There is a delightlful ancedote told in a book by one of the guys who was deeply involved in the first Visual C++ release (the old C7.) At the time Borland owned the C++ compiler market on Windows, and MS was playing catch-up big time. The marketing people realized that the technical goodness and standards-conformance of the Borland compiler was only of interest to a small core of die-hard techies. The much larger market was C programmers who wanted to be able to call themselves C++ programmers. Thus were the Visual C wizards born. They made it easy for people who had no clue to create "classes" and pretend to get it (while putting everything into a single procedural method.) I wish I could recall the name of the book--it was one of the most unselfconsiously arrogant memoirs I have ever read.

      One response to the false belief that cross-platform code is not cheaper than single-platform code is to make the point that writing cross-platform code is quite different from porting code from one platform to another. Another is to remind people that we are dealing with Turing complete machines, so all functionality is always available on all platforms. This isn't actually relevant, but it will shut people up who don't know what they're taking about, and if we have anything to learn from MS it is that substance and quality mean nothing when put alongside a catchy argument.

      --
      Blasphemy is a human right. Blasphemophobia kills.
    4. Re:It's Windows development tools by Anonymous Coward · · Score: 0

      They made it easy for people who had no clue to create "classes" and pretend to get it (while putting everything into a single procedural method.)

      You mean like Ruby?

    5. Re:It's Windows development tools by achacha · · Score: 2, Interesting

      There are too many things you give up when writing portable GUI code, Qt is ok, wxWidgets is ok, Swing is ok, AWT sucks; using native GUI elements is by far superior. For example, to write a windows app that uses dockable floating toolbars that are easily customizable and contain custom controls within them is relatively trivial with windows and extremely painful if not impossible with ohers because such behavior is not native on other OSs. While you can get portable GUI apps to be very functional, it requires more work to extend the lowest-common-denominator tools.

      In the end it is not a question whether it can be done but rather how much work will it take to make it very usable and portable at the same time. I did it for a small app that ran on Windows, OSX and KDE as expected, looked a bit off on Gnome, then after getting Gnome right, OSX controls would not align, and so on. Eventually I just gave up with having to maintain 4 different VMs just to validate things work and now I just stick to WinXP/200x and work more on developing and less on making things portable. It's a matter of preference.

    6. Re:It's Windows development tools by reanjr · · Score: 1

      What about Windows isn't POSIX compliant? While I do not develope POSIX apps for windows, I do know that Windows has several subsystems to target for applications, one of which is POSIX (the other two major ones are Win32 and Console). Are you simply not aware of this, or is there something important missing from the Windows implementation? I have heard for years that Windows is compliant and to my knowledge you can't claim that without being true.

    7. Re:It's Windows development tools by N3Roaster · · Score: 2, Informative

      Have you taken a look at Qt recently? If I'm understanding your example correctly, that's fairly trivial in the Qt 4.x series as well. You can even customize them with CSS-like stylesheets.

      --
      Remember RFC 873!
    8. Re:It's Windows development tools by petard · · Score: 2

      You mean like this, available in C++ and Python for Windows, Mac and Linux?

      --
      .sig: file not found
    9. Re:It's Windows development tools by insane_coder · · Score: 2, Interesting

      I wrote some complex GUI code with Qt, and found it much easier than any APIs I saw for Windows. From what I've seen, it requires less work to use Qt.

      Overall I see Win32 API is just complex. I once was reading up on MSDN about how one would go about processing stdout from a child application. They presented like a 50 lines solution using many tricky looking calls. I ended up writing functionily identical code using POSIX functions like dup2() and fileno() (which Windows in fact does support right out of the box), in a dozen simple lines, and it was portable to boot.

      --
      You can be an insane coder too, read: Insane Coding
    10. Re:It's Windows development tools by segin · · Score: 2, Informative

      The POSIX subsystem is used by nothing but Services for Unix, and SfU applications cannot use native Win32 functions.

    11. Re:It's Windows development tools by A+beautiful+mind · · Score: 2, Insightful
      Add to that some ignorance from those people who say it's difficult to write portable code (perhaps because they have only ever been exposed to that confusion of code generated by MS tools)
      There are levels of portability and I wouldn't especially call code written for Windows, linux , osx/bsd "portable". Personally I think that portability has a natural tendency to emerge from already well written code. Most of what you call not portable is _downright stupid_ generally. Well, in most cases. Portability is very much similar to robustness. Things like, not assuming line ending to be "\n", etc.
      --
      It takes a man to suffer ignorance and smile
      Be yourself no matter what they say
    12. Re:It's Windows development tools by truedfx · · Score: 2, Informative

      In many languages, notably including both C and C++, line endings are always "\n". Even on Windows. All you have to do to make your application portable to Windows is make sure you open text files in text mode, and not in binary mode. The standard library will then make sure to change line endings as necessary if they are not externally represented the same.

    13. Re:It's Windows development tools by Anonymous Coward · · Score: 0

      Heh. :)

    14. Re:It's Windows development tools by Anonymous Coward · · Score: 0

      printf("%c", 10);

    15. Re:It's Windows development tools by truedfx · · Score: 1

      I don't know what value '\n' gets on Windows systems, only how it is externally represented, so I'm not sure your code would break on Windows. Even if it does, though, what's your point? If you have to resort to code of extremely poor quality to demonstrate that there is non-portable code, you're suggesting that clean code is portable. This is not necessarily true, and I strongly doubt it's even usually true.

    16. Re:It's Windows development tools by amliebsch · · Score: 1
      and SfU applications cannot use native Win32 functions.

      But if you're writing POSIX code for portability purposes, why would you be using native Win32 functions?

      --
      If you don't know where you are going, you will wind up somewhere else.
    17. Re:It's Windows development tools by callistra.moonshadow · · Score: 1

      Unfortunately the "masses" use Windoze. I'm one of those although I'm a Linux fan. I am also a Windoze developer/architect/manager of software development. At the end of the day what is easy for the masses is what *seems* to be popular. However, more *regular* people are reaching out and trying Linux as their base OS. It has been a slow growth, but gosh those roots are deep and strong.

      Cally

      --
      --Cally
    18. Re:It's Windows development tools by radtea · · Score: 1

      While you can get portable GUI apps to be very functional, it requires more work to extend the lowest-common-denominator tools.

      But once extended, they stay extended. Qt has been there for a while, wxWidgets is there for a vast array of applications. I personally hate dockable floating toolbars, and the apps I write do not require them, so I haven't felt your pain there, but the improvement in cross-platform toolkits in the past five years has been enormous. Even as I write this there is someone thinking about how to better implement dockable floating toolbars in wxWidgets, and my own experience with extending both Qt and wxWidgets has been that it is very easy, particularly due to their open nature.

      --
      Blasphemy is a human right. Blasphemophobia kills.
    19. Re:It's Windows development tools by Todd+Knarr · · Score: 2, Informative

      It's Posix-compliant at the most minimal level. When Microsoft designed the subsystem, it had one goal: be able to check off the "Posix compliant" item on the government purchasing checklist. It did not want Posix apps developed, because that would be against Microsoft's business interests, but it needed that compliance to technically qualify for government contracts. So it implemented the absolute minimum it had to to get the minimal certification and no more. And minimal Posix compliance is minimal indeed, being aimed at embedded devices.

    20. Re:It's Windows development tools by RAMMS+EIN · · Score: 1

      ``But if you're writing POSIX code for portability purposes, why would you be using native Win32 functions?''

      You wouldn't, but, AFAIK, it works the other way around, too: the win32 functions won't interact with your software, either. E.g. no communication between win32 and POSIX processes. I'm not even sure POSIX processes show up in the Windows process manager (I've been told they don't, but I haven't ever verified that).

      --
      Please correct me if I got my facts wrong.
    21. Re:It's Windows development tools by sowth · · Score: 1

      I believe it is a cr and lf (13,10). I think the other poster was pointing out some programmers just hard code an end of line by their systems ascii value, even though any given system may use a cr, lf or cr and lf together. The example was a bit bad, but that sort of thing does happen. It could be as simple as in an if or switch/case statement putting a 10 instead of '\n'.

      In reality, one should be adaptive when writing code. For writing, obviously \n should be used, but when reading it is best to check for all types. Make it work with cr or lf alone, but also make sure a cr/lf pair doesn't create two end of lines. In fact, having support for a cr/lf pair is important because many printers require both (at least they did), and IIRC, email / usenet messages use them as well.

      There are also many system constants, and some programmers use the numerical value on their system. Their programs don't work on a different system which uses different values. Though systems having different values is bad anyway, because it breaks binary compatibility, so standard values should be used by system designers when possible.

      Of course there are plenty of other assumtions which will break portability. The problem is, if a given programmer doesn't understand portability issues, they will make those assumptions and their code won't work for other systems.

    22. Re:It's Windows development tools by Ramses0 · · Score: 2, Informative

      Might it be this one: Rapid Development by Steve McConnell?

      I remember that story quite vividly as well: "When doing market research, we realized that mediocre people didn't want a real C++ compiler, they just wanted C++ on the box and *.cpp file extensions so they could bill themselves out ($$$) as C++ programmers. We then spent the next 5 years fixing all of our dork-isms in the C++ compiler to bring it up to standards, but that didn't matter because we had already crushed our competition by making flashy-promises and code wizards and being first to market with a non-compliant compiler." (or something to that effect).

      --Robert

    23. Re:It's Windows development tools by truedfx · · Score: 1
      I believe it is a cr and lf (13,10).
      No, that is the external representation, not what a C (or C++) program sees. End-of-line is always read (and written) as a single byte from (and to) text files in C, and that byte is always represented as '\n'.
    24. Re:It's Windows development tools by sowth · · Score: 1

      So you are saying the two bytes are magically shrunk into one? C isn't some high level language where the data is an abstraction. When you read a char array, you are really reading bytes in memory. The only case where such translation might happen would be a FILE* stream opened in text mode, but that would happen somewhere between the file read and putting it into the program's buffer.

      As for MS Windows, I haven't programmed on that OS, but I don't think they do this now. I know back in the DOS and Win3.1 days, it was indeed two bytes. I doubt they just up and changed it unless they wanted to conform to some standard and used either a cr or lf. (Standard MS? Pffft, yeah right) But I'm sure they don't bother to translate the two chars into one. I'm just not sure if it was 13 and 10.

      Unless you are using some funky compiler I've never heard of. If one exists, I don't want to have anything to do with it. Such nightmare with binary data compatiblity...

      Easy way to solve this. Try an experiment in Windows:

      void main(void) {
      char *c,*str="\n";

      for(c=str; *c!=(char)0; c++)
      printf("%i",(int)*c);
      printf("\n");
      return;
      }

    25. Re:It's Windows development tools by truedfx · · Score: 1
      So you are saying the two bytes are magically shrunk into one?
      Magically? Of course not. It's effectively a trivial search-and-replace operation performed by the C standard library. As for your code, it's broken. Firstly, main() returns int, not void. Secondly, you're calling printf() without including <stdio.h>. These are easy to get right, with or without any warnings your compiler may provide. Your code is also rather poor style, with the redundant casts, missing indentation, and const incorrectness. And more, it simply prints "10", on Windows XP, using Pelles C. If you believe this is specific to Pelles C, feel free to give a counterexample.
    26. Re:It's Windows development tools by sowth · · Score: 1

      Okay, so they changed it. I'm sorry for posting. Though I don't think translating like that is a good idea, but then MS is full of bad ideas. I remember trying my first CGI script. I made the mistake of using notepad. I found out the hard way MS adds some unprintable mystery character to the start of the file.

      1. I used voids because I didn't want to waste time writing extra crap. The argv and return crap where not necessary. I olny put in the voids because I knew some compilers would complain if I didn't. Programmers have been doing this since the beginning of time.
      2. Yeah, so I forgot the include. I was using an unfamiliar environment for code. I tested it quickly (in Linux) and my compiler didn't complain. So sue me.
      3. The casts are not redundant. I am used to compilers which complain if you don't cast properly. (even with printf) If you wanted to take out redundancy, the appropriate lines should be char *c="\n"; for(;*c;c++)...
      4. I didn't indent becuase it sucks to get indentation right with html. C isn't python anyway. The compiler doesn't check indentation. It would be a waste of time. If you have trouble reading it, maybe you should go back to CS class. Maybe you should attach your style guide if you think everyone should follow it. Most people will ignore it since you aren't their employer.
      5. In my original post, I was talking about their binary representation, not what they are translated to. My response was because I was already pissed in general, but you seem to have an interesting habit of correcting people when they don't need to be corrected. Unfortunately, I have the same flaw.
      6. I was going on old information. I haven't programmed on MS OSes for a while, and much of that was in assembly. I already admitted that but you didn't seem to know either.
      7. Not specifying str as a const works fine in the real world everywhere I've seen. You may lose the address of the original string if you change the value, but if you do that, you probably didn't want it anymore. If a compiler complains about that, it is being purely pedantic.
      8. Apparently you aren't perfect either professor, because you missed the fact I forgot a space where it prints. If there were two or more characters in the string, they would've print out 1310 instead of 13 10.
    27. Re:It's Windows development tools by truedfx · · Score: 1
      Okay, so they changed it. I'm sorry for posting. Though I don't think translating like that is a good idea, but then MS is full of bad ideas.
      I'm pretty sure changing text streams so that end-of-line always appears as a single byte was already done before the MS-DOS days. No point in blaming MS.
      1. I used voids because I didn't want to waste time writing extra crap.
      "int main()" is a character shorter than "void main()"; you don't need to actually have a return statement nowadays. (Yes, really.)
      2. Yeah, so I forgot the include. I was using an unfamiliar environment for code. I tested it quickly (in Linux) and my compiler didn't complain. So sue me.
      Unfortunately, too many people use this as a criterion for what is correct. (I'm not saying you're one of them.)
      3. The casts are not redundant. I am used to compilers which complain if you don't cast properly.
      At the very least, you could write *c != '\0'.
      4. I didn't indent becuase it sucks to get indentation right with html. C isn't python anyway. The compiler doesn't check indentation. It would be a waste of time. If you have trouble reading it, maybe you should go back to CS class.
      Just so that I'm understanding right, you're saying indentation is a waste of time?
      Maybe you should attach your style guide if you think everyone should follow it.
      I don't think everyone should follow my style guide. I think everyone should follow a style guide.
      5. In my original post, I was talking about their binary representation, not what they are translated to.
      Yet I clarified right from the initial post that I was not talking their external ("binary") representation.
      My response was because I was already pissed in general, but you seem to have an interesting habit of correcting people when they don't need to be corrected [slashdot.org]. Unfortunately, I have the same flaw.
      Indeed I do. I'm not sure this was the case here, though. The poster I replied to (A beautiful mind) seemed to make a misleading claim that would lead to less portable code. When this whole story is about portability, commenting on that seems appropriate.
      6. I was going on old information. I haven't programmed on MS OSes for a while, and much of that was in assembly. I already admitted that but you didn't seem to know either.
      Sorry for the confusion. I don't usually program on MS systems either, but not never.
      7. Not specifying str as a const works fine in the real world everywhere I've seen. You may lose the address of the original string if you change the value, but if you do that, you probably didn't want it anymore. If a compiler complains about that, it is being purely pedantic.
      Instead of "char * const str", I meant declaring "char const * str". You're not allowed to modify what str points to, and trying to will cause the program to abort on several systems, so declaring str so that you cannot has a clear benefit.
      8. Apparently you aren't perfect either professor, because you missed the fact I forgot a space where it prints. If there were two or more characters in the string, they would've print out 1310 instead of 13 10.
      I don't recall claiming to be perfect. Anyway, you're now holding what you consider a mistake in your own code against me?
  4. Portability Isn't Hard by RAMMS+EIN · · Score: 5, Informative

    For the most part, portability isn't hard. You can write pretty much all the functionality of your software without getting into platform-specific issues. Generally, the higher the level of abstraction a languages is at (assembly C Python), the easier it gets. Of course, you do have to use standard APIs and avoid platform-specific ones (win32, GNU extensions, etc.) Things that have caused trouble for me in the past:

      - Sockets (BSD sockets vs. Winsock's almost-compatible variant); this is not a problem in most higher level languages
      - GUIs (there isn't really a standard; perhaps wxWidgets?)
      - Threads (POSIX threads vs. whatever Windows has)
      - Processes (fork, AFAIK, really doesn't exist on Windows)

    If I need any functionality that isn't readily portable, I usually target POSIX or BSD, which makes my code portable to many *nix variants, and Windows using Cygwin.

    Of course, there are also a whole bunch of cross-platform libraries out there, like glib, the APR, SDL, Qt, ...

    --
    Please correct me if I got my facts wrong.
    1. Re:Portability Isn't Hard by kevin_conaway · · Score: 1
      GUIs (there isn't really a standard; perhaps wxWidgets?)

      I made the mistake of choosing GTK+ for my application. Only after a while did I realize that GTK+ doesn't run natively on OSX. If I had to do it all over again, I'd probably choose Qt.

      If you're using Java, Swing is usually a pretty safe bet

    2. Re:Portability Isn't Hard by dkf · · Score: 1
      Things that have caused trouble for me in the past:

      - GUIs (there isn't really a standard; perhaps wxWidgets?)

      There's no possible standard way to produce a GUI that "works right" (i.e. how Joe Ordinary User expects on each platform) portably across all platforms. The problem is that different platforms have thoroughly different UI metaphors for things like modal vs. non-modal dialogs and stuff like that. Make your app work right on one platform and it will clunk on another. Your best choice is probably to develop different GUIs for different platforms, and that's hardly what you'd call portable...
      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    3. Re:Portability Isn't Hard by Twylite · · Score: 5, Informative

      I think you've identified on most of the major areas that cause portability problems, with the possible exception of endianness. Since I actively maintain software under Windows, Linux and Solaris, let me add some comments:

      If you're developing a GUI application then a decent GUI library will handle most of your problems. Libraries like wxWidgets and QT provide cross-platform GUI widgets as well as thread creation and synchronization primitives. They usually also provide socket abstractions, or you can use another cross-platform library like ACE.

      Things get more hairy when you enter the realm of server applications and high performance. Software written for *nix is pretty much straightforwardly portable to Windows, but not the reverse.

      The difference is in the schedulers, which affects processes, threads, synchronization, and blocking and non-blocking IO. In a nutshell the Windows scheduler deals with threads and not processes, is a fair scheduler, and a thread can block on multiple conditions simultaneously.

      That should be a lot to digest, so let me try to explain that statement and its implications:

      First a disclaimer: I am going to talk about *nix in generalisations, because both Linux and Solaris support a variety of schedulers and the default scheduler can change between versions, and userland and kernel threading libraries behave very differently.

      ONE: The Windows scheduler schedules threads. Processes are merely containers for threads and their address space, access tokens, etc. Processes are not scheduled. This means that a multithreaded process on Windows has fundamentally different time sharing characteristics to a *nix application. The characteristics would be most similar to a multiprocess application in the *nix world. Most *nix schedulers I have encountered schedule processes first, then schedule threads within the process.

      TWO: The Windows scheduler is "fair" -- it is a multilevel queue with round-robin at each level. Threads with a higher priority will always preempt those of a lower priority, and priority elevation is used to prevent starvation.

      A number of *nix schedulers use a n adaptive algorithm that favours historically busy processes. This means that a producer-consumer approach may work well on a Windows system, but experience high latency on *nix (note: not reduced throughput under load, but increased latency). Such an approach can work on *nix, but must be implemented differently.

      Both Linux and Solaris can be set to use round-robin schedulers (e.g. Solaris's real-time class process), but this can degrade overall system performance.

      THREE: A thread can block on multiple objects simultaneously. I said "conditions" before, but I'd prefer to get more specific. A Windows thread can wait for the end of another thread or process, a mutex, and event (like a condition in *nix), an IO operation, a semaphore, a timer, and a couple of others. The thread can also block under any one, or all, of a number of objects are in the signalled state.

      Compare that to *nix where you can wait on one of anything except for IO, where you can use select (or poll or dev/poll or kqueue) to wait on multiple non-blocking file descriptors. kqueue is a little more functional, but to my knowledge still doesn't support synchronization objects. If you are using SysV semaphores you can wait for multiple semaphores to be signalled.

      This has huge implications for application design. On Windows you can have a consumer thread wait on multiple producer threads using one mutex per consumer to control synchronization. All threads can be awoken from any wait state by a global event to inform them of reconfiguration, shutdown, etc. This is quite trivial, and is a straightforward and easily understood design.

      Move the same design to a *nix platform and you have problems. First your consumer thread can't wait on multiple producers without some radical changes (use could pipes rather tha

      --
      i-name =twylite [http://public.xdi.org/=twylite], see idcommons.net
    4. Re:Portability Isn't Hard by RAMMS+EIN · · Score: 1

      ``I think you've identified on most of the major areas that cause portability problems, with the possible exception of endianness.''

      I always make sure my code is endianness-clean. I have big-endian and little-endian systems at home. Same goes for word size, although I occasionally write code that requires a 32-bit system, and I don't always support sizes other than 32 and 64 bits.

      --
      Please correct me if I got my facts wrong.
    5. Re:Portability Isn't Hard by Todd+Knarr · · Score: 1

      Item One is actually wrong, as far as Linux is concerned at least and likely most other Unixes aside from Sun. On Linux and most of the *BSDs, threads are processes at the kernel level. The only thing special about them is that all the threads in a "process" happen to share address space, file descriptors and a bunch of other things. The schedule doesn't care about all that, though, to it a process with 12 threads is simply 12 processes to schedule, each with it's own priority and other scheduling characteristics.

      The whole threads vs. processes dichotomy actually sprang from Windows. In Unix, processes were traditionally lightweight and fast to create. In fact, the original fork() call essentially created what today we call a thread, sharing address space with it's parent. Only after exec() did the address spaces split. Unix programmers just forked processes as needed, and the overhead wasn't much. If we needed to share address space, well, we had shared memory and mmap() and similar things that were easy enough to use when needed. Then Windows came along, with it's process model inherited from VMS. VMS and Windows processes were huge, ungainly beasts that were expensive to create. You simply couldn't create multiple processes without unacceptable overhead. So Windows invented threads to dump most of the overhead when you needed a new execution thread but could share address space and such. And everybody asked "Why doesn't Unix have threads?", and simply refused to accept "Because it doesn't need them.". So Unix finally acquired threads to satisfy the buzzwords, and Unix programmers continued doing what we'd been doing since the mid-70s, just calling pthread_create() instead of fork().

    6. Re:Portability Isn't Hard by sowth · · Score: 2, Insightful

      This is a big problem, and I think it is because many toolkits don't have generic functions. They require a developer to specify pixel locations, font sizes, or similarly low level things.

      A toolkit should ask for generic information and format it in the proper way for a given OS. You should not be indicating toolbars, menus and widgets. You should only need to specify what functions are made available and the name, icon, etc associated with them, the toolkit should put these into menus, toolbars, or whatever a user would expect. For dialogs, you should only need to specify the names of fields / questions and what is expected as the answer (a number, string, file, yes/no, etc) and what fields relate to the others. The toolkit should decide how the dialog is rendered. In fact many of these things are very common and should be included inside the toolkit. Yes all of them have file dialog boxes, but why not go a step further and integrate it into the menu? Just have a function which specifies a callback for say "open file" or "save file" and when activated the toolkit places the options in the appropriate places--the menu, toolbar, Alt-S hotkey, Ctrl-X/Ctrl-S seqence, on a disk widget for a 3d environment, wherever.

      Generalizing things in this way would allow programs to be made which work on text screens, 2d GUIs, 3d GUIs, braille/text to speech systems, audio only voice recognition/text to speech, web interfaces, and many more. All without special consideration or modifying the program. Yes, programs which require graphics (such as photo editing) would not work on a text screen, but the toolkit could just raise an error in that case or display ascii art if that is the user's preference. End application programmers should not have control of those things anyway.

    7. Re:Portability Isn't Hard by ckaminski · · Score: 1

      I have to agree with you here. The event dispatching model windows has for intrinsic primitives is unmatched in my opinion. But in hindsight, it had to be, even socket support, as the nature of Windows itself and it's message dispatching discourages waiting on synchronization primitives. If a message loop needs to keep running to prevent screen lockups, you cannot be waiting on File or Socket IO.

      Having never used AIO, if what you say is true, I'm sorry to say I expected more...

    8. Re:Portability Isn't Hard by ctzan · · Score: 1
      In Unix, processes were traditionally lightweight and fast to create. In fact, the original fork() call essentially created what today we call a thread, sharing address space with it's parent. Only after exec() did the address spaces split.

      I fact, that is absolutely wrong.

      If you read that crap in a book, burn it and go get the Unix v.6 and 7 source code.

    9. Re:Portability Isn't Hard by Todd+Knarr · · Score: 1

      I got that from the way the earliest versions of the fork() function worked when I began programming on Unixes (specificially 2.1BSD, although we quickly upgraded to 2.3BSD).

    10. Re:Portability Isn't Hard by ctzan · · Score: 1

      vfork() is not fork().

    11. Re:Portability Isn't Hard by Anonymous Coward · · Score: 0

      You are incorrect. UNIXs and Linux do not use a thread model, they use a process model. If any of them have threads, they have been crudged on top of the process model.
      Windows NT uses a thread model.

    12. Re:Portability Isn't Hard by Todd+Knarr · · Score: 0, Flamebait

      I didn't say vfork(), did I? vfork() came later, in 2.9BSD.

    13. Re:Portability Isn't Hard by ctzan · · Score: 2, Interesting

      yes, you said fork() and fork() NEVER EVER worked as you describe.

      I supposed you were just mixing up vague recollections about vfork()
      and its limitations (sharing address space until execve(), etc) with
      vague recollections about copy-on-write pages in the child & stuff,
      and you were just confused by the whole thing.

      But no, you're deliberately spreading misinformation and don't
      care about that --

      Is it so humiliating to admit you're wrong ?

    14. Re:Portability Isn't Hard by statusbar · · Score: 1
      Some of the windows synchronization/threading system is not well thought out, however. For instance I hate the race conditions when sending a message to a thread via PostThreadMessage() - before the thread calls the GetMessage() function, the message queue is not allocated!

      The Event objects are always problematic; see: boost's rationale for not using events.

      And there is no nice way to use the window's primitives to create a multiple-reader / single writer semaphore, like there is with the posix threads style.

      Not to say that the posix style of messaging is wonderful or anything, though.

      --jeffk++

      --
      ipv6 is my vpn
  5. A better question by Demona · · Score: 1

    If they won't believe or accept your response when you tell them how little effort portability requires, why should you care about their false perceptions? For instance, is it a concern that others will believe the non-programmer over you and make decisions which will have a negative impact on you?

    --
    Fuck Slashdot
    1. Re:A better question by insane_coder · · Score: 1

      >If they won't believe or accept your response when you tell them how little effort portability requires, why should you care about their false perceptions?
      It is annoying that users bring it up over and over again despite myself telling them there is no effort involved.
      I'm also concerned with the programming community as a whole that we're somehow projecting an image that portability is just too hard.

      >For instance, is it a concern that others will believe the non-programmer over you and make decisions which will have a negative impact on you?
      Most certainly not. However some of them are programmers in themselves who say they'll contribute if we have a more focused target platform. It seems apparent to me that somehow the new kids on the block aren't being educated properly.

      --
      You can be an insane coder too, read: Insane Coding
    2. Re:A better question by Anonymous Coward · · Score: 0
      It seems apparent to me that somehow the new kids on the block aren't being educated properly.


      Bingo, see my reply below:

      http://ask.slashdot.org/comments.pl?sid=207008&cid =16878364
    3. Re:A better question by Arker · · Score: 1

      You might try making a FAQ entry. Most people won't read it before they speak, of course, but that way when they speak your reply can be much quicker - simply a pointer to the FAQ.

      --
      =-=-=-=-=-=-=-=-=-=-=-=-=-=-
      Friends don't let friends enable ecmascript.
    4. Re:A better question by Sigma+7 · · Score: 1
      It is annoying that users bring it up over and over again despite myself telling them there is no effort involved.


      As mentioned previously, create a FAQ entry - and include links to sites known to host cross-platform projects (such as Sourceforge, Freshmeat, etc.) or major cross-platform applications (e.g. Firefox).

      I'm also concerned with the programming community as a whole that we're somehow projecting an image that portability is just too hard.


      Portability is not hard, nor is there such a projection taking place (except from automatic code generators.)

      If you take a look at comp.lang.c and comp.lang.c++, most posters to that newsgroup will refuse to answer questions concerning Windows, in the same way they refuse to answer questions about POSIX sockets. At first, you may feel limited but you will also learn tactics to isolate non-portable code from your program.

      However some of them are programmers in themselves who say they'll contribute if we have a more focused target platform.


      You already have a "focused" target platform - it's called QT. Likewise, I already have a focused platform for some of the applications I write - it's called "Platform independant", which is supposed to compile on any platform that I can access. The easist method for my platform is to contain all platform specific function calls to a specific section of the source code.

      What they really mean is that they will help out if you program exclusivly for their platform. In this case, reprogramming the application for that single platform will take more time then keeping the current trend.

  6. Re:Easy steps to portability: by Anonymous Coward · · Score: 0

    Alternativly:

    1. Attach wheels

  7. Users expect computers to be hard by njchick · · Score: 1
    Remember a recent comment about a person for formated his hard drive after having read that all drives must be formatted before use?

    The problem is, people expect computers to be hard. They expect that there is some knowledge that they should be looking for. Some users look for solutions to their problems on Google before (and often instead) checking the documentation. And then they write bugreports to the author and describe how their tried to avoid problems in long forgotten versions of the software because somebody described it in a blog.

    My pet peeve is users asking "What am I doing wrong?" when reporting a real bug. Users expect to be wrong about computers.

    This is just another case of people expecting things to be harder than they are. Plus a bit of jealousy towards the "minority OS" users who must be wasting time of the genius programmer. Deal with it. It's a psychological problem.

  8. Because a lot of the time it's true by Watson+Ladd · · Score: 1
    Your applications don't need to do stuff that differs wildly from OS to OS. While portable platforms like GNUStep exist, a lot of features don't integrate tightly. And even seemly portable code can have problems, ex
    int i=1;
    i << 1;
    cout << i;
    . When heavily optimizing, you will need to make different tradeoffs on different architectures. So while a lot of time it's not a big deal, like for games, for some applications, like firewalls, porting will involve a lot of reading the fine manual.
    --
    Inventions have long since reached their limit, and I see no hope for further development.-- Frontinus, 1st cent. AD
    1. Re:Because a lot of the time it's true by perkr · · Score: 1

      Out of curiosity, what are the portability problems with the code you gave? That the shift may behave differently on different CPU:s? (I am thinking of Endianess).

    2. Re:Because a lot of the time it's true by DimGeo · · Score: 1

      Nope. A shift always does the same even on differently endianed systems (of course, the binary representation will be different, but the numerical value will be the same). What makes a difference is storing the integer into a file using a pointer to it and writing out sizeof(int) bytes. That will break when you move from a big-endian to a little-endian system, and will break when sizeof(int) changes. Also, combining bytes into an integer should generally work (using and | ), though you should mind word sizes, etc., but will break if you use union-s like union {unsigned int x; struct {unsigned short a, unsigned short b} y;}...

    3. Re:Because a lot of the time it's true by CableModemSniper · · Score: 2

      That's not what the code does though. cout i is like printf("%d", i). The only "portability problems" with the GGP post's code sample might be character encoding issues.

      --
      Why not fork?
  9. Ugliness? by Tadrith · · Score: 2, Interesting

    I personally agree that if you're going to release something command-line based, it shouldn't matter at all. I myself am a software developer, and while my applications are not cross-platform, I certainly appreciate those utilities that are. In my case, what I'm doing is not simple and highly specialized, so cross-platform doesn't do anything for me except make more work for no reason. My applications are not things that anybody else would find useful aside from the people I am making it for.

    Most people, when they run an application on Windows, expect it to react in the same old Windows way. Many of cross-platform libraries do a poor job of doing that. I personally don't use GAIM because I can't stand the way it looks. Even though complaining about the ugliness of the GUI might seem stupid to some, it is a genuine problem with people. Clearly, it makes some form of different, as evidenced by the ever increasing "beautification" of window managers like KDE and Gnome.

    It may be that this bugs me more than most precisely because I am a developer. It may be that it bugs ordinary people even more. I have no idea. But I think that increasingly the transparency of external libraries would probably help gain them acceptance. The problem is made even worse by libraries that clutter up your system by popping up and asking you to update, or add entries in your menus that you'll never need, as a user.

  10. Java propaganda by Anonymous Coward · · Score: 2, Insightful
    So the question I have to ask is: Why do the masses perceive portability as something that requires effort and a waste of time?"


    Because all they teach in schools now is java. They have all bought into Sun's propaganda. The students don't know any better and believe what they are told.

    You are absolutely correct in your approach, well written C/C++ code will compile and run on just about any modern OS and results in the most efficient and fastest applications.

    Another reply above also makes a good point that too many people depend on libraries and third party code that is specific to their development platform. Depending on third party code and libraries is absolutely foolish, however the majority of programmers expect a free lunch when it comes to writing applications and expect someone else to do all the work for them, then wonder why things go wrong.

    You pose an excellent, yet rhetorical question and it illustrates perfectly the absurd redundancy of java which claims to be cross platform but really is not, all it does is waste system resources and ecourage you to depend on inefficient and probably broken classes written by other people.

    Don't change a thing about how you work, it is the right way to go no matter what the java zealots tell you.
    1. Re:Java propaganda by jonabbey · · Score: 2, Insightful

      You pose an excellent, yet rhetorical question and it illustrates perfectly the absurd redundancy of java which claims to be cross platform but really is not, all it does is waste system resources and ecourage you to depend on inefficient and probably broken classes written by other people.

      Where did this rant come from? The o.p. didn't mention or allude to Java at all.. it was a question about why people think that cross-platform development effort is hard/useless.

      Are you saying that people only think cross-platform development is hard because.. Java has clouded mens' minds? You're not really saying that, are you?

    2. Re:Java propaganda by SanityInAnarchy · · Score: 1
      Depending on third party code and libraries is absolutely foolish

      You know what? You're right. I'm writing my next app in hand-coded binary, written in my own hex editor, just so I don't have to depend on anybody else's code.

      </sarcasm>

      I agree in part -- don't depend on libraries you can't control. But do depend on libraries to which you can get the source code -- that way, if there's a problem, you can fix it, and if there's no problem, you just saved yourself a whole shitload of work.

      And by the way, why did you bring up Java at all? Sure, Java can easily be cross-platform, but was the word even mentioned before you went on this rant? How, exactly, does Sun propaganda suggest that portability is hard?

      --
      Don't thank God, thank a doctor!
    3. Re:Java propaganda by insane_coder · · Score: 2, Insightful

      I wouldn't blame it solely on Java. Some of it may be that some C++ programming classes today won't even teach the standard file manipulation libraries such as fopen() or std::fstream, but instead teach Win32 API method to open a file.

      Regarding 3rd party libaries, depending on some of them is actually a good idea. The zlib library for example is indispensible, hence why almost everything uses it.

      As for what Java zealots tell me, just yesterday someone mentioned to me I should switch all my C++ apps over to Java because Java has a string library and I won't have to mess around with char arrays anymore. The new guys aren't even learning what C++ has, demonstrated by C++ having a string library very similar to what Java has, yet they don't even know about it.
      And with C++, if one sticks to std::string and the rest of the STL for the most part, all the "it's easy to leak memory" arguments are just a load of FUD. I regularly give my programs a full workout with valgrind and I'm happy to see that they don't leak a single byte of memory. Which in itself is a great reason for portability, valgrind doesn't exist on Windows, yet my Windows users benefit from it because they get solid applications.

      I really wish though there would be some way to get the new and/or clueless programmers to realize all of this.

      --
      You can be an insane coder too, read: Insane Coding
    4. Re:Java propaganda by DeQuincey · · Score: 1

      I believe it's a misunderstanding about the reason that schools teach Java.

      If your goal is to teach students the concepts of object oriented programming, Java is a great choice. Last time I checked, the goal of CS isn't simply to teach specific programming languages and technologies. The aim is to teach students the important concepts they'll need to be sucessful in the field.

      Once you learn how to program, you can learn to do it any language.

    5. Re:Java propaganda by heinousjay · · Score: 1

      Well, you've proven there's nothing quite as inane as a language war. Thanks for your time.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    6. Re:Java propaganda by oSand · · Score: 1
      Depending on third party code and libraries is absolutely foolish, however the majority of programmers expect a free lunch when it comes to writing applications and expect someone else to do all the work for them, then wonder why things go wrong.


      So you're badmouthing java, even though it allows for cross-platform 3rd party libraries without even a recompilation. The problem with rolling your own is that it diminishes productivity, increases the complexity of your code and introduces more bugs than you'd otherwise have.

      all it does is waste system resources and ecourage you to depend on inefficient and probably broken classes written by other people.


      Yes, you could take that view. Or you might conclude that libraries supported by fulltime developers and used by millions of people would actually be more reliable than anything could produce.

    7. Re:Java propaganda by Peter+La+Casse · · Score: 1
      Where did this rant come from? The o.p. didn't mention or allude to Java at all.. it was a question about why people think that cross-platform development effort is hard/useless.

      Your parent poster was claiming that people think cross-platform development is hard/useless because Java marketing says "Cross-platform development is hard/useless, unless you use Java!" and lots of people (especially those who have only ever used Java) believe them.

  11. Ignore naysaying insects by petrus4 · · Score: 1, Insightful

    With a project of mine, I've had a ton of abuse at times. People telling me it's already been done a million times, that I'm duplicating effort needlessly, that I should just use a pre-existing solution to the problem, etc etc etc.

    The bottom line is that around 99.9% of human beings are small minded, brainless insects who are utterly devoid of intelligence, initiative, self-responsibility, creativity, or vision, and who in general terms don't really have any terribly concrete reason to exist. The one thing that said individuals *are* unfailingly good at however is coming up with reasons why you shouldn't do whatever it is you are trying to, why it will fail, why it's already been done before, or why nobody has ever been able to succeed at it before and why do you think you're any different, etc. Some forms of this abuse unique to the Linux community also include particularly vitriolic condemnation of anyone seeking any form of financially gainful activity associated with Linux.

    Slashdot itself is a particularly rich source for plentiful examples of these types of people, I've noticed.

    Although the level of repetition with which you will encounter this condemnation makes doing so difficult, I urge you above all to ignore it. Realise that in virtually all cases it will come from people whose sole reason for breathing is to accelerate the degradation of the environment, and that as such, all listening to them will do is reduce the chances of you actually doing some genuine good.

    If you're trying to accomplish something, realise that that in itself is an extremely reliable indication that you're an infinitely more intelligent and generally redeemable human being than those who are trying to dissuade you from a given objective. Looking at it from this perspective actually makes ignoring them a lot easier...you identify them as the vermin that they are, which then means that their opinion can likewise be summarily discarded.

    1. Re:Ignore naysaying insects by abigor · · Score: 3, Interesting

      Well, using Qt obviously makes a huge difference. Not only is it an excellent toolkit, but they do a tremendous amount of work to make things portable, so writing cross-platform code becomes a piece of cake. That's also why KDE 4 (which will hopefully end up as the first, "real" Linux gui) will run on Windows.

    2. Re:Ignore naysaying insects by Anonymous Coward · · Score: 0
      Some forms of this abuse unique to the Linux community also include particularly vitriolic condemnation of anyone seeking any form of financially gainful activity associated with Linux.


      While not a Linux zealot (I'm a QNX Zealot) I find those who try to make money on the charitable efforts of others rather repugnant. Especially when they do a bad job of it like RedHat who bastardises Linux and then has the gall to ask for money for it. I would not say I "vitriolicly condemn" parasites like RedHat but I certainly find them offensive.

      I guess if people are stupid enough to pay for something they can have for free, that's their problem and someone is bound to exploit them, if it wasn't RedHat or Novell, someone would fill the gap to exploit these painfully stupid folks. (probably mostly businesses who make IT decisions by committee)
    3. Re:Ignore naysaying insects by petrus4 · · Score: 1

      I guess if people are stupid enough to pay for something they can have for free, that's their problem and someone is bound to exploit them, if it wasn't RedHat or Novell, someone would fill the gap to exploit these painfully stupid folks.

      I see. Do you actually give any thought to how the people who write free software support themselves? I remember when Patrick Volkerding mentioned his illness here a while back...people seemed to spend more time calling him an idiot and accusing him of faking than anything else.

      You find it offensive that people attempt to monetise something that you say was written with charitable motivations; if you're talking about middlemen who don't add anything to the software themselves, I'd agree with you...but what about the actual authors of the software?

      A lot of people *have* made a lot of money through not generating any tangible good for other people...and I agree that that is a bad thing. That, however, is one extreme end of the spectrum. It sounds to me however that what you're actually advocating is the other extreme end...that people who write software don't have any right to be compensated for what they do in any way; and that if they therefore plan on eating, (or doing any of the various other things that require money in contemporary society) they'd better simply make sure they have another job...and if they don't, tough luck. It's not your problem, right?

      Are you really that selfish, or have you simply not thought this through?

  12. Users expect tab/slots to be hard by Anonymous Coward · · Score: 0

    "This is just another case of people expecting things to be harder than they are."

    Like sex.

    1. Re:Users expect tab/slots to be hard by njchick · · Score: 1

      I disagree. I haven't heard "What am I doing wrong?" in any context but computing.

  13. It depends. by Shados · · Score: 5, Insightful

    From the sound of the article/question, with their setup, it really doesn't seem like it is that big a deal to support multiple platforms. Plus, the knowledge is there, and they seem to enjoy it, its simple tools, etc. Why the hell not.

    Other environments (usualy very customer centric ones, let say consulting firms, with strict deadlines, marketing getting in the way, etc) and more complex applications with very specific needs, it becomes trickier. These are the environments where your job is hard even if you're only supporting one platform, and even using every single last specialised API the platform offers still let you wish for more. In those cases it becomes a bit more annoying to have to go with the lowest common denominator.

    Then add to that that users of different platforms -expect- different things. It isn't the end of the world to make something that works on both OSX and Windows, for example. But users of both platforms expect certain different things. I don't know the status right now ,but I remember even in Java a few years back, one had to add some specific arguments when running java apps so that the menu bar would be at the right place in OSX, otherwise it would end up more like KDE/WIndows/Gnome/etc, with everything inside the window by default.

    And last, but the most important one, testing, QA, etc. Doing cross platform, no matter what you do (unless you only do HTML and target Firefox only or something) means testing on those platforms, if only to look. That means moving the files, booting up the virtual machine, or something, to check it out. If the app is remotly complex, that IS time consuming like hell.

    So in the end, it really depends. If you release your app to the general public, then the advantages of cross platform often outweight the "cost", and its only a matter of time before we are -expected- to do it. When your audience is more limited though, you often benifit more from targeting one particular platform and optimising your workflow like crazy for it, the time saving is significant.

  14. third party interfaces by gfim · · Score: 2, Insightful

    I agree with what you say up to a certain point. But for anything complicated, there are always things that require some non-portable extension. The most common one I find is interfacing with third party software. On Windows, these often require the use of COM (or ActiveX, or whatever the flavour of the month is).

    --
    Graham
  15. Re:VHS? What's That? by goofyheadedpunk · · Score: 1

    Wrong story buddy.The story that you want to be inane in is here: http://slashdot.org/article.pl?sid=06/11/16/234022 4

    --

    What if the entire Universe were a chrooted environment with everything symlinked from the host?
  16. So stop supporting the minority users! by emag · · Score: 3, Insightful

    I, of course, mean the "some" users who seem to think that they should dictate what platforms your freeware runs on. Really, there might be a valid argument if these people were paying you gobs of money on each release, but they aren't. Since it won't exactly hurt you financially, I don't see the issue with telling them to take a long hike off a short pier, or probably the better approach of "I'll give your suggestions the consideration they deserve. Thank you."

    Alternately, here's a money-making opportunity... "Whichever platform raises the most money by $DATE will be the one that's supported" :-)

    --
    "The urge to save humanity is almost always a false front for the urge to rule." --H.L. Mencken
  17. Qt? For freeware? by Hortensia+Patel · · Score: 1

    I'm curious... assuming you really meant freeware (free-as-in-beer, closed source), how do you justify the price of the Qt libraries to yourself? I thought it was in the thousands per year per seat. Did you have a commercial license anyway for other projects, or are you just obscenely rich?

    1. Re:Qt? For freeware? by insane_coder · · Score: 1

      My frontends are all GPL'd so I just use Qt under the GPL license for them. For my main apps, some are open some are not, but I generally don't use Qt for them.

      --
      You can be an insane coder too, read: Insane Coding
  18. Ignore most of the replies by abradsn · · Score: 3, Insightful

    Basically, some people will say things like "Portability issues only happpen on Windows because of the use of Windows specific API.... and Linux somehow magically escapes this problem." I'm sure you are already aware that it is not true, because your code is portable and uses readily available libraries that do not vary in version, or in any major way at all from OS to OS. A buch of other people will say "All, code should be portable, because there is no reason for it to not be portable." And, I'm sure that from your post, this is the reasoning behind your question. So, here is a list of reasons that might help formulate an understanding of why some code is not portable... (bear in mind that a lot of my code is portable too, as that is usually indicative of good software practice) * Less portable code makes heavy use of API that is already written and tested inside the OS. * Less portable code can therefore be less expensive and quicker to produce. Depending on the circumstance this can be a long term and/or short term benefit. * Less portable code can be made to execute faster than portable code * Less portable code can be made to take advantage of hardware features that are only exposed through a specific API * Typically the most popular OS in the world is easier to program for by most programmers, thereby allowing everyone that is hired to get up to speed on the project more quickly. (Not a concern for a team of one) * Typically large projects need to make every advantage in efficiency that is readily available. This might or might not be dependant on the OS * Anything that has to do a lot of work with filesystems will need operating system dependant code to be written. There are faster file operation system calls for each specific OS. * Less portable code can be made smaller in size, by depending on libraries that are only available on a target OS. (As long as they are actually there!!!) For example in Windows you can take advantage of a bunch of API to change system settings like IIS settings, and smtp settings. In Linux you have to write code to manually change text files. Of course API are better here because then there is less chance messing up the format of the text file. And your code will work in the next version of the OS too. Your code will not work in the next version if you change the config files manually. In your case, you don't care because you are just writing little free utilities. In bigger enterprise level applications you need to care about things like this. There are many examples of needing to use API where-ever possible. More experience with bigger applications is the best way to get to this knowledge. Also, one final note. C is getting to be an old language now, and it is sad that any code written in C is not portable. Things that have been around that long, have workaround after workaround to make them keep from breaking. It almost requires effort to write C code that is not portable nowadays. Bad C code is still prevelant though. This is mostly due to the #define conditional that was included to make C a lasting language. It worked. Now let's be done with it. Moving forward, I would suggest a language that makes use of garbage collection as your next choice. Also, one with clean syntax and no workarounds already in place would be a good plan. These criterea make for a langauge that is more difficult to write stupid code in. If you ever have to maintain code, then these are good considerations. Here are some examples (in no specific oreder) Java, C#, PHP Here is a bad example C++

    1. Re:Ignore most of the replies by Sloppy · · Score: 3, Funny

      I didn't realize how hard portability could be, until today, when I found out that some platforms don't even let users break text into paragraphs.

      --
      As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
    2. Re:Ignore most of the replies by Anonymous Coward · · Score: 0
      I would suggest a language that makes use of garbage collection as your next choice. ... These criterea make for a langauge that is more difficult to write stupid code in.
      Stupid is as stupid does. - Java mantra
    3. Re:Ignore most of the replies by Deathanatos · · Score: 1
      * Less portable code makes heavy use of API that is already written and tested inside the OS.
      The code will have to call system functions sooner or later, portable or not. The point of many libraries out there is providing a standard interface to those functions (while the code in the libraries may vary between platforms to account for those differences).
      * Less portable code can therefore be less expensive and quicker to produce. Depending on the circumstance this can be a long term and/or short term benefit.
      Wrong. Using third party libraries has saved me time and effort, and allowed my apps to be portable. At the same time, these libraries are much more mature and stable than anything that I could write in a modest amount of time. (Why reinvent the wheel?) Take libcurl, for example. Aids in portability (which with sockets can be not fun) and saves me the time of having to deal with HTTP/other protocols. I also once wrote a library capable of handling big-integers, to calculate 100!. It worked, but the library had so many gotchas it wasn't funny. And it took time. Much less time than it took when I discovered GMP. (And GMP blew my library away in terms of speed/features.)
      * Less portable code can be made to execute faster than portable code
      This is probably true - however, the difference for many libraries is also probably small. If you're in a small project that needs execution speed, then yes, less portable may indeed be better. (GMP does this) For the majority of projects, however, this is not the case - better algorithms and design.
      * Typically the most popular OS in the world is easier to program for by most programmers, thereby allowing everyone that is hired to get up to speed on the project more quickly.
      Wrong. A project using common, well known libraries (standard C functions, POSIX, some of the well known libraries mentioned in this thread...) as opposed to platform specific calls that may be unknown to programmers, will be easier to aquaint with. API should be a small barrier in a well organized project.
      * Anything that has to do a lot of work with filesystems will need operating system dependant code to be written. There are faster file operation system calls for each specific OS.
      You're telling me I should call the Windows dependant calls over my good friend fopen() for speed? If it's file I/O, the system call's speed won't make a difference - I/O with the actual hardware likely will. Even if speed were an issue - then you provide a wrapper. If faster calls are available on a platform, write a wrapper that will call them, but fall back to the standard calls where not available.
      * Less portable code can be made smaller in size, by depending on libraries that are only available on a target OS.
      This is probably true. However, portable code isn't a free lunch - you've got to pay somewhere. In my experience, it's been mostly in executable size, and less in speed. (wxWidgets adds a lot of bulk to a binary, admittedly.) But to some of us, trading a few hundred kilo's of disk space (cheap by today's standard) for portability is worth it. More space is usually savable not by code, but by data reduction.
      Moving forward, I would suggest a language that makes use of garbage collection as your next choice.
      Like C++. Oh. Wait. "Bad example". Really, although it isn't built in, I've really never worried about garbage collection too hard. boost::shared_ptr is a wonderful class, and classes help even more. Once I get off my rear an actually use boost/some other scheme, I stop worrying. I don't spend the majority of my time on memory management.
    4. Re:Ignore most of the replies by Tsagadai · · Score: 1

      Here is my reason for writing portable apps, if you can't write a good app that will work on multiple operating systems or platforms you aren't worthy of the title programmer. The only reason you should need to write non portable apps is for crazy optimisations. In which case you can spend time testing on multiple OS's and finding bugs in threads and memory management.

    5. Re:Ignore most of the replies by abradsn · · Score: 1

      I did break my text into paragraphs. I had just forgotten that slashdot is so screwed up, that I need to put the html tags in it.

    6. Re:Ignore most of the replies by abradsn · · Score: 1

      Crazy optimizations are the life blood of programmers everywhere!
      I for one welcome my "Crazy Optimization OverLords"

      Really though, only about 6% of code is non-portable code. Those optimizations are usually a big deal for those systems, and rewriting 6% of your code if you new what you were doing in the first place, is not going to be that big of a deal.

  19. handheld? by tepples · · Score: 1
    Moving forward, I would suggest a language that makes use of garbage collection as your next choice.

    Does this apply to handheld devices as well?

  20. Fuck them. by remembertomorrow · · Score: 1

    I'm a software developer who writes a lot of freeware utilities

    Fuck them. You're providing them with programs for free. Just because one platform has a majority of users shouldn't mean it gets all the attention.

    If you were making a LIVING off of the products you produce, doing the opposite would be probably be the wisest course of action.

    --
    Registered Linux user #421033
  21. Cross-platform is hard by Jerf · · Score: 1

    Cross-platform is hard.

    But Trolltech did all the work for you. They make it easy.

    Anybody who has never experienced that may not believe it. Trolltech is hiding a lot from you. (This is a good thing.)

  22. Re:Easy steps to portability: by Anonymous Coward · · Score: 0

    or

    2. Use a large bulldozer

  23. Hah! I have yet to see a decent port to MacOS by Blakey+Rat · · Score: 3, Informative

    Caveat: If your app is command-line, then this isn't really an issue. (Well, it still sort-of is, in that DOS CLI apps have different mechanisms for help than Unix ones, but we'll ignore those details.)

    The reason cross-platform is hard is because GUIs behave very differently from each other. To be a "correct" Mac OS program, you must support:

    1) AppleScript, at least the bare minimum actions.

    2) The Services menu. Many ported apps don't have it.

    3) The integrated spell checker. Most ported apps don't have it. Including biggies like Microsoft Office. (Needless-to-say, Firefox also doesn't support the integrated spell checker.)

    4) Verb dialog boxes. That is, no "yes/no" questions in dialogs, they must all be "Save" "Don't Save" (or similar.) In addition, the location of Ok and Cancel are different in different OSes.

    5) Drag&Drop, another simple feature the majority of ported apps get wrong. (Note: this includes drag&drop text editing as well as dragging snippets to the desktop.)

    6) Mac-like edit boxes. Here's an example ported apps almost always get wrong: if your cursor is at the bottom line, but in the middle of the text, and you hit the down arrow the cursor should move to the end of the bottom line. On Windows, it should do nothing. On Linux... well I have no clue if Linux has any standards for arrow behavior in edit boxes. (Firefox gets this wrong also, as do many, many apps.)

    7) Standard Mac menu shortcuts. This is pretty easy since other OSes ripped-off most of Apple's shortcuts anyway.

    8) Being responsive to sleep, hibernate and shut down requests from the OS. Every time I see OS X telling me that shutdown was cancelled because of some mis-behaving app I want to scream.

    9) Not relying on any absolute paths other than those defined by the OS. Lot of apps get this wrong.

    10) Using Apple's color picker, font picker, "Special Characters" picker, etc instead of your own. Many apps get this wrong.

    I'm probably missing items on this list. In addition, Windows has items on its list different from the Macintosh list. (For instance, coping with Active Directory, having an installer.)

    I can guarantee that your cross-platform framework gets at most half of these things right. The Java VM gets basically none of them right. Firefox gets like 3 of them right. The reason you think cross-platform development is easy is one or more of the following:

    1) You don't bother to QA your product on Mac/Windows/whatever. (This is the most likely.)

    2) Your programs have trivial GUIs and/or you don't give a whit about the quality of the GUI.

    3) Your programs are CLIs and have no GUI at all. (Note that if this is the case, they're still probably wrong on DOS, which is quite different from Unix CLIs.)

    Tell you what, the instant I see a single ported app to Mac OS X that actually looks and behaves like an OS X app, I'll eat my words and agree with you. But I don't think that'll happen.

    1. Re:Hah! I have yet to see a decent port to MacOS by phonics · · Score: 1

      SO TRUE!

      SWT / jFace (IBM / Eclipse IDE) gets a lot more of these things right on Macs than AWT / Swing (Sun), but I guess that's kind of a Duh, that being the whole point of SWT. Swing STILL doesn't even work correctly on windows! (try a remote desktop session with different resolutions and a full-screen swing app...)

      TCL/TK works like TCL/TK on whatever platform you use it. On a mac it's kinda scary because I've used a few apps that do weird things on right click, some that have odd-sized (but still important :\) buttons disappear, etc.

      I have not seen too many Qt apps for mac, not sure why, and can't think of one off the top of my head...

      GTK is still only in X11 on OS X.

      wxWidgets, hmm. Seems decent, it's next on my list for trying, but I can't think of many apps written in it that i've used on the mac. I recall it not being that stable? I'm dumb and haven't seriously investigated for like 2 yrs, so i may be totally dumb and wrong.

      But yeah, parent poster is so spot on. You may think your app is cross platform because it builds. Try opening it next time, especially your mac build. Then try:
      * editing text in a field (most notably the end and home keys do not do what they do on win/lin)
      * printing
      * changing preferences
      * fullscreen
      * adding extended characters (such as option-n, option-e, etc)

      There are well defined things your app is *supposed* to do. Does it?

      (if so i totally wanto 0wnx0r a c0pyyy + yr srczzz!)

    2. Re:Hah! I have yet to see a decent port to MacOS by Rocketship+Underpant · · Score: 1

      That's an excellent outline of the things most Mac ports are missing and should have. Here are a few more:

      11) Using Apple's save and open dialog boxes that correctly remember recently accessed folders and let you drag in files.

      12) Having the green window-optimizing button correctly adapt the window to the size of the document.

      13) Allowing re-arrangable and customizable toolbars.

      14) Not requiring the right-click for essential functionality.

      15) Drag-and-drop program installation and removal.

      Adobe applications also get almost all these wrong, in spite of their long heritage as Mac OS programs.

      --
      He who lights his taper at mine, receives light without darkening me.
    3. Re:Hah! I have yet to see a decent port to MacOS by KewlPC · · Score: 1

      The thing you're ignoring is that a cross-platform application should run more or less the same on all target platforms, unless you just really hate users running a different OS than you. It'd be nice if users didn't have to re-learn the app's interface if they go from a shop that runs TheProgram on Windows to a shop that runs TheProgram on Mac OS X, or if they run the Windows version of TheProgram at work but use the OS X version at home. Imagine if Photoshop for OS X was a completely different beast than Photoshop for Windows.

      One possible solution might be to have the program alter its behavior based on some setting. On installation, or the first time the program is run, allow the user to choose between Cross-platform or Native behavior. Make this something they can easily change later should they change their mind.

      This isn't really a perfect solution, though. The best way would be to just have the program behave like target OS's native apps as much as can be done without requiring a large degree of re-learning and alienation for users switching from one platform to another (or using the program on both).

      And keep in mind that a lot of developers just plain don't have access to more than one platform.

    4. Re:Hah! I have yet to see a decent port to MacOS by insane_coder · · Score: 1

      1) You don't bother to QA your product on Mac/Windows/whatever. (This is the most likely.)
      2) Your programs have trivial GUIs and/or you don't give a whit about the quality of the GUI.
      3) Your programs are CLIs and have no GUI at all. (Note that if this is the case, they're still probably wrong on DOS, which is quite different from Unix CLIs.)

      Wrong on all 3 accounts. See this: http://nsrt.edgeemu.com/forum/viewtopic.php?t=602
      One of my codevelopers uses Mac OS X exclusively. Half my test team uses Windows exclusively. My CLI binaries are all for DOS, Windows, Linux, FreeBSD, Mac OS X. It works the same everywhere, even on DOS. The GUI version, I provide binaries for Windows, Linux, and Mac OS X, and the source code so you can compile elsewhere. I'm told it works nicely everywhere, and we even support half a dozen languages some of which you don't all see in one app.

      --
      You can be an insane coder too, read: Insane Coding
    5. Re:Hah! I have yet to see a decent port to MacOS by Peter+La+Casse · · Score: 1

      That's pretty impressive. What cross-platform libraries do you use?

    6. Re:Hah! I have yet to see a decent port to MacOS by RAMMS+EIN · · Score: 1

      You make some good points, but bear in mind that there's a difference between writing software that _works_ on various platforms, and software that feels _native_ on all supported platforms. The latter is, of course, desireable, but I'd say the former is where most of the value is. At least, I'd rather have an application that didn't feel native than no application at all.

      --
      Please correct me if I got my facts wrong.
    7. Re:Hah! I have yet to see a decent port to MacOS by Blakey+Rat · · Score: 1

      From the Read Me attached to that download:

      nf FAQ for Mac:

      Q. I set NSRT location to "Frontend Directory", but where is it?
      A. nf.app/Contents/MacOS. Put nsrt into this folder.

      Q. I set Start location to "Frontend Directory", but it doesn't work.
      A. Qt rejects to show the contents of the nf.app when starting. Use other locations instead.

      Q. Where is the preference file?
      A. In nf.app/Contents/MacOS.

      Q. Where should I put the lang folder?
      A. In the same place as nf.app.

      Q. What is the blank rectangle above "HTML" radio button?
      A. Qt's bug.

      All executable files are made as "universal binary".

      File type detection is supported as '-noext' option on all NSRT platforms.
      So, if your ROM image is compressed without extension, don't forget to add -noext option.

      - zones


      You're telling me that THIS was QAed?

      Let's look at a screenshot of the first thing the user sees:

      http://schend.net/images/screenshots/nsrt33.png

      This is the best you can do cross-platform? "[Parent Directory]" on MAC OS X?! Whoever made this GUI obviously is not a Mac user, and there's no way this could possibly pass as a Mac OS-native application. Hell, "About" is in the Help menu! (Oh wait, About is both in Help and in the Application menu. Even worse.) The Preferences dialog is actually pretty good.

      I'm not going to waste my friday doing a detailed review of some ported app which, frankly, I don't even really know what it does. But you haven't changed my mind whatsoever. Even the most basic QA process would have fixed that ugly blank rectangle which is basically the very first thing the user sees.

    8. Re:Hah! I have yet to see a decent port to MacOS by argent · · Score: 1

      The thing you're ignoring is that a cross-platform application should run more or less the same on all target platforms, unless you just really hate users running a different OS than you.

      "Run more or less the same" doesn't mean "not following the OS user interface conventions".

      The details of the user interface, like how edit boxes work or what input panes or panels are used, are not going to stymie users. The things that piss users off are changes in the layout or missing elements on one OS or another. You can maintain layout and functionality without making your application stand out like a zebra in a horse race.

    9. Re:Hah! I have yet to see a decent port to MacOS by insane_coder · · Score: 1

      For simple apps, just pure C or C++. I use GCC for compiling, since it exists everywhere even for DOS and Windows. For GUI apps or where I need threads or something, Qt is very good.

      --
      You can be an insane coder too, read: Insane Coding
    10. Re:Hah! I have yet to see a decent port to MacOS by insane_coder · · Score: 1

      >You're telling me that THIS was QAed?
      What about the readme tells you it wasn't?

      >This is the best you can do cross-platform? "[Parent Directory]" on MAC OS X?!
      Mac OS X doesn't have a concept of directories?

      >Whoever made this GUI obviously is not a Mac user, and there's no way this could possibly pass as a Mac OS-native application.
      That part was made by a Windows user.

      >Hell, "About" is in the Help menu! (Oh wait, About is both in Help and in the Application menu. Even worse.)
      There's one About for the application, and another about the application it's a frontend for. Although it doesn't do much more than serve as credits.

      >The Preferences dialog is actually pretty good.
      Well thanks, that's one part I actually wrote myself. But what did you actually find good about it? Just the eye candy?

      --
      You can be an insane coder too, read: Insane Coding
    11. Re:Hah! I have yet to see a decent port to MacOS by Blakey+Rat · · Score: 1

      (Typing this without re-downloading the app, and my memory ain't perfect.)

      For those just joining us, we're talking about this Read Me file:

      nf FAQ for Mac:

      Q. I set NSRT location to "Frontend Directory", but where is it?
      A. nf.app/Contents/MacOS. Put nsrt into this folder.

      Q. I set Start location to "Frontend Directory", but it doesn't work.
      A. Qt rejects to show the contents of the nf.app when starting. Use other locations instead.

      Q. Where is the preference file?
      A. In nf.app/Contents/MacOS.

      Q. Where should I put the lang folder?
      A. In the same place as nf.app.

      Q. What is the blank rectangle above "HTML" radio button?
      A. Qt's bug.

      All executable files are made as "universal binary".

      File type detection is supported as '-noext' option on all NSRT platforms.
      So, if your ROM image is compressed without extension, don't forget to add -noext option.

      - zones


      Telling users to insert files into the Application Bundle is a huge no-no. QT "rejects" (rejects?) to show the contents of an Application Bundle because, like all *good* software, Application Bundles are treated as single files (and QT's coders apparently know more about the Mac than whoever made this front-end.) A user should never have to know that they are in fact folders.

      That's kind of all beside the point though, since a non-admin user can't insert files into Application Bundles that way anyway-- so there's a huge, obvious bug right away. And since the Preferences FIle is inside the Application Bundle, presumably it either won't even work when run as non-admin, or will fail to save preferences.

      Preferences inside an Application Bundle = another HUGE WTF. Surely QT contains a function to return the proper path to store preference files in? If not, it's ~/Library/Preferences in OS X and $HOME/Application Support/ in Windows IIRC. Or Local Settings/Application Support if it shouldn't be replicated by Roaming Profiles, like a web browser cache. (Firefox, BTW, got this wrong in version 1. Not sure if it's fixed yet. The browser cache should go into Local Settings so it doesn't get transferred over the network 20 times a day.)

      The blank square above the HTML radio button is a bug regardless of what GUI libraries you used. Fix it. The user doesn't give a crap about your excuses or finger-pointing, they just want a quality application. Hell, the user doesn't even know or care what QT is, nor *should* they.

      That all said, the Read Me also doesn't explain what the application even does. Or at least is supposed to do. I have no clue. If I recall from yesterday, there's also no associated help that gives this information either.

      Mac OS X doesn't have a concept of directories?

      No, it has the concept of "folders." The user should never see the word "directory" (not used in that way, at least), they should see "folder." And the user should not be expected to know what the term "parent" in regards to the folder structure means. The word "directory" is from Linux. I'm pretty sure Windows doesn't use the word "directory" either in the GUI (but I could be wrong.)

      That part was made by a Windows user.

      What do I win for guessing it wasn't made by a Mac user!? I want a year's supply of Brawny paper towels!

      There's one About for the application, and another about the application it's a frontend for. Although it doesn't do much more than serve as credits. ... except that both "Abouts" go to the exact same screen. Or maybe there's a very subtle difference I didn't notice. But in either case, both Abouts should be in the Application menu, as "About ", then under it, "About ". Putting the version number and credits in About is fine, along with any copyright notice you may have. I mean, Safari's About just says "Safari, Version 2.0.4, Copyright 2005 Apple Computer."

      Well thanks, that's one part I actually wrote myself. But what did you actually find good about it? Just the e

    12. Re:Hah! I have yet to see a decent port to MacOS by Blakey+Rat · · Score: 1

      Stupid Slashcode swallowed some of my text.

      The path for preferences in Windows should be:

      $HOME/Application Support/|Application Name|

      The two Abouts should be:

      About |GUI Front-end Name|

      And

      About |CLI Tool Name|

      And seriously, Slashcode coders, how hard is it to write a regex to determine that "Less Than GUI Front-end Name Greater Than" isn't a HTML tag? Criminy.

    13. Re:Hah! I have yet to see a decent port to MacOS by myrdred · · Score: 1

      "To be a "correct" Mac OS program, you must support .... The Java VM gets basically none of them right"

      How about this argument:

      1. Apple supplies the Java VM on Mac OS X (true)
      2. The Java VM doesn't follow your list of properties
      3. Therefore, either:
                a) Apple disagrees with you about what a "correct" Mac OS program should be
                b) Apple is incompetent and _should_ fix their Java VM to behave properly

      Neither of these conclusions say I, as a developer, am doing anything wrong! Either your list is bogus (I don't think so), or Apple isn't doing a good job with its Java VM (likely). So go complain to Apple instead of blaming developers that target a technology Apple ships and promotes (not as much as Cocoa, but still pretty prominently).

      P.S. If you tell me to use Cocoa, I'll tell you I don't have the time and money to code the user interface code for my program X times, where X is the number of platforms I support. Big companies can do this, they have the money to. But as a one person developer, I can't afford to if I want cross platform compatibility.

    14. Re:Hah! I have yet to see a decent port to MacOS by Blakey+Rat · · Score: 1

      I'm not one of those "Apple is holy and can do no wrong" people. Believe me, I criticize Apple as much as I do anybody else. And yes, Mac OS' quality has dropped off a LOT since the acquisition of NeXT.

      (Look at Finder alone-- it used to be the model of how to build a file browser, now it's a piece of crap that can't even cope with making image previews or connecting to network drives. Thanks, Apple, I love it when my iBook freezes because I had the gall to close the lid while it was connected to a network drive then open it up in a place where that network isn't available. I heard of this new technology called "error detection," you should try it.)

      I disagree with Java in general because I think it's completely misguided. But look what happened when Microsoft started adding to Java to get it to create more correct Win32 programs: people began to bitch and moan that MS was "ruining" Java and fragmenting the Java developer community by making proprietary extensions to it. Apple would run the same risk if they added anything to the Java VM to allow it to make use of all those Macintosh-specific features.

      But a bigger issue is this: Even if Apple did add all of those features to the Java VM, no Java developer would ever use them. Two big Java projects that get a lot of press are Limewire and Azureus. Both of them have horrible UIs on all platforms they run on. They could make use of simple UI improvements, even with the lowest-common-dominator approach Java VM takes, and yet they don't.

      IMO, Java VM is beyond hope when talking about UI quality. (Obviously Java the programming language is fine. It's just the VM environment I take issue with.) I won't tell you to use Cocoa, but I will say that by choosing Java VM, you knew that you'd be making a crappy UI in every OS it runs in, because there's simply no technical way around that.

  24. Re:VHS? What's That? by mikael · · Score: 1

    I've seen this happen to my posts if I get interrupted while writing a reply. Perhaps the index allocated to your comment is timed out and given away to someone else. Then you're reply gets shuffled onto a completely different article.

    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  25. Portability has advantages, too by Dr.+Manhattan · · Score: 2, Interesting
    Of course, by developing code on multiple platforms from the start you quickly find all kinds of subtle bugs that come back to bite you later if you don't find them. A bit of memory corruption that causes a failure 10,000 cycles later on one platform, can cause obvious instant death on another. Write on one big-endian, one little-endian, and one 64-bit platform simultaneously and you'll find at least 80% of your memory bugs early on, usually more. Bonus points if one of them is like a SPARC and has alignment requirements.

    Also, portability tends to ecourage modularity, which helps isolate bugs and make them less likely in the first place, since the modules are smaller and easier to reason about than large chunks of code.

    --
    PHEM - party like it's 1997-2003!
    1. Re:Portability has advantages, too by calidoscope · · Score: 1

      Methinks that's an even more important reason for the reputation that Linux has for robustness than the so-called thousands of eyeballs looking over the code.

      --
      A Shadeless room is a brighter room.
    2. Re:Portability has advantages, too by Dr.+Manhattan · · Score: 1

      Linux had a lot of that rep even before it was 'portable' to anything but an x86. And there's research to show that the code itself is just plain well written. But yeah, that certainly helps.

      --
      PHEM - party like it's 1997-2003!
  26. Reposting, formatted properly by SanityInAnarchy · · Score: 2, Informative

    I think you sent that as "HTML formatted" -- which gave me one big line of unreadable-ness. I haven't actually read it yet, I'll respond in a minute. Here's how I think it's supposed to look:

    Basically, some people will say things like "Portability issues only happpen on Windows because of the use of Windows specific API.... and Linux somehow magically escapes this problem."

    I'm sure you are already aware that it is not true, because your code is portable and uses readily available libraries that do not vary in version, or in any major way at all from OS to OS.

    A buch of other people will say "All, code should be portable, because there is no reason for it to not be portable."

    And, I'm sure that from your post, this is the reasoning behind your question.

    So, here is a list of reasons that might help formulate an understanding of why some code is not portable... (bear in mind that a lot of my code is portable too, as that is usually indicative of good software practice)

    * Less portable code makes heavy use of API that is already written and tested inside the OS.
    * Less portable code can therefore be less expensive and quicker to produce. Depending on the circumstance this can be a long term and/or short term benefit.
    * Less portable code can be made to execute faster than portable code
    * Less portable code can be made to take advantage of hardware features that are only exposed through a specific API
    * Typically the most popular OS in the world is easier to program for by most programmers, thereby allowing everyone that is hired to get up to speed on the project more quickly. (Not a concern for a team of one)
    * Typically large projects need to make every advantage in efficiency that is readily available. This might or might not be dependant on the OS
    * Anything that has to do a lot of work with filesystems will need operating system dependant code to be written. There are faster file operation system calls for each specific OS.
    * Less portable code can be made smaller in size, by depending on libraries that are only available on a target OS. (As long as they are actually there!!!)

    For example in Windows you can take advantage of a bunch of API to change system settings like IIS settings, and smtp settings.

    In Linux you have to write code to manually change text files. Of course API are better here because then there is less chance messing up the format of the text file. And your code will work in the next version of the OS too. Your code will not work in the next version if you change the config files manually. In your case, you don't care because you are just writing little free utilities. In bigger enterprise level applications you need to care about things like this. There are many examples of needing to use API where-ever possible. More experience with bigger applications is the best way to get to this knowledge.

    Also, one final note. C is getting to be an old language now, and it is sad that any code written in C is not portable. Things that have been around that long, have workaround after workaround to make them keep from breaking. It almost requires effort to write C code that is not portable nowadays. Bad C code is still prevelant though. This is mostly due to the #define conditional that was included to make C a lasting language. It worked. Now let's be done with it.

    Moving forward, I would suggest a language that makes use of garbage collection as your next choice. Also, one with clean syntax and no workarounds already in place would be a good plan. These criterea make for a langauge that is more difficult to write stupid code in. If you ever have to maintain code, then these are good considerations.

    Here are some examples (in no specific oreder)
    Java, C#, PHP

    Here is a bad example
    C++

    --
    Don't thank God, thank a doctor!
  27. Re:Easy steps to portability: by squisher · · Score: 1

    Open oource is by no means a garanty for portability. If someone releases the source code of an utility that's written with many Windows/Linux specific libraries or APIs, then it's not portable, open source or not. Yes, someone can pick it up and port it to another platform - but that is work and you won't know when that someone with the right knowledge and time at their hands will show up...

  28. beacuse there are a massive.. by josepha48 · · Score: 1
    ... amount of idiots out there.. well maybe not idiots, but people who do not understand writing code. Now there are several portable options, like Java, tcl/tk ( which some say is dead ), perl / python ( which the gui's can use tk [ so tk isn't all that dead ]), or qt, and even mono / .net.

    Actually I don't think to many people realize that QT is probably more portable than javascript.

    --

    Only 'flamers' flame!
    Does slashdot hate my posts?

    1. Re:beacuse there are a massive.. by mph · · Score: 1
      amount of idiots
      It must be bad, if they're uncountable.
  29. Ok, now the actual reply: by SanityInAnarchy · · Score: 2, Insightful

    Basically, some people will say things like "Portability issues only happpen on Windows because of the use of Windows specific API.... and Linux somehow magically escapes this problem."

    Linux does not magically escape the problem. However, Linux developers are much more likely to write portable apps, because they remember how much it sucks to have their OS be unsupported, so they will naturally want to support BSD and OS X also.

    POSIX does help, however. NT was originally going to claim POSIX compliance, but now seems to deliberately break it.

    A buch of other people will say "All, code should be portable, because there is no reason for it to not be portable."

    I wouldn't claim that. For instance, modprobe has no reason to work on anything but Linux. Similarly, regedit has no reason to work on anything but Windows. However, I would suggest that most user-level apps could be portable, and the only question is whether it costs you anything. I believe you discuss costs below:

    * Less portable code makes heavy use of API that is already written and tested inside the OS.

    * Less portable code can therefore be less expensive and quicker to produce. Depending on the circumstance this can be a long term and/or short term benefit.

    There's a lot of vagaries there. Let's get more specific:

    * Less portable code can be made to execute faster than portable code

    Are you talking about the performance benefit gained by writing code that isn't as modular? Proper refactoring can have its own benefits, certainly in terms of cache coherency.

    The only way you're right here is if we're talking about assembly-level optimizations. In this case, only a madman would use hand-coded assembly for more than the tightest of the tight loops, which means very little hand-coded assembly. Even here, I think it's still possible to be portable across OSes on the same arch, most of the time, and I have to wonder if this could be shunted off to a library, which could then be made platform-independent by doing similar optimizations on every platform.

    For instance, if we're talking about games, the simple solution would be to use an existing engine, like the Quake4 engine, so someone else has already done the hand-optimization (as well as handled most of the other concerns), and you're automagically portable.

    * Less portable code can be made to take advantage of hardware features that are only exposed through a specific API

    What kind of hardware features?

    Unless you're talking about what I just was, the only way this is a problem is if you're writing a driver. Driver code is generally considered part of the OS, and thus not portable. And yet, nVidia still manages to make theirs mostly portable.

    * Typically the most popular OS in the world is easier to program for by most programmers, thereby allowing everyone that is hired to get up to speed on the project more quickly. (Not a concern for a team of one)

    This depends on the size of a project, but most often, I find it's a much bigger job to get up to speed on the app than the environment. For instance, it's taking me far longer to learn Drupal than it took me to learn (ugh) PHP. And since it's cross-platform, the programmers can use whatever OS is easiest for them, so long as they don't screw it up for everyone else -- which is something they should already be trying to do, assuming you've already got a project.

    * Typically large projects need to make every advantage in efficiency that is readily available. This might or might not be dependant on the OS

    Either you mean running speed, which we discussed above, or development speed. Development speed shouldn't really matter, as you should be able to mostly use the tools everyone's familiar with, although I can see problems with people

    --
    Don't thank God, thank a doctor!
    1. Re:Ok, now the actual reply: by abradsn · · Score: 1



      Thank you to whoever reformatted my post for me. I really appreciate it.
      Wrong on pretty much every account here, at least in theory:

      * An API is not necessarily more stable than a config file schema.
      * You could just as easily use some sort of API on Linux, or a config file schema (.INI files, anyone?) on Windows.
      * It's not only possible, but often easy, to implement some sort of API that uses config files as a backend. That's basically how /etc/passwd (and group, and shadow) works on Linux -- no one edits it by hand, even though it is, technically, a text-based config file.

      Hmm, I think that I either posted my statement in a confusing way, or you misunderstood. Basically I was trying to say that editing the file directly is usually bad. Editing it through a layer of inderection such as an API is good.

      Though API, do sometimes change... good API should not change. They can be added to, but existing API should remain the same, or at least be provided for backwards compatibility.

      Typically, files change frequently, and their formats should not be restricted. This would allow for files to be optimized, and for additional data to be added. It would allow for them to be made more complex without the user of the API to be bothered.


      * Less portable code makes heavy use of API that is already written and tested inside the OS.
      * Less portable code can therefore be less expensive and quicker to produce. Depending on the circumstance this can be a long term and/or short term benefit.
      For example not all systems supported shared libraries in the past. I worked on some code that tied itself to an OS that supported that one time. For example there is a new Speech API that Microsoft provides. If I cared about Speech and voice recognition, then I would use that. For example Linux has a great thing called ssh. Though it is available minimally on other OS, I would use the Linux variant. Databases typically are also geared towards taking advantage of one OS. CAD software typically tries to take advantage of one OS. There are a lot of 3d graphics applications tied to the Mac platform. The reasons are that it was easier/better/cheaper to go that route. Windows has a great set of tools to access the system in a unified way. That technology is called WMI and I can automate anything and everything on Windows with it. On Linux, I can do the same thing, but it takes a lot more work. In some ways linux is far superior to WMI, but mostly WMI is better because there was some unification in the whole process.

      These ideas are not always the case, and personally I would always try to avoid tying myself to a platform where possible. At the very least, moving off all OS, and hardware specific calls to a single library called lowlevel. The at least I can target different OS and hardware for the same application without sifting through literally a million lines of code. That is not fun.

      Okay, and I agree with most of your other points.

      As far as languages go, I have to say that although people can and do write stupid code, there is some measure that can be taken to avoid that code.

      One example is perl. I love perl. I think it is a great and fabulous language. As a side note, I am at least an intermediate level programmer in about 12 programming languages, and an expert in 3.

      Anyway, back to my point. I love perl... but since perl allows so much flexibility, it becomes difficult to maintain. Especially when you take over the project after some idiot was working on it. Some of the more restrictive languages don't allow you to do things that are impossible to figure out.

      I've seen stupid code, in every language that I've ever worked with. (Most of the time it was others who wrote the stupid code, though everyone has probably written something that yells "Look at me, the super idiot" before :) All, I'm trying to say is that I thi

    2. Re:Ok, now the actual reply: by SanityInAnarchy · · Score: 1

      Basically I was trying to say that editing the file directly is usually bad. Editing it through a layer of inderection such as an API is good.

      I wouldn't necessarily agree with that. As I said, a file format is not necessarily less stable than an API.

      For instance, /etc/passwd is not likely to change. It's stable enough and abstract enough that you would not build an API around it merely to protect yourself, should the format change, because if your API is low-level enough that it's even a question, a format change would almost certainly require an API change.

      There are still reasons to wrap it in an API, of course. You might want to be able to manipulate users and groups on systems that don't use a passwd file, like Windows. It saves you from having to re-implement all the best practices, like locking it, writing to a new file and renaming it on top of the old one (for atomicity), and preventing non-root users from modifying all but the most basic information about themselves.

      But on that note, often OSes develop separate APIs that do essentially the same thing, and in that case, it makes sense to either port one of them or wrap them both in another API.

      Regardless, I think the point of view that Linux is less scriptable because many apps use config files instead of the Registry is absurd. I concede there may be issues, but anyone who would choose one OS over another because of that should take a long, hard look at how many ways the Registry fails on a regular basis.

      For example not all systems supported shared libraries in the past.

      I think this could be ported, though, even within a single app.

      For example there is a new Speech API that Microsoft provides. If I cared about Speech and voice recognition, then I would use that.

      Why, because it's new?

      I believe there are existing libraries to the same purpose. They may not be as good, so perhaps a "lowlevel" wrapper would be nice here, to allow you to use Microsoft's library for that purpose when on Windows.

      There are a lot of 3d graphics applications tied to the Mac platform. The reasons are that it was easier/better/cheaper to go that route.

      Weird -- Apple sold us OS X and Quartz Extreme on the basis that it's all based on OpenGL, which exists everywhere. It really shouldn't be an issue -- most 3D apps should, in fact, be at the point TFA talks about, where all you have to do is link against the local SDL (OpenGL+OpenAL) and ODE, with absolutely no platform-specific code.

      I mean, I can understand a Windows-only 3D app (DirectX), but Mac-only?

      I love perl... but since perl allows so much flexibility, it becomes difficult to maintain. Especially when you take over the project after some idiot was working on it. Some of the more restrictive languages don't allow you to do things that are impossible to figure out.

      I doubt that, but you have more experience with this, so I'll defer to you.

      For my own part, I would rather start a project in Perl, perhaps with some readability standards. Better to start with the most flexible tool possible and add restrictions than start with a bunch of restrictions, not all of them necessarily restrictions that you want. Better to start with Perl and add "use strict; use warnings;" than to start with, say, Eiffel.

      As an example, I wrote my own database, just so I could have one for my applications. I can ship it with my products. I don't have to worry about it not being there. I don't have to worry about it not working, or being crappy. I don't have to worry about it being too slow. I don't have to worry about licensing, or some other stupidity.

      Funny, I would definitely be worrying about it not working, being crappy, or being too slow, because I wouldn't know, without reading their code, whether anyone else had come up

      --
      Don't thank God, thank a doctor!
    3. Re:Ok, now the actual reply: by larry+bagina · · Score: 1

      Linux does not magically escape the problem. However, Linux developers are much more likely to write portable apps, because they remember how much it sucks to have their OS be unsupported, so they will naturally want to support BSD and OS X also.

      LOL

      Linux developers are just as bad as Windows developers. Probably worse -- Windows developers don't labor under the impression that their code will run anywhere else; Linux developers use non-standard glibc functions and gcc extensions and assume it will work everywhere. Why do you think FreeBSD, et alia, maintain such a huge port repository full of patches needed to compile "Linux" programs?

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:Ok, now the actual reply: by abradsn · · Score: 1

      Okay, I can agree that a file format can be as stable as an API, and I can agree that the API would likely change in the case of a file format change. I can even agree that the API might break in some ways. I just think that an API is likely to be more stable. I think we just disagree here. Probably for valid reasons though. In some ways a file format can be more portable, and it might be easier to change the information in it. On more benefit an API has is that it can allow that change to always take effect immediately without causing the server to reload its config data during every loop.

      I hate the registry too. Everyone does. No one likes the registry. Even Microsoft has come around to agreeing with that now. The registry is really a database that offers up a single point of failure for everything. Ooops. It's kind of an example of how to do to much in one place. The registry does have some advantage, but it was long ago lost to its numerous disadvantages.

      The shared library aspect does not much matter nowadays, but in previous years it mattered a lot. The system memory could only hold so much of an executable in memory at a time. It was nice to be able to unload and reload parts of your app so you could offer more features to the end user. I assume that history will likely repeat itself as everything in the Software Industry seems to be cyclical. This may become an issue again some day (maybe for embedded systems), though I hope not.

      There are major problems with the existing databases. They don't offer the control I needed. They don't offer the speed or reliability I need. They would consume oceans of memory (in my scenario). They don't offer the ability to tightly couple load balancing, backup, and fail over. They don't support the number of users and transactions per clustered machine that I need. Those jerks break portability fairly often. Even while prototyping out the database, upgrading the database caused things to break. (Nothing spectacular going on, in that database... no reason for it... reminds me of Microsoft in a way) They don't install into a small enough foot print. They take dependencies that I don't need to worry about now. I would be a slave to porting that code which I don't care about everytime that I needed to do an upgrade. My experience is that I or my team gets stuck with portability and maintenaince. One of my requirements is that installation needs to be a dream. Meaning not inducing pain on my users asking them to install 15 dependencies like Biztalk Server does. The worst one being the database. I've read through the source code (and modified it to add some constructs) for postgresql. The code is good (actually quite good), but the limits reached based on the tools they were using at the time... specifically the version of Yacc ...did not fill me with confidence. No space left in the parser, to add another key word. Ridiculous. No support for modern sql standards. Also ridiculous. Oh, it was fixable, after two days of installing other libraries from code and compiling them with the correct switches, so that the new version of Yacc would work.

      The pay-for-use databases suffered from some of the same problems too.

      Turns out in the end, that PostgreSql was way too slow. I expected speed on par with Sql server, and it was orders of magnitude slower. (I did have indexes and queries setup correctly... it really was just slower)

      I've also used and looked at the other databases that you mentioned. I would loved to have used, and or modified the existing solutions if they would have filled those requirements for me. Then I thought, screw this. I'll just make a new database based on XML.

      Anyway, thanks for the dialog, I had a great time talking about these subjects, and I really enjoyed your point of view.

    5. Re:Ok, now the actual reply: by SanityInAnarchy · · Score: 1

      On more benefit an API has is that it can allow that change to always take effect immediately without causing the server to reload its config data during every loop.

      I seem to remember a mailserver, Exim, which checked the mtime on its config file on every message received, and reloaded the data on config file change. More modern systems could easily check the file with inotify, thus responding immediately to any change, and I believe vim (and likely other text editors as well) creates a new file, then overwrites the old file with the new. Thus, a config file could, without much effort, be made just as real-time as an API. Slightly less efficient, but not in a way that really matters.

      Another benefit of a config file is, it can take a lot less time to achieve almost the same amount of usability as a very good GUI. An example file, with comments, is insanely useful, and would probably take a lot longer to produce the equivalent with an API or a pref pane (to use the Mac term).

      The registry is really a database that offers up a single point of failure for everything. Ooops.

      I almost agreed out of spite for Microsoft, but that's not really fair. A filesystem is also a database that offers up a single point of failure for everything.

      The difference is, even Microsoft seems to be able to do decent filesystems nowadays. Not good, but not horrible. The Registry, though, seems to have many other strange/stupid issues, and has no business being a central point of failure. Kind of like how I don't necessarily mind the idea of an app using HTML for some interface features -- KDE has a nice, lightweight library for "rich text" which is really a stripped-down HTML -- but under no circumstances should you embed IE. There are quicker and less painful ways of killing your app's security.

      The shared library aspect does not much matter nowadays, but in previous years it mattered a lot. The system memory could only hold so much of an executable in memory at a time. It was nice to be able to unload and reload parts of your app so you could offer more features to the end user.

      It still matters to me, because I like to actually share the shared libraries. And, by the way, shared != dynamic, at least on my Linux, although I believe you can dynamically load any shared library.

      In any case, I glossed over this issue because I would guess that you could easily implement this yourself, unless the system was feeling especially facist with buffer overrun protection. After all, most of the more interesting languages have their own, portable systems and concepts, and most of them, even if they don't directly support dynamic libraries, should at least support enough reflection to easily implement them yourself. A language like C wouldn't make it easy, but certainly possible.

      I've also used and looked at the other databases that you mentioned. I would loved to have used, and or modified the existing solutions if they would have filled those requirements for me. Then I thought, screw this. I'll just make a new database based on XML.

      Funny you should choose XML. But anyway, if you really didn't find anything close (not even with the lighter-weight ones?), does your database have a name? (Is it a separate product? An open-source project?) I'm curious now.

      For my own part, it always makes me happy when something will work with MySQL, because I already have a working MySQL database, and I know how to use the tools to explore and otherwise mess with the database. If I set up replication/failover, backups, etc, I only have to handle them from one program.

      I would very much like a different/better solution, but in part, "worse is better" matters here -- if your program uses a custom database, especially an opaque one, that would make me nervous, as an admin. That doesn't mean I'd be completely against it, but making admins nervous is not a good thing.

      --
      Don't thank God, thank a doctor!
  30. Cross-platform aids in code quality by Chuck+Messenger · · Score: 1

    In my experience, the discipline of cross-platform development is a great aid to the development of high-quality code. It's essential to have more than one unrelated compiler you use. For example, very often, one compiler or the other will be more picky about something (Intel has a nice message warning you of the lack of a virtual destructor in a case where it's needed, and GCC has a nice warning about failing to provide case:'s for all defined types in an enumerated switch. Furthermore, you get to take advantage of the different debugging tools available on the different platforms. For example, Microsoft's debugger lets you break when a given memory location is changed (maybe gdb does too -- I don't know), while Linux has the excellent valgrind for detecting invalid memory references. Some compilers do a better job than others of checking the types for varargs functions, e.g. printf. A library, which may allow bad input on one platform, may complain on another. Etc.

    So, the demand for you to drop cross-platform development, in order to enable you to devote more resources to your Windows version, would likely have opposite to the intended effect. (that is, unless you're doing something especially OS-dependant, which it sounds like you're not)

          - Chuck

    1. Re:Cross-platform aids in code quality by calidoscope · · Score: 1
      This is similar to the idea of porting to different architectures as an aid for bug tracking.


      On the other hand, if the same bug shows up across the ports of the package, it is a pretty safe bet to say the bug is in the code and not the compiler or OS. I had an experience recently using an app that was running on Solaris and OS X, getting sporadic crashes on both platforms and sure enough it was a very subtle bog (a number very close to one was being rounded to one).

      --
      A Shadeless room is a brighter room.
  31. The obvious answer . . . charge them ! by Anonymous Coward · · Score: 0

    Don't be stupid just because they are. Put up a cafepress page selling coffee mugs that say "I supported Insane Coder's Windows portability effort!" and price them at $29.99. Do the paypal button ( if you don't mind being associated with those criminals ) for those that don't want a concrete token of their idiocy. It won't cost you but a few minutes to set up those links, you won't have to devote any extra time to coding -- I advise you spend the money on BOOZE and HOOKERS.

  32. You linked to ZSNES? by NemosomeN · · Score: 1

    ZSNES is written in almost all ASM (Last I saw? There were stirrings of C/C++ conversions, but the task was monumental). Insanely non-portable. I couldn't even read your post after that.

    --
    I hate grammar Nazi's.
    1. Re:You linked to ZSNES? by insane_coder · · Score: 1

      I am a ZSNES developer, and that website is one of my homepages. I wasn't refering to ZSNES in my question though, however there too I get every now and then people telling us to stop bothering to support a particular OS when support for that OS is already in place and not really changing.

      In regard to questions of portability, my team has ported >15% of the assembly in ZSNES to portable C, and really fixed up some of the underlying code. We've also now cleaned it up to the extent that it runs on all x86 OSs we have access too, including Mac OS X. We sent a lot of patches in to Apple in the process because they had major bugs with their development tools such as their assembler not handling a decent percentage of the assembly syntax properly. And we're not done yet, it's a big project to say the least, but we have a party for every 5% of assembly code we port. At this point pretty much all the large side features have been ported to C, and we plan on making headway into some other major components. Our biggest victory no doubt though was porting all the file reading/writing code to C, dealing with files in assembly is just nasty.

      If you want to see the headway we made with ZSNES, get the latest code from SVN, directions here: http://board.zsnes.com/phpBB2/viewtopic.php?t=7371

      --
      You can be an insane coder too, read: Insane Coding
    2. Re:You linked to ZSNES? by NemosomeN · · Score: 1

      Yeah, last I saw though all the non-windows ports were a bit lacking. Just curious, what's your board name? I haven't been around in a long time, haha. I used to hang out on Zsnes boards a lot. My guess is MaxSt.

      --
      I hate grammar Nazi's.
    3. Re:You linked to ZSNES? by insane_coder · · Score: 1

      > Yeah, last I saw though all the non-windows ports were a bit lacking.
      SDL sound and video isn't so great, but I haven't really seen other than that where the non Windows ports were lacking.

      > what's your board name?
      It hasn't been obvious from my rant? I'm Nach.

      --
      You can be an insane coder too, read: Insane Coding
    4. Re:You linked to ZSNES? by NemosomeN · · Score: 1

      I promise that was my second guess. And yeah, SDL was what I was talking about. Man, it's been a while. Last time I was really on there was when the S-DD1 was still black magic. Di you ever get that one racing game with the gun in the hood working? (Had to)

      --
      I hate grammar Nazi's.
    5. Re:You linked to ZSNES? by insane_coder · · Score: 1

      We got both of the racing games which lacked a gun on the hood and therefor sucked working.

      --
      You can be an insane coder too, read: Insane Coding
    6. Re:You linked to ZSNES? by NemosomeN · · Score: 1

      Ah, that's good, haha. Guess I forgot the exact wording of that filter. znes -> PlAyStAtIoN 3 eMuLaToR was interesting, too.

      --
      I hate grammar Nazi's.
  33. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  34. No, only knowledge and willingness! by wysiwia · · Score: 1

    How about because the differences are difficult to hide.

    That's not true, it's quite easy if one knows how. Just visit wyoGuide (http://wyoguide.sf.net/) and learn how an application gets a fitting native look ("Look ...) while still providing the same functionality (... & Feel") on each platform. wyoGuide follows the simple principle: "Look == native, Feel == genereal".

    O. Wyss

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
  35. Hardware platform? by Anonymous Coward · · Score: 0

    Portability across different operating systems, such as you are doing, using some cross-platform tools/language, nowadays is pretty easy. I have to wonder, though, whether your code compiles and runs as nicely on different hardware platforms. Quite often, I've found that people have no idea about how to write, um, let's call it cross-processor code.

    No, that's not really difficult either, it's just not something that you tend to be taught very much.

  36. Testing by ranulf · · Score: 2, Insightful
    When I release, I just compile each app for all the OSs I have access to and post them on my website. I barely expend any effort at all to achieve portability. So the question I have to ask is: Why do the masses perceive portability as something that requires effort and a waste of time?"
    So, what about testing? That usually figures for a large part in most release schedules.
    1. Re:Testing by insane_coder · · Score: 1

      That's what my test team is for, they're very good at picking up bizare bugs. Like one of my Linux testers noticed if there's a symlink in a directory to a directory below it, the program to get caught in an infinite loop.
      A simple fix for that was storing a unique ID per file/dir in a RBTree (std::set) as it sees it and never process something already in the tree. This also resulted in a gain for users of all OSs, since it ensures no file is ever processed twice no matter what crazy technique was used.
      My test team tests release candidates on all OSs, and it generally takes less than a week. My development team usually does a lot of unit it testing, and we're good about anticipating oddities, so we rarely uncover any major bugs that require a lot of time or a sizable change to fix.

      --
      You can be an insane coder too, read: Insane Coding
  37. Portability by Caesar+Tjalbo · · Score: 1
    "I'm a software developer who writes a lot of freeware utilities in C/C++ which are all cross platform and work well. Lately some of my users have been pestering me to stop wasting precious development time supporting minority OSs like Linux, and get more work done for the majority -- the Windows users.
    Stop coding for those ungrateful... er... oh, I see. Never mind. Keep up the good job!
    --
    "I'm not much interested in interoperability. I want substitutability. I want to be able to throw your software out."
  38. "Stop porting to Linux?" by mrjb · · Score: 1

    I'm sure the users of my cross-platform C++ application (hd24tools) wouldn't complain that it is supported on Linux. It *started* on Linux, because *I* needed it on Linux. I don't need any more argumentation than that to keep supporting it on Linux. It is making it available to the *other* platforms that costs (some) extra time.

    --
    Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
  39. Mod this up by Anonymous Coward · · Score: 0

    Mod this Up this is a Excellent Perspective!

  40. It's easy with wxWidgets by Anonymous Coward · · Score: 0

    I used WxWidgets (with C/C++) for a cross-platform commercial application that runs on Windows, MacOSX and Linux. It was a smooth process.

    I used wx-devcpp for IDE/RAD development. For the MacOSX I used XCode (no problems). And for Linux, just as few changes to the MacOSX Makefile and that was it.

    I released it only for Windows, but I have it working on MacOSX and Linux just as well. For the time being there is no market (no demand) for this application for MacOSX and Linux, but if that changes I can release today.

    1. Re:It's easy with wxWidgets by ksheff · · Score: 1

      why not provide the OSX & Linux versions with the disclaimer that they are not "officially supported"? it could be a case where the demand doesn't exist because "everyone knows that you can only run XYZ on Windows" and people just don't ask for it on other platforms.

      --
      the good ground has been paved over by suicidal maniacs
    2. Re:It's easy with wxWidgets by mr_mischief · · Score: 1

      More specifically, it'd be great to see more programs which had one license for multiple platforms. IF you're selling a per-seat or per-user license, let it be per-seat or per-user. Put all the versions on the same disk/web site, and let Mac, Solaris, Linux, Windows, or whatever other version be installed and used, up to the license limit.

      I believe you'll get better numbers on relative demand when people find it easier and more convenient to choose a platform. Right now, you get situations similar to, "Well, we can buy the Mac version, but only 25% of us have Macs. Everyone has a PC on his or her desk except for Bob. Let's get Bob a PC or install Boot Camp or something and take the volume discount on the Windows version." With a per-user (or simultaneous-use) license, Bob could have the Mac _and_ Windows versions, so long as he's only using one or the other at any given time.

  41. all about the productivity by hesaigo999ca · · Score: 1

    This would only apply if you know how to use the windows visual studio environment.
    I would say most people speaking of such things are the ones used to telling or being told
    "I need this to be done in 2 weeks and has to do everything even clean the windows
    in my apartment" so you go to your visual studio toolbox and start to program something
    they need that ties into all the other apps you created and with the push of the button
    you create through predefined templates and code smith add-ins a full app that does what
    they want and talks with the other programs in about 2 hours and leaves you about 2 weeks
    to play golf.

    "Plan your work and work your plan!"

  42. Simple question, simple answer by Anonymous Coward · · Score: 0

    "Lately some of my users have been pestering me to stop wasting precious development time supporting minority OSs like Linux, and get more work done for the majority -- the Windows users. {snip} Why do the masses perceive portability as something that requires effort and a waste of time?"
    "some of users" is not "the masses". Obviously you are being subjected to a Microsoft plot!

  43. Hm, there are no stupid questions ... by angel'o'sphere · · Score: 1

    ... only stupid answers, but I really wonder why you ask that?

    Why do the masses perceive portability as something that requires effort and a waste of time?

    Because:

    I've also made a few frontends for them using the excellent Qt library ...

    Most programmers only profram for ONE platform. If its Windows they use windows APIs, even for somewthing so simple like opening a file they don't use fopen but OpenFile ... the same is true for Mac programmers and most linux programmers use either what KDE offers or what gnome offers (well, likely not for files but for everything else).

    Result: not the fact that they bother you not to care for portability, but the fact that they think the API (don't call it framework please) is as good or even better or even simpler than the Qt framework ... that is what bothers me. They are the same ppl who scream how complicated Java Swing is ... but the only thing they can do is click widgets together in an IDE and cut/copy the same event handling code for their same buttons over and over again from old code.

    angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.