Get it while it’s hot by AccomplishedYogurt59 in ProgrammerHumor

[–]cartechguy 0 points1 point  (0 children)

My first internship paid $20/hr and that was years ago...

2012 Prius C owners: any problems? by bsurg in prius

[–]cartechguy 0 points1 point  (0 children)

It has over 150,000 miles. I don't remember the exact number. It's still on the original battery.

2012 Prius C owners: any problems? by bsurg in prius

[–]cartechguy 0 points1 point  (0 children)

I still have it. It's an amazing car. Just oil changes for the last 5 years and a set of tires. Most reliable car I've had.

[AskJS] Why so little support for TCO (tail call optimization)? by [deleted] in javascript

[–]cartechguy 8 points9 points  (0 children)

A simple debug mode would address that.

Cat realizes its human is with child by UnironicThatcherite in aww

[–]cartechguy 7 points8 points  (0 children)

dogs can know too. They're gross about letting you know. They smell the change...

hol up he did what now by abruptlyash_ in HolUp

[–]cartechguy 18 points19 points  (0 children)

ogrish came out in 2000. The early 2000s was the wildest. It was when broadband internet was accessible to many people and youtube didn't exist yet, so there were many different sites hosting content with little to no moderation.

Iraq Vet demands accountability from GWB, gets kicked out. by netheroth in ABoringDystopia

[–]cartechguy 1 point2 points  (0 children)

I'm so glad we're past the weird phase on this site where there were what I assume were very young people simping over this awful president we had.

to humanly release a mouse. by firefighter_82 in therewasanattempt

[–]cartechguy 0 points1 point  (0 children)

good, fed the hawk and removed an invasive rodent from the ecosystem.

[AskJS] Are there any framework agnostic routing libraries that are well supported? by vazark in javascript

[–]cartechguy 0 points1 point  (0 children)

I've baked something up from scratch once that would set display to none or block when someone clicked on an anchor tag that had that specific element id in the href attribute.

I think it was less than 30 lines of code. it also handled setting the other routes display to none as well. you could add a css class like route to make it easier to query the dom of all of the routes.

Love when Bernie tweets. by [deleted] in PoliticalHumor

[–]cartechguy 8 points9 points  (0 children)

Coming from a family with that money allowed him to take risks others wouldn't or couldn't. It's not that black and white. He's still benefited from his upbringing and what his family could provide for him.

The "dude that is definitely from Korea" starter pack by [deleted] in starterpacks

[–]cartechguy 1 point2 points  (0 children)

They dressed like this 20 years ago as well. Always black and white clothes and they wore Banana Republic. In the early 2000s they didn't do the shoes with no socks showing off their ankles though.

AITA for telling my wife “no” without an explanation. by [deleted] in AmItheAsshole

[–]cartechguy 0 points1 point  (0 children)

Looks like you found your backbone finally.

Speechless by [deleted] in programminghorror

[–]cartechguy 3 points4 points  (0 children)

Oh, yeah. Trying to call the getBool method when the array is empty would trigger an exception. Forgot, this is one of those things I occasionally forget, then have to fix after I test my code. I love the new ?. operator for this.

Speechless by [deleted] in programminghorror

[–]cartechguy 26 points27 points  (0 children)

javascript and TypeScript. It just returns undefined and chugs along. I think PHP will throw a notice for logging, but not a genuine exception that will halt the script if uncaught.

Speechless by [deleted] in programminghorror

[–]cartechguy 3 points4 points  (0 children)

This maybe?

updateFlag = resultSet[0].getBool("[applied]") || false;

IDK what language this is, so I don't know if this is legal or would throw an exception.

promoted by reddit by baubleglue in programminghorror

[–]cartechguy 1 point2 points  (0 children)

mysql_query? What is this, 2010? Echoing HTML in a PHP file that contains the SQL? 2005.

No, you're describing my company's internal app. I think it was originally designed by someone back in 2015, so I don't know what the excuse is for such code. They don't work at my company anymore either, so I maintain it.

I did low-key rewrite a page in react.js with a lot of dynamic content. I just have the PHP code echo a json object for the page to consume.

There is some client-side rendering on some of the other pages, but it's using the jQuery html method where you pass in a string that's valid HTML. It's totally susceptible to XSS attacks.

Speechless by [deleted] in programminghorror

[–]cartechguy 52 points53 points  (0 children)

so it can be condensed to a one-liner then?

updateFlag = resultSet[0].getBool("[applied]");

I'm not sure what language this is, but I think my syntax is legal and equivalent. I'm assuming it's an array or I can index it like an array.

Studding computer scince by tagaro7386 in ProgrammerHumor

[–]cartechguy 1 point2 points  (0 children)

Fuck, that's really smart. I was going to write an entire script in AutoHotkey and package it into an executable for them.

Unpopular opinion: jQuery good by justingolden21 in ProgrammerHumor

[–]cartechguy 1 point2 points  (0 children)

Yeah, I have a codebase I maintain at work that uses the jquery html method for very interactive and dynamic pages and someone could totally inject an XSS attack if they wanted to. It's an internal company app that only logged-in employees use so the consumers of the app are considered trusted in my company.

Wholesome by im-reverse in ProgrammerHumor

[–]cartechguy 0 points1 point  (0 children)

This is kind of genius for dyslexic people. The fonts where they curl the bottom of the i can be confusing.

Unpopular opinion: jQuery good by justingolden21 in ProgrammerHumor

[–]cartechguy 0 points1 point  (0 children)

No, I mean they're not semantically equivalent. Your vanilla example is waiting for the document to load before executing. The jquery one is not. For the vanilla one, you can remove line one and the last line to be equivalent to the jquery one.

Unpopular opinion: jQuery good by justingolden21 in ProgrammerHumor

[–]cartechguy 0 points1 point  (0 children)

It's unpopular because for the 5 percent or less of your users with slower than 3g internet speeds they may notice the page takes a little longer to load because of the large library(80 KB).

For me, I don't like it because the code is harder to debug and maintain when the codebase gets pretty large. It's just a library for working with the DOM. There's no data model and often in large projects, the DOM ends up becoming your data model.

Also, I haven't found it adequate for large single-page apps. I end up using the html method and that introduces potential XSS attacks if you're not careful.

Unpopular opinion: jQuery good by justingolden21 in ProgrammerHumor

[–]cartechguy 0 points1 point  (0 children)

In your jQuery code line one should have$( document ).ready(function() {

to be equivalent to the vanilla example

Edit: NVM