Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
necrotic
Aug 2, 2005
I owe my brother big time for this!

revmoo posted:

Just remembered an old coding horror, complements of a colleague. He got a ticket to add the current time, with seconds, to a page in an app. So he wrote js/php to query the server every second and get the current time. Nobody ever noticed until I happened to be looking at the code for the page in question months later.

What if the client time doesn't match the server time? What then!?

Adbot
ADBOT LOVES YOU

xarph
Jun 18, 2001


Today I learned that one of our important customer facing webapps (of which there are zero people left who know about it, and is written in a language we don't use anywhere else) relies on an interstitial page that has both a <meta refresh="some file download"> and a timed javascript onLoad window.location="next page" in the same page.

The app apparently slowed down enough that the file download wouldn't get established before javascript changed the page, which broke everything. The only reason it worked before is that until recent releases of Chrome and Firefox, browsers wouldn't cancel a file download started by <meta refresh> if javascript changed window.location.

qntm
Jun 17, 2009

necrotic posted:

What if the client time doesn't match the server time? What then!?

Well, that's why you check, obviously!

Westie
May 30, 2013



Baboon Simulator

revmoo posted:

Just remembered an old coding horror, complements of a colleague. He got a ticket to add the current time, with seconds, to a page in an app. So he wrote js/php to query the server every second and get the current time. Nobody ever noticed until I happened to be looking at the code for the page in question months later.

At least you know what time the Internet stopped if anything bad happened like uh, a cut in internet or something.

Verloc
Feb 15, 2001

Note to self: Posting 'lulz' is not a good idea.
Inherited yet another codebase of dubious quality. Why are users bitching about poo poo being broken constantly, data being corrupted, and not a goddamn thing showing up in the logfiles or system event log? What the shi...

Visual Studio posted:

Find all "catch (Exception) { }", Subfolders, Find Results 1, "Entire Solution"
Matching lines: 273 Matching files: 26 Total files searched: 1157
oh.

I guess 'ignore them and hope they go away' is a kind of exception handling strategy. :cripes:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Verloc posted:

Inherited yet another codebase of dubious quality. Why are users bitching about poo poo being broken constantly, data being corrupted, and not a goddamn thing showing up in the logfiles or system event log? What the shi...

oh.

I guess 'ignore them and hope they go away' is a kind of exception handling strategy. :cripes:

What's really fun is when you test out how the application behaves when you replace the empty catches with catch (Exception) { throw; } and see what horrors immediately spring to the surface.

Verloc
Feb 15, 2001

Note to self: Posting 'lulz' is not a good idea.

Ithaqua posted:

What's really fun is when you test out how the application behaves when you replace the empty catches with catch (Exception) { throw; } and see what horrors immediately spring to the surface.
I spent about 4 hours setting up log4net (instead of their cackhanded homegrown file logger), and wiring logging into all those silent catches. On my local test runs I'm averaging about 5-7kb worth of exception logs per page load. Turning that thundering herd of exceptions loose to run up the stack would be even more :suicide: inducing I think.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Verloc posted:

I spent about 4 hours setting up log4net (instead of their cackhanded homegrown file logger), and wiring logging into all those silent catches. On my local test runs I'm averaging about 5-7kb worth of exception logs per page load. Turning that thundering herd of exceptions loose to run up the stack would be even more :suicide: inducing I think.

I am so glad I have not experienced a work environment where people are this bad at programming. I've seen some bad poo poo, but wow.

Germstore
Oct 17, 2012

A Serious Candidate For a Serious Time
There's an app where I work where instead of try-catch-ignore it's try-catch-messagebox. So basically it's a messagebox with the root cause exception message and then about 10 more messageboxes for null reference exceptions as it moves up the stack.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
"TFS meltdown."

What?!?!?!

"... I'm about to have a TFS meltdown."

Oh my loving god no.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

2banks1swap.avi posted:

"TFS meltdown."

What?!?!?!

"... I'm about to have a TFS meltdown."

Oh my loving god no.

...what?

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Ithaqua posted:

...what?

Their Microsoft proprietary version control is about to go all to hell.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

ultramiraculous posted:

Their Microsoft proprietary version control is about to go all to hell.

This is a job where our client (A STATE GOVERNMENT) loving had a fat-finger-delete of 60+ VMs, including our development environments, services, and so on.

No Safe Word
Feb 26, 2005

2banks1swap.avi posted:

This is a job where our client (A STATE GOVERNMENT) loving had a fat-finger-delete of 60+ VMs, including our development environments, services, and so on.

Backups: a thing that needs to be done

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
One of many things you should always ask a prospective employer about!

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

ultramiraculous posted:

Their Microsoft proprietary version control is about to go all to hell.

Yeah, I'm familiar with TFS, I just didn't get what the horror was.

gariig
Dec 31, 2004
Beaten into submission by my fiance
Pillbug

Ithaqua posted:

Yeah, I'm familiar with TFS, I just didn't get what the horror was.

I thought Microsoft required a nuclear reactor to power TFS and we were about to witness the next Fukushoma. How sad it's someone just deleted a bunch of VMs with no backups.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
The meltdown was "...it's not working, I can't push, I can't publish, what the gently caress, I just did new workspaces, oh god..." until "oh it works." I have no idea what was wrong.

But it was a horror to hear that source control is starting to act screwy.

No Safe Word
Feb 26, 2005

2banks1swap.avi posted:

The meltdown was "...it's not working, I can't push, I can't publish, what the gently caress, I just did new workspaces, oh god..." until "oh it works." I have no idea what was wrong.

But it was a horror to hear that source control is starting to act screwy.

That's TFS :haw:

(just kidding it's not that bad but it frustrates me a lot too with poo poo like that, but we're also using the hosted TFS stuff so we're kind of asking for it)

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
:q:

Sometimes I wonder why it's still not SOP to have a physical RAID sitting in your drat office (and colo'd) with your source files. Seriously, HDDs are cheap.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

2banks1swap.avi posted:

:q:

Sometimes I wonder why it's still not SOP to have a physical RAID sitting in your drat office (and colo'd) with your source files. Seriously, HDDs are cheap.

