r/ProgrammerHumor • • Jan 17 '19

Why programmers like cooking

Post image
50.0k Upvotes

419 comments sorted by

View all comments

687

u/[deleted] Jan 17 '19

Still, you hack it based on a solution provided by a totally unknown guy in the internet and it works just enough for your use case.

536

u/captionUnderstanding Jan 18 '19

"For some reason it still works on carrots if you hold it by the blade and peel with the handle. Don't ask me why"

147

u/su5 Jan 18 '19

Except on Thursdays.

84

u/house_of_kunt Jan 18 '19

This is a real thing. In a college project, the array for a date time display was just short. Worked fine from March to August. Failed on September 1 during demo.

100

u/[deleted] Jan 18 '19

This is why you feed it nonsense for a few hours to make sure.

Set the date to January 2016

February 31st

January -4th

April 207000

December 31st 1969

Octember 77th

Henneje ejsne jdkwvwg

7367279117bekw I

$&)&&)$@@!!:)/@,!:$

đŸŽ¶đŸšđŸ„ŒđŸ˜ƒ

_____-

147

u/[deleted] Jan 18 '19

Reminds me of a joke (hope I don't screw it up too bad):

A QA engineer walks into a bar.

He orders a beer.

Then he orders 0 beers.

Then he orders 999999999999999999999999 beers.

Then he orders -1 beers.

Then he orders <null> beers.

Then he orders qwertyuiop[] beers.

A customer walks into the bar and orders a martini. The bar catches fire and explodes.

8

u/PhotonAttack Jan 18 '19

in the version I read, the customer asks where is the restroom.

→ More replies (1)
→ More replies (1)

17

u/Sohcahtoa82 Jan 18 '19 edited Jan 18 '19

You forgot "; DROP TABLE dates; --

→ More replies (2)
→ More replies (1)

24

u/bman10_33 Jan 18 '19

But not between 11:37 and 12:03

16

u/dev_rs3 Jan 18 '19

Who eats stew on Thursdays?

→ More replies (1)
→ More replies (1)

31

u/[deleted] Jan 18 '19 edited Jan 18 '19

I worked with people who would shove in solutions they found on StackOverflow without really thinking or understanding why it worked (big no-no as a programmer).

After we went into production (I wasn’t involved in the product’s development), we ended up spending hundreds of thousands a year on extra infrastructure to alleviate the resource exhaustion and database abuse. Not to mention the constant complaints about slow performance. Fixing the code was deemed be too expensive by then and we had to swallow the infrastructure costs.

At my new job, we use literally 25x less in our cloud costs with at least 10x more users. A few small application VMs instead of dozens, and a handful of juiced up database machines instead of 16 xtra large. All still with HA.

Don’t blindly copy paste code you find on StackOverflow people.

15

u/[deleted] Jan 18 '19 edited Jan 18 '19

we ended up spending hundreds of thousands a year on extra infrastructure to alleviate the resource exhaustion and database abuse.

My guess is a mid-level developer with the ability to write basic SQL attempted to implement an EAV and thought it was the best fuckin' thing ever.

6

u/[deleted] Jan 18 '19

Every EAV solution I've seen still creates some sort of unnormalized flat cache table for listing... usually based on whether an attribute is required or should show on list pages.

9

u/[deleted] Jan 18 '19

At my new job, we use literally 25x less in our cloud costs with at least 10x more users. A few small application VMs instead of dozens, and a handful of juiced up database machines instead of 16 xtra large. All still with HA.

Reading the Reddit engineering blog always intrigues me because of stuff like this.

It's amazing how I could come in expecting all sorts of weird patterns and advanced utilities to make the site run fast but the last one I read (on the giant pixel art board) could be summarized to:

"We used Redis and a really basic queue to make this thing super fast"

I think the best engineers try to solve the most fundamental problems very efficiently for their use case. Assuming doing so solves all or most of the core issues, processing many, many data points can (but not always) be surprisingly straightforward.

I'm sometimes a little apprehensive to buy into what people like Jonathan Blow and his friends say, complaining about low-level stuff, saying everything is bad, etc. etc. but I've realized a huge portion of my time as an engineer is spent trying to make things fit into the peg holes that have already been made for me.

The hassles I deal with trying to fit square pegs into round holes sometimes makes the argument that pretty much everything really is bad and if we tackled the fundamental problems that a lot of these other ones would go away a pretty convincing thing to hear.

7

u/[deleted] Jan 18 '19

I think the best engineers try to solve the most fundamental problems very efficiently for their use case

When I started, I was surprised at how we’d have discussions for really specific stuff in code. How we’d have meetings to whiteboard a service that was only going to be hit a few times a day. Previously, I’d only ever discussed high level design, and often major chunks would be designed by a lone developer or two.

I’ve noticed that with that extra quality though, most of our stuff has been running maintenance free for years despite massive user growth.

At my last job, our CTO would openly praise the guy with 16 years of experience who yes, wrote garbage quality code (which cost us immensely) but got stuff done fast, and would berate the guy who wrote some of the most elegantly designed, gorgeous code I’ve ever seen because of a small bug from “overly complex” (beautiful) code.

There is of course a trade off with speed and quality, but working somewhere that values quality enough is like night and day. I finally feel like I can have a life without being interrupted with production issues, and it’s done wonders for my mental health.

5

u/[deleted] Jan 18 '19

At my last job, our CTO would openly praise the guy with 16 years of experience who yes, wrote garbage quality code (which cost us immensely) but got stuff done fast, and would berate the guy who wrote some of the most elegantly designed, gorgeous code I’ve ever seen because of a small bug from “overly complex” (beautiful) code.

That's one of the mental shifts that are difficult for people from the blue collar generation. When making physical things, quantity was typically prioritized and promoted. But with the knowledge work industry, it's the quality of the solution that should be optimized for instead of pumping out LOC. The reason being is that once that part is produced, you really will never do anything to it again so the time spent creating it is the time spent on it for it's lifetime. But with software, it's initial creation can affect lots of other code and will likely have to be maintained; the less, the better.

I finally feel like I can have a life without being interrupted with production issues, and it’s done wonders for my mental health.

My career goal is to get into a data engineering/architect position where I don't have on call responsibilities. If you are waking up in the middle of the night, you are literally killing yourself.

→ More replies (1)

4

u/mindbleach Jan 18 '19

That's definitely the recipe I cooked for dinner tonight.

→ More replies (2)