Yes Virginia, Worse is Better | CR 10

Yes Virginia, Worse is Better | CR 10

As much as we might like to have different fully native applications for every platform we target — that can be more than a little inefficient not to mention expensive.

This episode is all about compromise.

Direct Download:

MP3 Audio | OGG Audio | Video | Torrent | YouTube

RSS Feeds:

MP3 Feed | OGG Feed | Video Feed | Torrent Feed | iTunes Audio | iTunes Video

Show Notes:

Feedback

Code School Affiliate

This Week’s Dev World Hoopla

  • Digia bought QT — please don’t go the way of Mono….
  • Steve Yegge’s Liberal / Conservative Software Axis
  • ZOMG TextMate 2!

Mikes a Sad Panda

  • Sales progress….

Write Once Suck Everywhere

  • Using the same code base across multiple platforms
  • How Java fits in
  • Other options?
  • About those pesky designers….
  • The Great Web Hope
  • 20,000 Leagues Under Java!

Mike’s Plug

Tool of the Week

Book of the Week

No tips yet.
Be the first to tip!

Like this episode? Tip with bitcoin!

1GycaYznP79SAEQtPg6L83ZL3zcHDu4ZRu

If you enjoyed this episode, found value or information from it, please consider contributing using Bitcoin. Each episode gets its own unique Bitcoin address so by tipping you're not only making our continued efforts possible but telling us what you liked.

  • Yvan Da Silva

    First : PLEASE DIGIA don’t go the mono way :(

    I smiled when you guys spoke about Qt :)
    I know I’m kinda responsible for what you’ve said today and it’s great to see that you guys are really interested in how things works. And that you do realize that Qt is more than a simple graphical framework. It is indeed a platform, it is indeed made to be multi platform (arm architectures, embed devices, etc.).

    For me it’s direct concurrent it’s Java, even it’s not really it’s concurrent because Qt is not made to build web apps like Java EE and Java itself can’t concurrence C++ .
    Try to run a JVM on a small embed device and forget to optimize your code, you’ll be in a world of pain if that embed device is able to run a system that it’s able to run a jvm….

    About specific platforms development, sadly you’ll have to deal with the same problems that you have with any other framework. Like the ubuntu notifications, maybe adding a specific lib to the ubuntu builds is the way to go, in terms of easiness of development and in terms or results.

    Windows & OS X are two closed a*****, and so when you don’t dev with their native tool you always end up fixing here or there a few things.
    If you don’t use any very specific graphic feature then Qt as GTK will work just good, but as soon as you try to use some system very specific feature your stuck with their code and libs.

    If you have code running on both platforms that don’t need changes, then Qt or GTK is just a matter of taste because all you’ll be using is the graphics part. Qt will look native GTK you’ll have to work it out a little more to achieve that result.

    If you do have code that is not running on both platforms, definitively go with Qt, it will make things way more portable.

    Good luck with your project, as I said feel free to ask any question :)
    I’ll be glad to help.

  • Yvan Da Silva

    I read the chat / irc while watching the video and seriously, people are so much misinformed about Qt.
    It’s kinda sad :/ Nokia really had a bad impact on Qt.

  • Zane Swafford

    Question to Coder Radio: I am someone who is starting on my C.S. degree. I have had some (little) experience with making some python desktop apps and C with Arduino and scripts. I’m not surrounded by people who know anything about programming. They think my end product looks fine but I am unsure. You talked about established design patterns in episode 10, but how do I know what patterns to use? Basically what I am asking is how do I know if the code I am writing is crap if there is no one there to tell me? Is there a book or set of styles to study and learn from to know what tools to use. I’m glad my code compiles but I’d like to know if what I am doing is right.

  • Zane Swafford

    Also, Autodesk’s Maya (Blender-like 3D modeller) is made in Qt and runs on Windows and Mac. Source: http://qt.nokia.com/qt-in-use/autodesk/

  • http://profiles.google.com/smcardle101187 Sean Mcardle

    After being thrown head first into a developer role about a year ago, the
    best tools found are: O’Reilly books, API docs, code from similar
    open source projects. Books that cover a specific language I find to
    be invaluable as a reference when I’m questioning my methods, most of
    the O’Reilly books with a high ranking on Amazon are worth the price.
    I don’t know what you’re app is but I was forced into a C#/.Net world
    and I’ve found that the MSDN documentation for .Net and C# are top
    notch if you’re doing anything on Windows. Last, critically read the
    code for well established open source projects, they contain a lot of
    great code to model yours after and some of them are well commented
    so you can understand the thought process behind it.

    Places
    like stackoverflow.com have communities that are pretty hard to get
    into for new people but you also might try posting a snippet on Github
    and link to it in the G+ comment thread for CR. We have a great
    community, it’s likely someone out there could give you some
    feedback.

  • Oded Arbel

    The discussion about cross-platform development at the end of the episode really made me sad – so many misconceptions propagated…

    Mike – first you say that all cross-platform development languages are probably fast enough to write desktop application, then you start griping about people not writing in C++ have to spend all their time optimizing their code. Simply wrong! just look at all the android apps that are written in Java and Javascript and operate on small devices with limited memory and CPU power, and _work_just_fine_.

    Now about Qt – I’m not saying its a wrong choice, its a powerful framework and I like it lots (Though you could have cleared up the licensing confusion that people have – someone in the chat said something about needing a license to statically link… oh, the humanity. are these people born stupid or do they work hard at that?). The main problem with using Qt for general desktop development, is that it is based on C++ and while it builds on it and provides some new and simple syntax, essentially you still need to write your application in C++ – and C++ is a horrible language to do rapid application development in! I know Mike likes it a lot, but then again he thinks Objective C (with its horrible “bracket message dispatch semantics”) is the best programming language, so excuse me Mike while I ignore your opinions about programming language design. C++ is huge, complicated, does not provide nearly enough syntax to facilitate modern programming paradigms and application design (though C++11 does a good job of addressing many issues, don’t expect it to be seriously usable before 2014). Doing anymore more then simple arithmetic in C++ requires you to understand auto pointers, figure out how your platform handles threads, create IO and synchronization constructs and deal with lots of nitty-gritty junk that high-level languages such as Java, Ruby or Python allow you to take for granted.

    For rapid application development in a cross platform manner, and assuming you don’t like Java because of Swing (and you don’t want to deal with SWT, which I fully understand), then my recommendation would be to use a dynamic language for which binding are provided to your graphical toolkit of choice – Qt, if you like – such as QtRuby or PyQt. Also, writing portable desktop applications in Javascript is not far-fetched, using Qt WebRuntime or Chromium Embedded Framework, and you guys should maybe look at that.

  • Yvan Da Silva

    @google-21a10c379a9dfc3284a4a75edb933745:disqus They didn’t said you HAD to use C++ & Qt. But that it was a serious tool of cross-platform development.

    Yes there is bindings for Qt (which show that people are really interested in that framework).

    About Rapid development : I absolutely disagree, c++ gives you serious advantages compared to other languages. You might not write as many lines as you do with Java. but you certainly don’t spend months dealing with performance issue.

    I don’t know what kind of desktop apps you develop, but if they require real cpu time, you can just drop java. I have been doing programs that had to deal with genetics algorithms, fuzzy systems, run on multiple architectures, draw graphs, support scripts, work on console and also have a GUI. They serve to detect cancers and trust me it requires horse power and memory.

    You can find many books concerning “Rapid development” and it’s really not always what you think it is. When you dev you should always design your application in terms of software architecture first and that’s what should take you a good part of your work. So this is not language related, if you just go to a white paper and start coding with your favorite language you are probably doing it wrong. At least there should be some sketches, I’m not talking about a huge complete UML even sometimes it might be a good idea to make them.

    If your program is very lightweight, you can choose whatever language, platform, framework, web or desktop you want and it will work just right.

    C++ requires much higher knowledge, yes it does, not all programmers can play with it and the libraries associated. But if someone aspires to an Engineer title or higher if they are unable to understand how a pointer works, how a thread works, how everything interacts with the system and such basic things. Then I seriously think something is heavily missing in their formation.

    If your program run multiple threads and your program is sharing data between those threads Java is not a great solution. You might want to run lock free algorithms which were not available in Java before Java5. Now you can access them with one their libs. Sadly those are poorly implemented and you’ll find many implementations on the web that will not work.
    http://www.ibm.com/developerworks/java/library/j-jtp11234/

    About Android, I wouldn’t take it to the discussion of rapid development. An application made for Android stays on Android. There a tons of specific methods, libs and specific implementation that will only work on Android.
    (Don’t get me wrong, I really like Android and have made two apps on it during my studies)

    NDK is not there because people didn’t like Java. It is there because there is a need of performance that Java can’t offer. CPU power ? Have you been following the huge increase in memory and cpu in the last year devices. Nowadays most apps are optimized for ARM6,7,8 architecture or tegra or whatsoever. Why is there so many applications that run perfectly on a device and crash on another ? Well it’s not a matter of UI (sometimes it is), it’s a matter of the optimization that had been done behind the scenes. Because you do need to spend countless hours optimizing your code, because you don’t manage your memory in Java, you may ask for the garbage collector to do his job but you can’t force it.

    Let me give you a simple example that does still fail today.

    Take a cell phone that has more than 8MP. Build an app that takes a picture (everything in Java), try to rotate that picture in memory (not only changing EXIF data). Without optimization or an implementation in C++ it will fail.
    Here is why : The camera is the one taking the picture (driver side) so it has the memory he wants to store it. Now you receive it via a callback available through the android API. Most of the time it will be an array of bytes. Now, you can try rotating it without creating a copy in memory (hard work, heavy cpu usage), because if you do create a copy 99% of the devices in the market will crash with a memory heap problem. And again thanks to the java machine.

    I’m not saying C++ is better than Java. NOT AT ALL. No one is better than another, each language has it’s uses.
    If someone just wants to writes everything in Java, we will end with cpu & ram eaters programs like many out there.

    And if your worries are performance, then there is no magic involved in dev languages. Assembler > C > C++ > Java > C# / interpreted languages here….

    Just by curiosity, I’ve been using C++0x for a while now and I don’t understand you say it’s not usable ? I see it like an API, in some years or months I might have to change one or two things to make it pass the compilation step, but it won’t brake my binaries like an API change does.

    I hope my explanation doesn’t feel aggressive or whatsoever.
    For the record, I do dev in : C/C++/Assembler/Ada/Java/Ruby/Python/Javascript/Haskell/Prolog / more to come.
    (Objective-C is another story, I tried, I didn’t like, I’m not sure I’ll give it another chance, maybe one day, but not yet)

    So yes I have a good knowledge of what those languages are and more importantly what’s behind the lines of codes I write. << "I would love to see more programmers able to say this, because many are morons stuck in their language that they barely know the syntax ! (Not speaking about someone in particular)"