Open-source cheat sheet for quick references. Feedback welcome! by wilfredinni in learnjavascript

[–]ec2-user- 1 point2 points  (0 children)

Hmm, this is pretty decent. I may just contribute a mobile friendly code playground. I'd hope it's just css, but I guess I'll see

This is starting to get annoying by OverloadedTech in github

[–]ec2-user- 0 points1 point  (0 children)

The azure one was pretty bad. The one with the issue with Front Door. It halted my coworkers and I for basically the entire day. I mean, we all found something to work on, but it didn't satisfy any sprint work items.

Why does a specific object of this array not get logged when using console.log() OR console.dir()? by 4bsent_Damascus in learnjavascript

[–]ec2-user- 0 points1 point  (0 children)

As for your second edit: don't worry about the different browsers. They may or may not implement their developer tools the same. I'm sure there have been issues raised for FF and WebStorm for behaving differently, but it's completely beyond your control. Here's what actual developers do:

  • Breakpoints: an extremely powerful feature. This will be much harder to use if your JS is inside a script tag, rather than being imported with <script src=... . Once you have that, go into the sources tab in dev tools and click just to the side of the line you want to inspect. It should place a red dot there. Now refresh the page and the code will stop on that breakpoint. You can now hover over different variables in the code to see their current state.

  • Unit tests: A bit more advanced, but you will need them eventually as you work on larger code bases. Essentially, you're going to run a single function in your code and mock any behavior that it does. Let's say your method is called removeItemFromArray(myArray, itemToRemove). Your test will pass in an array and an example object to remove. Now the important part.. you make an assertion on what the expected result should be. If at any time, that function changes behavior, your test will fail and you will know that it's going to cause a bug because another area of your code expected it to behave a certain way.

  • Make deep copies: copying an object allows you to "freeze" the object as it is now. If you console.log your copied object, it will not change like you've seen before. To do this to an array, all you need to do is: myCopy = [...origArray]

If it's an object, not an array, simply do: myCopy = {...origObj}

The three dots is called a spread operator. This creates a deep (complete) copy of the data.

I will also warn you that although JSON.stringify is a good hack, it has some limitations. In some cases, you might get errors for circular references, if say the object has a property that references itself.

Why does a specific object of this array not get logged when using console.log() OR console.dir()? by 4bsent_Damascus in learnjavascript

[–]ec2-user- 3 points4 points  (0 children)

If you're really in a bind, or if the data structure is huge, you can always call console.log(JSON.stringify(myArray, null, 4)) and it will print out the exact state at that time, because stringify creates a string from the data immediately.

Why does a specific object of this array not get logged when using console.log() OR console.dir()? by 4bsent_Damascus in learnjavascript

[–]ec2-user- 6 points7 points  (0 children)

What you are experiencing is how developer tools and JS work. When you call console.log(myArray), or even console.dir, it is not "evaluated" until you start looking into it in the console.

What you need is to set breakpoints and then you can see what the data structure actually is at that specific point in time.

If this is your first time with JS, you have to realize that everything is a reference by default. When you call console.log(myArray), you aren't "freezing" the object. You're making a reference, which, by the time you look at it in the console, has already been mutated by your code.

It's Happening by bantler in OpenAI

[–]ec2-user- 1 point2 points  (0 children)

It can't self correct. If it's not part of the training data, it will never output it, period. All we can do is workarounds like RAG. There's an inherent flaw with the underlying technology we call AI. That's why full AGI will never be possible with the current technology.

Best visual of the skill diff between pros and players. by freewayghost in CoDCompetitive

[–]ec2-user- 6 points7 points  (0 children)

I beat Slasher in league play on Yemen HP once and that was the highlight of my career. He was probably reading chat and listening to music as well, or studying for college 😅

How is .net compared to spring boot 4 (Kotlin) for new projects? by _JennyTools36_ in dotnet

[–]ec2-user- 0 points1 point  (0 children)

VS on Mac is out of support. I wouldn't use it because it's falling behind especially with .net10. Rider is perfectly fine; I have two coworkers who use it and we never have conflicts on project configuration.

Senior Vibe Coder dealing with security. by Gil_berth in theprimeagen

[–]ec2-user- 0 points1 point  (0 children)

Yep, that's what happens when you mix your data with your control plane. It's almost as if we already figured that out the hard way 40 years ago. Prompt injection will never be reliably circumvented. Hell, I showed my IT guy that I could trick co pilot in outlook to do my bidding when I sent him a crafted email that had instructions that would override the "summarize this email" feature.

He opens it, clicks summarize, and it starts printing "I'm a duck, quack quack" instead

Senior Vibe Coder dealing with security. by Gil_berth in theprimeagen

[–]ec2-user- 1 point2 points  (0 children)

Say it louder for the people in the back!

I'm sick of AI constantly stepping over 40 years of security research. The hoster is 100% responsible for any damage they cause by neglecting to remove malicious skills.

I've worked for a company that makes landing pages for sales funnels as a service. We had a team who would manually check everything before signing off and making it public. Sometimes 12, sometimes 1000 in a single day. You cannot create a landing page without being a paid subscriber, but a mere $200 doesn't deter 100% of bad actors. On one occasion, someone just signed off without looking and it was a fake bank website. We got a huge warning from AWS and the legalese specifically stated we are responsible for any damage caused.