TFS has pretty good support for DR scenarios, too.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

No Safe Word posted:

Backups: a thing that needs to be done

And if you aren't making sure you can restore correctly, you aren't doing backups, you're just filling media.

I worked on a filesystem for a medium-sized (~1000 node) cluster a long time ago, and after a maintenance window to move to new rack config interconnect the tech brought the storage nodes...with the storage ports cross-connected. No big deal, the filesystem detected that and refused to mount because the underlying storage UUIDs and the ports didn't line up (chasing the UUIDs automatically was a recipe for different disaster in the past), and even gave the support number to call to get help. Oh, except that the tech then decided to use his initiative while waiting less than half an hour for me to get paged out of bed as oncall, and forced a filesystem repair. I hope you weren't using those 15,000 machine-days of simulation results, Mr Nuclear Security Administration scientist sir.

Ego Trip
Aug 28, 2012

A tenacious little mouse!


2banks1swap.avi posted:

:q:

Sometimes I wonder why it's still not SOP to have a physical RAID sitting in your drat office (and colo'd) with your source files. Seriously, HDDs are cheap.

Working in a highly regulated industry, it's actually against federal regulations for our code to be in the same building as us.
Everyone remotes into a server. I actually had to fight to get a real computer instead of a thin client.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



No Safe Word posted:

That's TFS :haw:

