Announcement

Collapse
No announcement yet.

Write once, compile everywhere vs compile once run everywhere

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Write once, compile everywhere vs compile once run everywhere

    Which do you prefer? Coding in a language like Java and having 1 binary or like C++ with QT?
    Last edited by jpenguin; Jul 13, 2015, 02:51 PM.
    Registered Linux User 545823

    #2
    Typing this on a Jolla phone. On paper the hardware is pretty lousy, but the phone is really snappy, feels a lot faster than more powerful phones and tablets running Android. Some of the difference is probably in the work the actual software is doing, but I'm convinced a good chunk of the speed difference is the language. For me, that's a good argument for C++ over Java.

    There's a time and a place though, scripting languages like Perl are great for faster development in situations where the code needs to change frequently. They're also a lot easier to learn and debug (g++ compiler errors are pretty daunting!)
    samhobbs.co.uk

    Comment


      #3
      c++ with Qt.. i deploy to android , windows, linux and mac os easily and have to do very few checks for the os and they are mostly in the build files (like the project.pro )
      Mark Your Solved Issues [SOLVED]
      (top of thread: thread tools)

      Comment


        #4
        I never got into C++ because it's such a horror. I'm not alone in that opinion. Recently saw a talk from some well known developers.

        For me everything is to do with ease of use. My favorite languages are currently Java, PHP and (slightly) Python. For this reason Application development (for a desktop) seems like a horror to me and I stayed away from it since I left Delphi.

        Java failed completely on the Desktop. Swing applications just don't cut it. Interfacing with system files is hard. You really don't want to develop GUI applications (of any competence) in it?. Only Java application I use is jEdit. It's my favourite programmer's editor, but there are many gripes with it. Mostly due to the component (GUI) system that does not agree with regular usability standards.

        I consider it *really weird* that C++ is the only acceptable language for real desktop application development (or Objective C for the Mac).

        The whole compiler/linker/build system is really ugly from my pov. Also hard to learn. My first step was to use Python with GTK2 but GTK is .....

        Well. I never expected it to be so bad. I spent 90% of my time getting around undocumented failings.

        Stuff that didn't work in Windows at all or has way different behavior in Linux. Completely undocumented PyWin32 library. PyGTK documentation just ripped from C GTK documentation but not completely (missing parts). Having to read the C source to PyGTK just to know what's going on or to know how to do a certain thing.

        That was my first encounter to Linux programming. The void.., the destitution. A once full featured or at least popular windowing toolkit. One of the hallmarks of Linux. And it turns out to be so bad. There are bugs in it that have existed for at least 10 years.

        A toolkit is your foundation. If your foundation is so bad, the entire house will be badly constructed. That was mirrored in the talk I listened to. Of some developers switching from GTK to Qt. But Qt was not all that great either. At least much better.

        Truly, it is an older version (GTK 2) but it's been around for a while and it is just so bad? Apparently. I can't really fathom it but it seems to agree with the rest of what I've seen of Linux (development). This is stuff they don't tell you. People say here that my appreciation of Linux (or valuation) is 'off', that I am misjudgeing it. But when I get into it myself and get hands-on experience it is worse than I expected.
        Last edited by xennex81; Jul 13, 2015, 02:03 PM.

        Comment


          #5
          To the question of compile once versus compile for each platform, I think the latter has proven to be the superior model. Java never had a GUI toolkit that was very native. I'm not sure whatever .NET (mono) tried to achieve. I did not agree with the direction Microsoft was going so decided to go with Java/PHP. I think the compile once concept is almost dead. I'm still writing in Java, it is nice as a networking language and not hard to write beautiful code.

          Comment


            #6
            Originally posted by jpenguin View Post
            Which do you prefer? Coding in a language like Java and having 1 binary of like C++ with QT?
            That's a false dichotomy, and a misstatement of Qt's capability. For several years before I retired I was developing in house applications using the Qt API. I wrote the source code on Linux against a PostgreSQL database for testing and when I had them the way I wanted them I'd export the source to Windows and compile it there against Oracle. I used compiler defines to set up the proper database environment for the platform being used.

            The Qt API and C++ combination is a joy to use, and C++ is certainly not "horrible". It is a poor workman who blames his tools.
            "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
            – John F. Kennedy, February 26, 1962.

            Comment


              #7
              Originally posted by GreyGeek View Post
              The Qt API and C++ combination is a joy to use, and C++ is certainly not "horrible". It is a poor workman who blames his tools.
              +1. There's certainly a learning curve, but I really like C++ (thanks yet again for giving me a push to learn it Gerry!)
              samhobbs.co.uk

              Comment


                #8
                I'd have to get more experience with C++ to be able to impart what would be 'horrible' about it. I just stayed away from it as far as I could (from C in general). I have a little experience with both but only university courses. It is a good workman who chooses his tools wisely, I guess. But what is the false dichotomy??

                And what is the range of Qt? It is much more than a Windowing Toolkit, isn't it?

                Comment


                  #9
                  For most thing I find C++ better too, Java has it's place- but I could do without it on the desktop.

                  (I meant or not of in the OP)

                  I really need to update my C++ knowledge...
                  Last edited by jpenguin; Jul 13, 2015, 03:03 PM.
                  Registered Linux User 545823

                  Comment


                    #10
                    Originally posted by xennex81 View Post
                    And what is the range of Qt? It is much more than a Windowing Toolkit, isn't it?
                    It can be, I haven't used much of it; or it can be as simple as this tictactoe game (needs updating, it was one of my first QT4 apps)
                    http://www.mediafire.com/download/0m.../TicTacToe.zip
                    Registered Linux User 545823

                    Comment


                      #11
                      Originally posted by jpenguin View Post
                      For most thing I find C++ better too, Java has it's place- but I could do without it on the desktop.

                      (I meant or not of in the OP)

                      I really need to update my C++ knowledge...
                      Qt duplicates Java's garbage collection and pointer control with its QOBJECT, which is the base class of all Qt objects and exceeds anything Java can do. Just add Q_OBJECT as the first line in your primary class. It's "Signals & Slots" objects are extremely powerful and much easier to use than C's callback functions. For Windows you have such API's as VisualBasic, which is NOT OOP, Visual Studio, which is not OPP either, MONO, .NET and abandon API's like Visual FoxPro which claims OOP but isn't really.

                      Java depends on the client running a virtual machine which executes the java source (applets) in a JIT manner. Without the local VM Java wouldn't work. For a Qt app to work it's compiled binary has to be run on the client, assuming it is a static binary, otherwise Qt libraries have to be on the path.
                      Last edited by GreyGeek; Jul 14, 2015, 08:57 AM.
                      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                      – John F. Kennedy, February 26, 1962.

                      Comment


                        #12
                        I know a bit of basic, but not VB; played around a bit with Pascal & assembly.
                        Registered Linux User 545823

                        Comment

                        Working...
                        X