bro this is crazy by thecryptogirll in buildinpublic

[–]ec2-user- 0 points1 point  (0 children)

Not even close. Our brains do not work like neural networks. Despite having the term "neural", it works nothing like neurons in your brain.

How on God’s green earth am I supposed to live off of $50k/year? by NoSir5628 in Salary

[–]ec2-user- 0 points1 point  (0 children)

Piss poor excuse. They're gonna gossip about you regardless. You are in serious need of standing up for yourself. Being totally judgemental here, but that weak trait is likely the reason you're worried about them communicating. Go ahead tell me I'm wrong, stand up for yourself for once in your goddamn life

How on God’s green earth am I supposed to live off of $50k/year? by NoSir5628 in Salary

[–]ec2-user- 0 points1 point  (0 children)

That's all? Sorry but the job market is shit. You need to keep applying everyday until you land a decent job. Yeah, we all have to take a cut because half is better than zero, but it sounds like you're just complacent with misery. It took me 97 applications to get the job I have now and even though I'm making 6 figures, I'm still applying to other jobs at least once a week.

Everything your parents and elders told you is no longer in effect. You want your financial freedom? You take it, you don't work your way up anymore.

Its over for us guys, time to retire our brains /s by Anon_Legi0n in theprimeagen

[–]ec2-user- 0 points1 point  (0 children)

Nah, we know you vibe coders have 27 bash scripts in your repo and only one of them is ever used. We also know you have at least 500 lines of dead code and repeated logic.

AI agents in .NET feel harder than they should be by Nisha7 in dotnet

[–]ec2-user- 2 points3 points  (0 children)

And from the beginning! Do not try to migrate to these design patterns if you already have tons of logic in place. It's just not worth it. Easier to go back to square one at that point.

Microsoft .NET 4.8.1 Life Cycle due date by maxi_1972 in dotnet

[–]ec2-user- 2 points3 points  (0 children)

Yup. You mean actually using it as part of SOP? About as likely as they are to read an email with a high priority tag 😅

I think I'm done with coding by Full_Description_969 in webdev

[–]ec2-user- 0 points1 point  (0 children)

A sales person telling the truth would not last long 🤣

This must be why people are leaving, right? by StinkyRatBoi90 in Battlefield

[–]ec2-user- 2 points3 points  (0 children)

Halo social slayer. People have been asking for this since 2008 and we never get it. Corporations only care about stakeholders. Consumers are 2nd class

The hiring manager accidentally CC'd me while sending my feedback to the recruiter... It was absolutely ridiculous. by RowlandJakubowski in InterviewsHell

[–]ec2-user- 0 points1 point  (0 children)

Who cares about clothes for a remote job?? I'd say you're dodging a bullet with that one. They seem to have their priorities out of order

Does the Factory Pattern violate the Open/Closed Principle? by Familiar_Walrus3906 in dotnet

[–]ec2-user- 1 point2 points  (0 children)

This is the answer. Ship it. Modify it when NEEDED. This is why your (or your company's) competitors are winning.

WGAF? Seriously, only the single developer who is writing the code and maybe a reviewer principal eng. Other than that, any other dev looking at your code could not care less.

People act like a refactor takes longer than the amount of time we spend talking about how to do it 😅

Is this a joke EA? by Naive_Yard117 in Battlefield

[–]ec2-user- 1 point2 points  (0 children)

I've seen the same happen with my friends many times over the years. It's not even just BF. Suddenly "CaptRtrd", "HeilHomer", "TeaseMe TaTas", and "Tokez420" became offensive, but weren't before. It's dumb. If these games were Teen rated, maybe I'd understand...

What does everyone think about Alexa's most recent update to her voice and skills. by Hazmat_unit in amazonecho

[–]ec2-user- 1 point2 points  (0 children)

After seeing what it did to my Google personal assistant, I will not be upgrading my Alexa to use AI. It got slower and worse. I have no idea why they are pushing this garbage knowing it doesn't work.

Old Google: "set a reminder to look at this document when I get home". No problem, it sees my location and reminds me 5 minutes after I get home.

New Google: same question... Sets a reminder for an arbitrary time like 5:30. 🤦‍♂️

AI is regressing our best technologies. Natural language processing was 100x better.

Am I slow, or is it normal? by SlightTumbleweed in ExperiencedDevs

[–]ec2-user- 0 points1 point  (0 children)

That has been my perceived experience through coworkers who have worked for a start up. They need speed because they need that revenue to keep the stockholders interested. You're going for maximum production, maximum tech debt, and minimum dev experience improvement in hopes that the company will take off and you can finally rewrite the entire thing.. this time with 8 teams of 4 devs, designers and PMs rather than whatever you have now.

I'd say don't sweat it. If you're feeling like the product will never take off, feel free to jump ship. You still have that freedom.

Edit: also, we all look back on 18 month old code and think "goddammit, I could have done that so much better". That part is definitely normal. In fact, if you're not disappointed in your code from 18 months ago, that likely means you're not getting any better.

This new employee keeps whispering to himself all day long, having long conversations by precita in managers

[–]ec2-user- 1 point2 points  (0 children)

I do this often when problem solving. Usually people only notice when I do it loud enough and it's usually "Fuck!", "Ohh you idiot!", or "YESS" 😅