(just kidding it's not that bad but it frustrates me a lot too with poo poo like that, but we're also using the hosted TFS stuff so we're kind of asking for it)

Speaking of TFS and horrors, I got a new workstation late last year and renamed the old one so I could keep it on the network while moving to the new one which got the name I was used to. When I remoted into the old one to double-check I hadn't left anything behind in TFS, it refused to touch the local the local copy because it wasn't supposed to exist on this machine name (or something to that effect). Easily the silliest loving VCS design decision I can think of that isn't a total deal-breaker like VSS's willingness to delete old copies of files that in a real VCS would just be marked deleted.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

Ego Trip posted:

Working in a highly regulated industry, it's actually against federal regulations for our code to be in the same building as us.
Everyone remotes into a server. I actually had to fight to get a real computer instead of a thin client.

May I ask where? I've done plenty of bullshit through a VM and dealt with input lag (and learned to get good at vim motions as a result) and am actually remoting into my home PC through remote from work right now. Nevertheless, trying to DEVELOP remotely was always extremely frustrating.

No Safe Word
Feb 26, 2005

Munkeymon posted:

Speaking of TFS and horrors, I got a new workstation late last year and renamed the old one so I could keep it on the network while moving to the new one which got the name I was used to. When I remoted into the old one to double-check I hadn't left anything behind in TFS, it refused to touch the local the local copy because it wasn't supposed to exist on this machine name (or something to that effect). Easily the silliest loving VCS design decision I can think of that isn't a total deal-breaker like VSS's willingness to delete old copies of files that in a real VCS would just be marked deleted.

My favorite thing with TFS and deletes is you can't simply mark items to be deleted without actually getting them first. Especially fun when it's like an entire branch and you just want to clean stuff up. I end up doing a non-recursive get from the command line and then deleting, but it's a pain in the rear end.

Verloc
Feb 15, 2001

Note to self: Posting 'lulz' is not a good idea.

Munkeymon posted:

Speaking of TFS and horrors, I got a new workstation late last year and renamed the old one so I could keep it on the network while moving to the new one which got the name I was used to. When I remoted into the old one to double-check I hadn't left anything behind in TFS, it refused to touch the local the local copy because it wasn't supposed to exist on this machine name (or something to that effect). Easily the silliest loving VCS design decision I can think of that isn't a total deal-breaker like VSS's willingness to delete old copies of files that in a real VCS would just be marked deleted.
I just recently :yotj:'d into a TFS shop. Coming from an exclusively git and subversion (Ok well there was some *shudder* Visual Sourcesafe back in the before times, but we don't talk about then) background it seems like a really well behaved VCS except for when it comes to workspaces. Look at a workspace funny and TFS immediately goes into 'back off I will loving cut you' mode.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Verloc posted:

I just recently :yotj:'d into a TFS shop. Coming from an exclusively git and subversion (Ok well there was some *shudder* Visual Sourcesafe back in the before times, but we don't talk about then) background it seems like a really well behaved VCS except for when it comes to workspaces. Look at a workspace funny and TFS immediately goes into 'back off I will loving cut you' mode.

Local workspaces make things easier if you're on VS/TFS2012+.

Ego Trip
Aug 28, 2012

A tenacious little mouse!


2banks1swap.avi posted:

May I ask where? I've done plenty of bullshit through a VM and dealt with input lag (and learned to get good at vim motions as a result) and am actually remoting into my home PC through remote from work right now. Nevertheless, trying to DEVELOP remotely was always extremely frustrating.

I work for a small HR company. We have a bunch of personally identifiable information, including social security numbers. Our building isn't secure enough to house the data or source code. Considering that it's easier to get into the server room than it is the lunch room, I'm glad that no one is trying to store anything important here. Aside from all of the hardcopies of that PII in the basement, of course. :v:

I've had this job for 2 years and I haven't written a single line on the PC sitting on my desk.
Interview on Monday, though. :yotj:

QuarkJets
Sep 8, 2008

Speaking of backups, I've been using Microsoft SyncToy on my home machine to back up files from one disk to another. It's actually extremely easy to use and well-designed. So the opposite of a coding horror, I guess

e: I mean I could just do this with a cron'd rsync or something, but since Windows doesn't have that...

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

QuarkJets posted:

Speaking of backups, I've been using Microsoft SyncToy on my home machine to back up files from one disk to another. It's actually extremely easy to use and well-designed. So the opposite of a coding horror, I guess

Is that really a backup though if the disks are in the same physical location?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

fletcher posted:

Is that really a backup though if the disks are in the same physical location?

It is if you care about drive failure or human error, it's not if you care about large fires.

No Safe Word
Feb 26, 2005

