• 0 Posts
  • 104 Comments
Joined 1 year ago
cake
Cake day: July 3rd, 2023

help-circle




  • Man, I kind of feel for the poster.

    A while back I was tinkering with some website and installed some npm packages.

    Then I tried to delete the nodes modules folder… NOTHING worked… Safe mode, permissions change, command line deletion,… I spend like an hour googling and raging, it’s my fucking computer I put the fucking file there, let me delete it!!!

    I was ready to give up and finally stumbled on the answer on stack overflow. The npm folder that was created (I forget exactly what it was) had the ~ symbol in path name and that basically made the folder invincible.

    Luckily the poster also posted the command line to nuke the fucker and I was finally able to delete it.

    So yea, I kinda get it. Seeing that stupid you don’t have permission to delete this file pop-up is rage inducing.






  • Exactly. I’d also like to add, look at Google stuff their ui / ux is routinely horseshit. So don’t tell me there are ui/ux gurus out there GIGAchading user interfaces.

    A lot of this shit is trial and error and even then they still fuck it up.

    Make it accessible, make it legible and then fine tune it after.






  • Very interesting. Actually the part you mention about there being an initial 'btn' class is a good point. Using arrays and joining would be nice for that. I wish more people would chime in. Because between our two examples, I think mine is more readable. But yours would probably scale better. I also wonder about the performance implications of creating arrays. But that might be negligible.


  • Ok how about this then, I frequently do something like this:

    let className = 'btn'
      if (displayType) {
        className += ` ${displayType}`
      }
      if (size) {
        className += ` ${size}`
      }
      if (bordered) {
        className += ' border'
      }
      if (classNameProp) {
        className += ` ${classNameProp}`
      }
    

    How would this be made better with a functional approach? And would be more legible, better in anyway?