back to article You're designing an internet fridge. Should you go for fat HTML or a Qt-pie for your UI?

The Qt Company would like to remind developers that JavaScript and HTML suck, at least in the world of embedded devices. The 23-year-old outfit, based in Espoo, Finland, happens to make an alternative: the eponymous Qt application framework, which provides an way to build interfaces using C++ and some other languages. So the …

  1. teknopaul

    I've written a fair amount in both html5+JavaScript and QT and I still find it pretty amazing how fast QT is. Working on a gui based music app of late, write this huge block of code and it all runs in less that a tick of the sequencer with out any attempt to optimize. Always. Code is neat, easy to structure, you would think lack of exceptions is hard to keep clean and it somehow isn't.

    No complaints.

    If you want a fast and responsive desktop app QT is yer man.

    As with all C and C++ one bug and it crashes. That's what drives people to other languages. You cant falt it on performance.

  2. TonyWilk
    Facepalm

    Meanwhile...

    1Gbps connection, blindingly fast UI, photorealistic 3D rendering and smooth 120fps 4k animation...

    Keeping things cool ?

    Well no; Sir must realise the cpu and graphics accelerator heat has to go somewhere

  3. Mage Silver badge

    You're designing an internet fridge.

    I'd say you should look for a new job, but anyway, QT is better than HTML for a GUI. HTML was designed for documents that could end up on any size screen with links to other documents. While you can do a GUI with it, QT is designed for GUI applications.

    1. mathew42
      Flame

      Re: You're designing an internet fridge.

      IoT is a great way to take an appliance that should last a minimum of 10 years and make it a security risk and obsolescent in 12 months.

      TVs are another example. Spend $6000 on a nice OLED TV running Android and it is obsolete before you purchase it, while the screen should be good for 10+ years. If I could buy a TV with an upgradeble Android component, I would pay a small premium. In a couple of years you can overcharge me again for the Android component, but at least I won't have to replace the TV.

    2. Mark 65

      Re: You're designing an internet fridge.

      I was wondering why you'd need 60 fps on a fridge. So what if HTML can't manage it, it's a fucking fridge.

      1. BongoJoe

        Re: You're designing an internet fridge.

        This is perhaps the first post on the subject that makes complete sense.

        Thank you

  4. captain veg Silver badge

    hard with HTML to make performant applications

    Not really.

    Hard with React/Angular/jQuery/framework-du-jour to make performant applications. Oh yes.

    Sheesh, just learn the DOM. Wrap it up in your own cruft-free library. You too can be one of those "really experienced developers", or something.

    -A.

  5. mark l 2 Silver badge

    Who needs 60FPS on a fridge though? I suspect like a lot of the IOT devices the internet connected fridge is just going to be a gimmick bought buy people with more money than sense.

    1. Updraft102

      I don't even know why anyone would need any frames per any unit of time on a refrigerator. Or a toaster, or a coffee maker, or a crock pot, or a bag squeezer that is sold as a juicer. The only appeal of all of these things I can imagine is that it impresses your easily-impressed friends. Any of them that have any sense would probably be as appalled by it as I would. Even if the security issues didn't exist, it still doesn't offer any benefit that would be worth using that I can see.

      1. Nolveys

        or a bag squeezer that is sold as a juicer.

        Unkle bumble fuck says that thar be the bits for what makin'er chooch wa.

    2. Anonymous Coward
      Anonymous Coward

      Youi'll need 60fps to make all the auto-downloaded ads to look nice.

      Alternatively they'll add a "shopping list app" to the fridge and will need loads of CPU/GPU power so they can animate the process of tearing off your shopping list from the notepad when you've finished with it.

      1. katrinab Silver badge

        And how is that going to be easier than tapping the order into your iPad?

        Besides, internet fridge developers seem to have forgotten that not everything you buy from Tesco goes in the fridge, or even in the kitchen.

        1. Doctor Syntax Silver badge

          "And how is that going to be easier than tapping the order into your iPad?"

          It won't make the fridge-maker any money.

        2. Number6

          Besides, internet fridge developers seem to have forgotten that not everything you buy from Tesco goes in the fridge, or even in the kitchen.

          Oh, they have. You can have another box for the bathroom, one for each bedroom, one for the cleaning supplies cupboard. All interlinked so they can compile a master shopping list for everything.

    3. Doctor Syntax Silver badge

      "the internet connected fridge is just going to be a gimmick bought buy people with more money than sense"

      Let's hope it stays that way and sensible alternatives remain on the market.

    4. Anonymous Coward
      Anonymous Coward

      Who needs 60FPS on a fridge though?

      To play Overwatch. Obvs.

  6. Doctor Syntax Silver badge

    Simple answer

    Don't.

  7. Not also known as SC

    "On a phone, you have to render 60 FPS instantly or it feels unnatural."

    And I thought it was just all that crap* that downloads on web pages these days.

    *self playing videos, adverts,tracking scripts etc.

    1. Anonymous Coward
      Meh

      Re: "On a phone, you have to render 60 FPS instantly or it feels unnatural."

      ""On a phone, you have to render 60 FPS instantly or it feels unnatural.""

      Odd on a phone it though Hz is more important than FPS.

  8. patrickstar

    HTML is fine for small, simple UIs for uncomplicated tasks.

    For anything above that, please take one for mankind and remove yourself from the gene pool if you even consider it. This also applies if you think "FPS" is relevant for the UI of a fridge.

  9. Will Godfrey Silver badge
    Mushroom

    If you're designing an Internet fridge...

    keep well away from me.

  10. Pete 2 Silver badge

    The code!

    loop () {

    set_temperature = read_twiddly_thing()

    if(get_internal_temperature() > set_temperature) {

    run_cooler_until(set_temperature)

    }

    if(door == open) {

    turn_on_light()

    } else {

    turn_off_light()

    }

    }

    does it really need more?

    1. katrinab Silver badge

      Re: The code!

      You need two temperature control things, one for the fridge section, one for the freezer section.

      My fridge has a fan thing that stops it from icing up, you need a control for that related to door opening.

      1. Anonymous Coward
        Anonymous Coward

        Re: The code!

        You need two temperature control things, one for the fridge section, one for the freezer section.

        You'd better tell the fridge-freezer makers, because most of them use a single thermostat in the fridge, and then drive the freezer off of that as well, keeping their fingers crossed that the gross approximations hold and the freezer stays frozen.

        This dodgy approach is why sometimes the freezer will defrost if the device is in a cold room, because the fridge stat isn't calling the compressor to run often enough to keep the freezer cold enough (I've seen this happen a couple of times). Most white goods makers would never waste money on two thermostats (premium devices excepted). In fact, the parsimonious nature of white goods makers is perhaps our best defence against the internet of tat. High end, high price buyers are stuffed: they are going to be delivered the full joys of IoT, but for the rest of us there's no way the makers will invest a couple of pence worth of extra components on commodity grade appliances.

        1. Doctor Syntax Silver badge

          Re: The code!

          "In fact, the parsimonious nature of white goods makers is perhaps our best defence against the internet of tat."

          Let's hope it stays that way. All the TV makers seem to have gone for double-dipping their customers.

    2. Mellipop

      Re: The code!

      A crap implementation!

      The light won't come on if the fridge is not up to temperature.

      Most OS have a "Big loop". All the events get tested in that loop. Trust me, even interrupt driven systems use an event loop to dynamically change priorities.

      This article is about UIs. They need high update rates so screen interactivity appears smooth. Sliders for example. Or how I'm writing on this tablet using a swiping keyboard.

      With embedded stuff it's all about the non-functional or system qualities.

    3. Kevin McMurtrie Silver badge

      Re: The code!

      As others pointed out, your light doesn't always work. Fancy minimalist fridges still have lots of tech. They have variable speed fans continuously running in each compartment, going just fast enough to keep the temperature even, so bread bags never become soggy on one side and dry on the other. The compressor is also variable speed so it doesn't need to be loud unless you've loaded it up with warm drinks. An alarm goes off if the fridge ever warms up into the "danger zone" where mold grows. The defrost heater runs based on metrics rather than a timer. There's even a heater in the fridge for people who live in very cold climates.

      1. Anonymous Coward
        Anonymous Coward

        Re: The code!

        .....There's even a heater in the fridge for people who live in very cold climates.

        All lovely stuff, but little or none of that tech is visible on the vast majority of £250-£350 fridge freezers sold by Currys, AO and the rest. Even at £500 you're not getting the full suite of those technologies (eg having to choose between models with door alarms versus those with temperature alarms). By the time you get to £700+ the specs are becoming more generous, but equally you're talking about models representing perhaps 5% of sales.

        1. katrinab Silver badge

          Re: The code!

          People who buy from Currys don't live in very cold climates, and no, Scotland is not a "very cold climate", it is actually incredibly warm considering how far north it is. [1]

          Maybe if you look at the Alaskan or Siberian equivalents of Currys, you might find these things.

          [1] Inverness is the same distance north as the south coast of Alaska. It is a lot warmer in Inverness.

          1. Anonymous Coward
            Anonymous Coward

            Re: The code! @ katrinab

            People who buy from Currys don't live in very cold climates, and no, Scotland is not a "very cold climate", it is actually incredibly warm considering how far north it is.

            OK, lets return to the basics. A fridge should have a temperature of about 4C, a freezer around -18C. On a single thermostat model, the design assumption is that the freezer will be kept within tolerances by the fridge compressor running intermittently, making a series of guesses about the room temperature, fridge vs freezer door openings, the addition of food, the known heat transfer through the insulation at given temperatures.

            Now, if you actually have a fridge freezer in an outbuilding, and the ambient temperature is at or below 4C, the fridge will rarely if ever run, and a single thermostat freezer will defrost. If the air temp is below freezing, then the fridge won;t run, the freezer won't come above freezing, but because the freezing temps of food are in the -4-9C range, the food is still too warm and starting to spoil. I've seen this happen many hundreds of miles south of Inverness. Now, in a cold room in a house, you're likely to be well above the 4C, but the problem still exists - if the fridge isn't used as often as the design assumptions, the compressor needs to run less frequently, and the freezer temp rises. On these everyday models, few have got freezer temp alarms, nor any over-ride. Maybe it keeps things frozen, but the temp is going to be well above -18C.

            Without a constant cooling load on the fridge of around (guessing) 15W, the compressor doesn't run often enough, the freezer temperature rises and may ultimately defrost. In a warm room, the ambient temperature and heat transfer through the insulation will be enough, but once you move to a cooler room you are relying on any over-provision in the original design assumptions. As I say, I've seen the big wet puddle on the floor, I've thrown away defrosted food, and I've seen it happen to others. Cheap, single thermostat fridge freezers are fine in a warm kitchen - away from that they are not as dependable as many people might like.

    4. Anonymous Coward
      Boffin

      Re: The code!

      Just checking that run_cooler_until() isn't a blocking call. If it is, then users of the fridge will be surprised (i.e.unhappy) at the non-responsiveness of the light from time-to-time.

    5. BongoJoe

      Re: The code!

      Judging by our fridge's performance, the read_twiddly_thing() is the seed for a random number generator...

  11. Spaller

    Rip the Q key off their keyboards

    I have a team of about twenty folks spread over the world building an engineering app, and we use Qt.

    I regularly threaten them that I'll rip the Q key off their keyboards if they don't keep their use of that thing to a minimum. We're just now moving to Qt5 across the biz unit, and not many are wanting to do it other than Qt4 is no longer supported. Faster? I don't think so. 60fps fridge? No one cares.

    If we build another app from the ground up, it'll be html5.

    1. Das Schaf

      Re: Rip the Q key off their keyboards

      Not a fan of Qt here.

      Use it once and it starts to spreads its cancerous tendrils everywhere. Smart pointers which aren't (no exception guarantees and no unique_ptr implementation). You can't use proper STL smart pointers like unique_ptr<> because the Qt container classes require anything in them to have an accessible copy constructor (due to copy-on-write "optimisation"). Copy-on-write optimisation is an anti-pattern in multi-threaded environments, in fact the standard library string class is forbidden from being implemented using C-O-W. Guess what QString uses .....

      Other GUI frameworks don't restrict your use of proper smart pointers and container classes, using optimisations which aren't in most circumstances.

      If you keep your GUI code well separated from the rest of your system, using a MVC or similar architecture, using Qt in the View part is OK I suppose. Don't let it near any critical processing though!

  12. Scott 26

    Smart Fridges

    Came here hoping for a SV reference... was disappointed

    (So I'll make the reference myself: https://www.youtube.com/watch?v=A48AJ_5nWsc)

  13. joeldillon

    Mildly cheeky for them to say 'the Qt compaby' is a 23 year old company. I'm pretty sure when I worked there it was called Trolltech and based in Oslo.

  14. tiggity Silver badge

    Internet connected fridge (ICF)

    I don't care what UI (though qt beats HTML hands down) as ICF is not getting in my kitchen, why would I possibly need it?

  15. DropBear
    WTF?

    "You can write web apps that are as responsive as native Qt, but you have to know what you're doing."

    So your pitch is effectively that it's fine to have no idea what you're doing as long as you just use Qt. Got it.

    1. Anonymous Coward
      Anonymous Coward

      Er, not exactly; 'if A then B' is not the same as 'if not B then not A'.

      But don't take my word for it, ask any Greek; they are all Socrates, after all.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like