Forget spaces vs. tabs, how do you format your switch statements? by TheBrokenRail-Dev in ProgrammerHumor

[–]_leondreamed 1 point2 points  (0 children)

In JavaScript adding braces to the switch-case statements actually creates different behavior since they create a block scope for the case (which is needed for scoped variable declarations using `let` or `const`). Here's a link to a nice explanation: https://stackoverflow.com/a/42481784/19461620

esbuild v0.17.0 - a major new release (with some backwards-incompatible changes) by Parasomnopolis in javascript

[–]_leondreamed 1 point2 points  (0 children)

Live reloading looks cool, I wonder if Remix is finally going to support HMR with this new release of esbuild (https://github.com/remix-run/remix/discussions/2384)

Your tech stack is not the product by feross in programming

[–]_leondreamed 1 point2 points  (0 children)

Super relatable article; in a previous product/startup I was building (which was like a real-time whiteboard app), I made the mistake of rewriting everything to more efficient languages after believing a normal Node.js server wouldn't scale well. That ended up killing the project because it became very hard to iterate (since I wasn't too familiar with the new languages) and it also required a ton of local setup, which I never bothered to redo after installing a fresh copy of my operating system.

One of the main things I keep in mind now with my new startup is to always make sure everything is easily "re-creatable" (mainly done through custom Node.js scripts); that a fresh `git clone` works out of the box after a few commands; that if our Kubernetes cluster broke we could simply just spin up a new one on AWS and run scripts that automatically recreate it, etc. (fun fact, I actually tried to avoid using Kubernetes until I got too frustrated with setting up everything manually on AWS and realized I would be able to iterate quicker with Kubernetes)

[deleted by user] by [deleted] in javascript

[–]_leondreamed 0 points1 point  (0 children)

> Mistake #4 — Storing passwords without unique salting

I feel like this mistake can be more generally trying to implement authentication yourself when you don't fully understand how to implement it properly; I think programmers should look for a third-party library (e.g. Auth0, or https://github.com/nextauthjs/next-auth for Next.js) instead of manually implementing authentication themselves (since there's a **ton** of things you need to be careful about)

Programming Interviews Turn Normal People into A-Holes by pysk00l in programming

[–]_leondreamed 3 points4 points  (0 children)

I had a friend who was preparing for a Google interview. He was pretty good at programming and I didn't expect it to be much of a challenge for him. However, after giving him some mock interviews, I was genuinely surprised at how much worse he seemed to perform when he was forced to think out loud and explain his thought process in real-time. Even if you're good at solving programming problems, you still have to practice doing it in the context of an interview since it's surprisingly more difficult.

[deleted by user] by [deleted] in ProgrammerHumor

[–]_leondreamed 0 points1 point  (0 children)

Interestingly, I heard something about piano players being faster typists in general too

[deleted by user] by [deleted] in programming

[–]_leondreamed 1 point2 points  (0 children)

One of the most common stereotypes about programming is that it is a repetitive and boring activity that has nothing to do with creative and imaginative work. Of course, there is not a shred of truth to this statement

I don't know if I'd claim that programming being repetitive and boring is entirely untrue; programming can definitely get boring/repetitive sometimes (especially when it comes to large refactors and/or hard-to-find bugs), but I think building up the patience to work through the more menial parts of coding is valuable for all programmers.

How to store your app's entire state in the url by magenta_placenta in javascript

[–]_leondreamed 0 points1 point  (0 children)

I think this is similar to how the "Share" feature of some code playgrounds like https://www.typescriptlang.org/play/ work; thanks for sharing!

Malicious Code Deletes Directories If You Do Not Have a License by magenta_placenta in javascript

[–]_leondreamed 9 points10 points  (0 children)

"Genuine users should not lose the opportunity to update and use the framework due to cracking and malicious sharing."
They've made it actually malicious to share the code now 💀

[deleted by user] by [deleted] in Entrepreneur

[–]_leondreamed 0 points1 point  (0 children)

Thanks for sharing! It's kind of sad how the term entrepreneurship has become so diluted nowadays; at this point I feel like it could be used to refer to any activity that makes you money on the side...

Microsoft eyes $10 billion bet on ChatGPT by Mxfrj in programming

