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

help-circle
  • That’s because it makes sense when dynamically creating HTML. HTML is not a programming language, it’s simply markup - so if you want to generate some block of HTML in a loop and later access that block of HTML in JS (e.g. to interact with the UI separate from creating it in the first place), it’s a completely reasonable thing to do.








  • It entirely depends on the culture around it. Is everyone expected to model underwear for their store? If someone doesn’t want to - is the culture supportive, neutral, dismissive, or antagonistic? Are they expected to do it but just allowed to choose not to? Or is there no expectation to do it, but volunteers are welcomed?

    I can’t imagine anyone is being forced to, but it wouldn’t surprise me if the company culture is dismissive or demeaning of people who would rather not.


  • GitHub Copilot is just intellisense that can complete longer code blocks.

    I’ve found that it can somewhat regularly predict a couple lines of code that generally resemble what I was going to type, but it very rarely gives me correct completions. By a fairly wide margin, I end up needing to correct a piece or two. To your point, it can absolutely be detrimental to juniors or new learners by introducing bugs that are sometimes nastily subtle. I also find it getting in the way only a bit less frequently than it helps.

    I do recommend that experienced developers give it a shot because it has been a helpful tool. But to be clear - it’s really only a tool that helps me type faster. By no means does it help me produce better code, and I don’t ever see it full on replacing developers like the doomsayers like to preach. That being said, I think it’s $20 well spent for a company in that it easily saves more than $20 worth of time from my salary each month.



  • It’s not just because of nonsense, it’s more that it doesn’t really matter what you do - the only thing stopping someone with physical access to your machine is their level of determination.

    At some point, there’s no stopping the laws of physics. Your data is physically stored there. You can do a lot to make it really difficult to access it, but the best you can do is full disk encryption with a sufficiently strong key, and only store that key on external hardware that isn’t accessible to the attacker.

    Even then, you better make sure that your encryption key wasn’t hanging around cached anywhere in memory before you shut down your computer.






  • What bike do you use and would you recommend it? I’ve been looking for an e-bike recently since I work so close to home, but I haven’t found any that seem reputable and a good value. I’m definitely looking for one that’s easily repairable and not paired to a specific brand’s software or proprietary parts.

    Granted, I’ve only been passively looking (I.e. when I see an ad or doing a quick google search sometimes), but from what I can tell most of the advertised bikes are just the same handful of models with a different logo slapped on it and dubious claims about its performance.



  • TypeScript is essentially the “measure twice, cut once” approach to JavaScript.

    Yeah, anything can be anything in JS and the type declarations don’t make it into the compiled JS, but allowing anything to be anything starts to become fairly dangerous when the size of your projects starts to grow and especially when you’re working with a team.

    Rather than writing functions and just hoping they always get called with a parameter that has the properties you expect to use, TypeScript helps you make sure that you always are calling that function with the right object in the arguments. You don’t need to debug some runtime error up and down 8 frames in the call stack because this week you named a property “maxValue” but last week you used “maxVal” or you forgot to parseInt some string because you thought it would be coerced - you just need to make sure your types match and eliminate that type of debugging altogether.

    All in all, TS really just enforces a bit of sanity to the foot gun that is vanilla JS.


  • “Dependency injection” is just a term for providing a function or method with its dependencies rather than making the function go and gather them itself.

    It’s (typically) done through parameters, but it’s still more specific than just invoking a function. It describes how that function was written and the reasoning for certain parameters. To the other commenter’s point, you’ll have a hard time communicating about your code with other developers if you refuse to use the term dependency injection just because you don’t like OOP.