• 0 Posts
  • 243 Comments
Joined 3 years ago
cake
Cake day: June 30th, 2023

help-circle




  • TIDALs continued awesomeness suggests suitable alternatives.
    Spotify pays Joe Rogan how much? And pays artists how little?
    TIDAL does music.
    I changed a few years ago, and all I miss are the integrations.
    I’m lucky that I have decent speakers & dac on my desktop, and decent IEMs. So I can listen to music where I want.
    But I can’t buy a “tidal speaker” in the way I could buy a “Spotify speaker”.
    But I’m arrogantly confident enough to waste some money solving this with home assistant, some rpi/nucs, and some speakers. I feel I don’t need (I actually don’t want a vendor locked in) “just works” solution, and I’m happy rolling my own.






  • I doubt it.
    Tripping over a cable is as likely to damage the socket as it is to rip the cable out of the plug.
    Any appliance that increases risk by being unplugged should probably not be using a consumer connection…

    I think the 3 pin layout caused a lot of headaches, and the integrated fuse required a user-servicable plug.
    So it would have to be a split-shell design of some type, where the appliance cable would have to be cable-gripped to the same part as the plug/socket pins.
    Thus, a bottom-entry (heh) cable grip and a removable back plate that can only be unscrewed when it’s unplugged.
    This was all in a time of bakelite. Plastic wasn’t flexible.

    But no, I think tripping over an early bakelite g-type (I think it’s officially a g-type) plug cable would likely shatter the plug and pull the pins out of the socket… If it didn’t also damage the socket.


  • Heck yeh! Great work.
    I think most critique has been covered.

    I consider too-many-indentations to be a code smell.
    Not actually an issue, but maybe there is…

    There is nothing wrong with your code, and no reason to change it (beyond error catching as you have discovered). It runs, is easy to follow, and doesn’t over-complicate.

    I like descriptive function names and early returns (ie, throw or return on all the conditions that means this function shouldn’t continue, then process the parameters to return a result).
    This could massively clean up what’s going on.
    There could be a “getUserCommand()” that returns the desired number, or 0 if it’s invalid.
    If the returned value is 0, then break.
    If the returned value is 6, then print values; then break.
    Otherwise we know the value should be 1-5.

    You could use an Enum to define the choices.
    This way, the print lines and the conditional tests can both reference the enum. It also removes “magic numbers” (IE values that appear in code with no explanation).
    In something simple like this, it doesn’t really matter. But it improves IDE awareness (helping language servers suggest code/errors/fixes). And Makes the code SOO much more descriptive (Ie “choice == 3” becomes “choice == Choices.Product”).