fletcher posted:

Is that really a backup though if the disks are in the same physical location?

It's a good thing to have, not the only thing you should have.

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Westie posted:

At least you know what time the Internet stopped if anything bad happened like uh, a cut in internet or something.

Back in the days of 56k when I used to play team fortress the main UK isp British Telecom ran a few servers through a dedicated service called wireplay, one day every server went down and when they came back up the status page said something like "yeah so all our servers are set to ping Microsoft.com to check they've got an internet connection and Microsoft stopped responding to pings so the servers crashed".

BT is still a major UK isp and last time I checked bt.com doesn't respond to pings.

QuarkJets
Sep 8, 2008

fletcher posted:

Is that really a backup though if the disks are in the same physical location?

I don't understand your question. Are you asking whether I'm just mirroring between partitions on a single disk? I'm using different physical disks, which is a hell of a lot better than doing nothing at all

zeekner
Jul 14, 2007

Goddamnit, backups are important:
Onsite, offsite, third party service; Pick three.
RAID is not backup, it's availability, and not to be relied on at all.
Make sure you can actually restore backups without having to cherry-pick through a file dump.
Daily backups with your primary service, preferably with on-the-fly for at least one of them (most online backup services offer this).

Anything less than this and you are a building a time bomb.

FieryBalrog
Apr 7, 2010
Grimey Drawer

Deus Rex posted:

Is Postgres the only SQL DB that can do indexes on expressions? I wasn't that surprised to see MySQL was lacking them, but SQL Server is supposed to be good :(

You can use functional indexes in Oracle.

Verloc
Feb 15, 2001

Note to self: Posting 'lulz' is not a good idea.

necrotic posted:

I am so glad I have not experienced a work environment where people are this bad at programming. I've seen some bad poo poo, but wow.
After diving a little deeper, I've come to the conclusion that about 1/3 of the silent catches are legit poo poo-that-should-be-caught stuff. The rest seem to mostly be a byproduct of the original author not really getting how nullables work. About 190 of those catches are basically flow control statements as written by a moron. Instead of null-checking any nullable value that he passes into code that will eat poo poo spectacularly if handed a null(formatted datetimes, ternary operators, string splits, property accessors, etc. etc.), everything is just wrapped in try/catch blocks and if said null intolerant code gets a null and buttfucks itself out of existence, just keep on' truckin'. I'm still grappling with the fact that almost a hundred silent catches on legit exceptions qualifies as 'a drastic improvement over what I initially assessed' however.

Verloc fucked around with this message at 06:58 on Apr 26, 2014

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

Verloc posted:

After diving a little deeper, I've come to the conclusion that about 1/3 of the silent catches are legit poo poo-that-should-be-caught stuff. The rest seem to mostly be a byproduct of the original author not really getting how nullables work. About 190 of those catches are basically flow control statements as written by a moron. Instead of null-checking any nullable value that he passes into code that will eat poo poo spectacularly if handed a null(formatted datetimes, ternary operators, string splits, property accessors, etc. etc.), everything is just wrapped in try/catch blocks and if said null intolerant code gets a null and buttfucks itself out of existence, just keep on' truckin'. I'm still grappling with the fact that almost a hundred silent catches on legit exceptions qualifies as 'a drastic improvement over what I initially assessed' however.

That's awful. It's a painful thing to do, but you could consider replacing them with try { ... } catch (NullReferenceException) { }, so at least they only catch what they're supposed to catch. Clearly it would be better to make sure the exceptions don't happen to begin with, but from the sound of it that's going to be a challenge.

Adbot
ADBOT LOVES YOU

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

LOOK I AM A TURTLE posted:

That's awful. It's a painful thing to do, but you could consider replacing them with try { ... } catch (NullReferenceException) { }, so at least they only catch what they're supposed to catch. Clearly it would be better to make sure the exceptions don't happen to begin with, but from the sound of it that's going to be a challenge.

At least he's not catching an exception and then EVERY SUPERCLASS OF THAT EXCEPTION with the exact same code in the catch block. Because that would be crazy town.

:cripes:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply