• 0 Posts
  • 27 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle








  • letsgo@lemm.eetoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    16
    arrow-down
    1
    ·
    3 months ago

    That’s not a real operator. You’ve put a space in “i–” and removed the space in “-- >”. The statement is “while i-- is greater than zero”. Inventing an unnecessary “goes to” operator just confuses beginners and adds something else to think about while debugging.

    And yes I have seen beginners try to use <-- and --<. Just stop it.




  • letsgo@lemm.eetolinuxmemes@lemmy.worldSecurity
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    3 months ago

    Sure but if you’re doing rooty stuff all day then sudo you’re sudo not sudo going sudo to sudo type sudo sudo sudo every sudo fucking sudo time sudo you sudo want sudo to sudo do sudo something. And yeah it sudo caches it for sudo a bit but sudo it’s still too sudo much.


  • Yeah it always feels like “negative logic” to me. If it’s not this and not that then don’t do the other… Does my head in. Next time I’m going to use a lookup table “x…f.bf…fb.f…” then mod15 the index. f=Fizz, b=Buzz, x=both. Nice thing about this is that it’s easier to change with the requirements. Want to shift the second fizz right one? No problem “x…f.b.f.fb.f…”. Good luck doing that with the standard approach. Add Gronk which collides with Fizz, Buzz or both at various times? Also no problem - just extend and modify the LUT accordingly and change the mod.

    I can already hear people asking why x is at the start. Arrays are indexed from 0. FizzBuzz starts at 1. 15 mod 15 is zero. Loop N from 1-100, switch on lookup[N%15], case ‘f’ print Fizz, case ‘g’ print Gronk, case ‘p’ print FizzGronk and so on. The only “nice” original feature you lose is when both %3 and %5 fire at the same time and it prints FizzBuzz without any extra code.


  • The previous candidate to me at a job a few years ago left the room in tears after not being able to write Fizzbuzz. On a laptop with Visual Studio installed, on their own in a an empty room with nobody looking over their shoulders. The same company said they’d had so many candidate, including university graduates, who simply couldn’t code, that they were almost giving up on it.



  • You’d often get the error when there was paper in the printer though. Turns out the cause is the slightly different size between US letter page size and A4 page size. Technically the printer’s correct to complain (for the same reason it’d be correct to complain about an A4 sized print while full of A5), but virtually nobody gives a shit about that difference and so the “PC Load Letter” message just translated to “You have to push that stupid button before I’ll do anything because pedantry.”




  • For simple tasks you don’t need CLI. Most GUIs implement basic workflows and do a reasonable job at it (obviously not counting the ridiculous amount of time Windows needs to “compute space requirements” while deleting an empty directory. Seems it’s more important to get that little popup on screen and run the animation a few times than actually doing the job).

    It’s when you get past the basics that CLI comes into its own. Those grindy things you do in Windows clicking one thing at a time? Glue a couple of commands together in the CLI and it’s done in a tiny fraction of the time.