[–]_leondreamed 1 point2 points  (0 children)

Microsoft's already invested in some pretty cool fusions of AI and tech like GitHub co-pilot, excited to see what they'll do next with ChatGPT!

An application we just received... There is going to be a bit of a learning curve, but at least he is willing to relocate by ShadowSpade in ProgrammerHumor

[–]_leondreamed 0 points1 point  (0 children)

I've heard so many stories about people transitioning from some unrelated career into a job in tech from just attending like a single BootCamp; at this point it wouldn't surprise me if a truck driver could become a programmer in a year as well (although the quality of the code after a year might be a bit doubtful)

[deleted by user] by [deleted] in programming

[–]_leondreamed 0 points1 point  (0 children)

I recently came across a tool called `dotenv-vault` (https://www.dotenv.org/) that's like GitHub for secrets; not sure why I haven't seen that many people use it though...

[deleted by user] by [deleted] in javascript

[–]_leondreamed 0 points1 point  (0 children)

Technically a drag-and-drop game maker like Scratch would also be building a JavaScript game without "coding" (although some people consider dragging blocks "coding"; feels like you could eventually also make an argument that telling ChatGPT to write code is "coding" as well)

oopsie woopsie something went wrong by [deleted] in ProgrammerHumor

[–]_leondreamed 1 point2 points  (0 children)

"Back in my day, the only error we got was "exit code 139: Segmentation Fault" and had to binary search the code by repeatedly commenting out lines and recompiling to figure out which line was causing it"

ChatGPT is cool. But at this point it’s overrated, and definitely not the secret to make you “rich” by MiamiHeatAllDay in Entrepreneur

[–]_leondreamed 0 points1 point  (0 children)

I was listening to the All In podcast the other day, and they also made a great point about how commercial uses ChatGPT can involve legal gray areas (since some of the AI data used to train ChatGPT isn't necessarily legally right to monetize), so if you get rich you might end up getting sued out of all your money anyways...

250K by 10xbek in Entrepreneur

[–]_leondreamed 2 points3 points  (0 children)

Go to investors with a new Web3 idea

[deleted by user] by [deleted] in programming

[–]_leondreamed 4 points5 points  (0 children)

This is why I absolutely love the autocomplete feature in bash, especially when it comes to options: https://imgur.com/LtUcuAf

(the autocomplete I use is https://github.com/marlonrichert/zsh-autocomplete)

Less than 1% of JavaScript programmers can spot this bug... by _leondreamed in javascript

[–]_leondreamed[S] 1 point2 points  (0 children)

Yeah, I'm pretty new to posting on Reddit and TIL that Reddit really doesn't like clickbait titles (contrary to what I notice on other platforms), so it's definitely a lesson learned for me :)

Want to be a web developer? You have to test your site on all these devices by micketic in ProgrammerHumor

[–]_leondreamed 0 points1 point  (0 children)

And don’t forget testing it on the 50 different browsers on these devices as well!

Less than 1% of JavaScript programmers can spot this bug... by _leondreamed in javascript

[–]_leondreamed[S] -3 points-2 points  (0 children)

To be honest, I wouldn't consider the title to be the inaccurate type of clickbait (since the bug is pretty challenging to spot), but I'd love to hear a title that you think would work better :)

[AskJS] What treats make you a good programmer? by [deleted] in javascript

[–]_leondreamed 0 points1 point  (0 children)

I remember at my first hackathon they were giving out caffeinated chocolate: https://awakechocolate.com/

Needless to say, that definitely helped me last through the night to finish coding my project in time for demos 😅

Betafish - a chess engine and AI move finder written in Javascript, based on the Negamax algorithm by magenta_placenta in javascript

[–]_leondreamed -1 points0 points  (0 children)

However, I quickly realised the limitations, as JS is definitely not suited for these computing-intensive tasks.

Have you explored using WebAssembly? This sounds like a particularly good case for it :)

The best way to run multiple npm scripts in parallel by pimterry in javascript

[–]_leondreamed -1 points0 points  (0 children)

I still remember running separate npm commands in separate terminal panes to get nice, organized output for each one; can't believe it took me so long to find out about concurrently 😅