User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » Stupid Software Engineering & Design Decisions Page 1 2 3 4 5 [6], Prev  
FroshKiller
All American
50899 Posts
user info
edit post

We have a class for building HTML forms so you don't have to write HTML. It's largely undocumented, which is annoying. I was interested in using it, though, and noticed two public subroutines that seemed to be related to adding instances of our control types to the form. Here are their signatures:

Public Sub AddControl(Label As OurCustomLabelClass, Control As OurBaseControlClass)
Public Sub AddInteriorControl(Control As OurBaseControlClass)


I was interested in adding some checkboxes to the form. Our custom checkbox class renders its own label element. So I did what I thought was the natural, sane thing and opted for the subroutine that didn't have a required parameter of the label type.

The form did not render with any of my checkboxes. When I stepped through the code, I saw that they definitely got instantiated, and the calls to the subroutine definitely ran without exceptions.

I spent about 30 minutes troubleshooting this fucking thing until I finally searched the code base for another instance of someone adding a checkbox to a form through this builder. Care to guess what they did?

They called AddControl and passed Nothing for the Label parameter.

[Edited on April 24, 2017 at 12:53 PM. Reason : Peace, we outta here.]

4/24/2017 12:53:45 PM

aaronburro
Sup, B
51663 Posts
user info
edit post

Yeah, in a case like that, I would opt for AddControl first, based solely on the strange name of AddInteriorControl. Undocumented code is the best.

4/27/2017 12:34:22 AM

FroshKiller
All American
50899 Posts
user info
edit post

I understand why this is, but I'm annoyed as shit that getting the weekday from VB's DatePart function returns a value that doesn't naturally line up with .NET's DayOfWeek enum.

5/9/2017 7:56:43 AM

CaelNCSU
All American
6160 Posts
user info
edit post

Feature: Really important switch in the UI for turning on and off live programming.

1) Create web app for button to toggle live events on/off
2) Web app makes post request to 2nd web app
3) Web app #2 puts message on a Queue
4) Consumer of queue picks up the message and updates the database.
5) Web app #3 displays results in the UI to the end user.

No tests around any of the individual pieces or the system as a whole, so it breaks, constantly and no one knows why.

5/11/2017 7:32:46 PM

JeffreyBSG
All American
10127 Posts
user info
edit post

OLD remote environment was a nice pseudo-desktop in which you could edit your code in GEDIT and save it with CTRL-S

NEW remote environment is a cocksucking folder-navigation system with this dickless web-browser text window, in which you have to click the SAVE button to save anything

really fucking annoying to have to click a button with your mouse every time you want to save

5/11/2017 10:29:47 PM

FroshKiller
All American
50899 Posts
user info
edit post

Someone who should've known better checked some garbage code for generating a spreadsheet that he found on some damn message board into the common application framework, and other people have already started using it, so now we're chained to the goddamn thing.

5/26/2017 1:42:10 PM

FroshKiller
All American
50899 Posts
user info
edit post

A concise illustration of everything wrong with this codebase:

If bSendPhotos = -1 Or bSendPhotos = 1 Or bSendPhotos = 2 Then

6/14/2017 7:53:16 AM

smoothcrim
Universal Magnetic!
18223 Posts
user info
edit post

^^ you sure the stupid decision isn't the code review process?

6/14/2017 9:19:20 AM

FroshKiller
All American
50899 Posts
user info
edit post

That would be the larger problem, yes.

6/14/2017 9:44:09 AM

FroshKiller
All American
50899 Posts
user info
edit post

The spreadsheet code I mentioned before is a "class" that consists solely of shared methods, not a single field nor property nor even private data to be seen.

7/14/2017 7:32:56 AM

FroshKiller
All American
50899 Posts
user info
edit post

I just clicked on a region named "Public Property," and the only thing I saw on screen when it expanded was about 20 lines of private fields.

8/9/2017 8:37:12 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

I hate when people hide fields in regions like that. Group sections of related code, if you must, but fuck off with regions just to say where private fields are.

Anyway, the product I work on has a validation system that we built that is, to say the least, buggy. It's solid most of the time, but it does have some very nasty potential for race conditions. The end result is a way to validate some small piece of the VM, and provide an validation status (pass/fail/warning) and error message. The application ends up displaying all of the errors and warnings in a status bar. The validation pieces are VMs themselves. It's rough, but it's hobbling along nicely.

Well, our genius offshore guy, who I wouldn't hire as a junior dev, gets assigned a task to require user acknowledgement of something before you can submit from the CRUD screen. We already have a pattern for this in our validation structure, and it does a standard pop-up. Or, you could have a button that shows up dynamically on the CRUD screen when applicable. Whatever. Pretty standard stuff, right?

Well, this guy decides "fuck all that. I'm gonna go add a button to the validation VMs, which are asynchronously created and recreated as needed. And I'm gonna make sure this button shows up on EVERY validation result, not just the one I've created." So, now, our error messages and warnings ALL have a button on them which does nothing, except for his new one.

When I called him on it, his response was "I tested it, and it works fine."
I reverted it.

BTW, this is the same guy who needed to add a button to our settings screen, which is dynamically generated. It loads a list of settings and reads them into a generic "ConfigSetting" type, where the generic parameter is some kind of serializable construct, and the whole things is autoserialized into a database somewhere. These ConfigSettings get read at app startup, and when you load the settings screen, it just creates a list of settings that can be edited. OK, so the system isn't set up very well to allow just throwing a button on there to perform a certain action... So what does this guy do? Rework the screen to allow a custom view to be added? Of course not. He creates a ConfigSetting{Button} that gets auto generated, providing you the button, which you then can click.

It kinda works, except for a small problem. A button isn't really deserializable. So, as long as you never save your settings, you are fine. But the moment you save, that button gets "persisted" into the database, and then the app won't load anymore, because HOW THE FUCK DO YOU DESERIALIZE A FUCKING BUTTON. And the only fix is to delete ALL of your settings from the database, because we store all settings in a single, binary object, that can't easily be pulled out.

[Edited on September 2, 2017 at 4:45 PM. Reason : ]

9/2/2017 4:33:27 PM

FroshKiller
All American
50899 Posts
user info
edit post

That dude sucks, but can't you strip the buttons from the settings before saving?

I just broke a release build, because the release build system uses an older version of the compiler than, like, every other programmer and every build configuration in the QA environment.

9/19/2017 8:42:01 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

Well, sure, but we shouldn't have to write code to strip out buttons from settings... Ultimately, I spent about half a day doing what the original dev who wrote our settings code should have done: give us a way to specify a different UI for certain settings categories.

9/24/2017 3:05:19 PM

aaronburro
Sup, B
51663 Posts
user info
edit post

I would recommend that you not use the US Post Office's online customs forms submission page right now. It seems to work pretty well, except for a small problem... When you're done, you can click a link to see your completed form. That link is the same for everyone. And what you will see is the last form that was submitted by anyone, whether it's your form or not.

It also appears that they are testing their code in production, as you can see a lot of forms coming through for John Doe and the like...

Yeah... I'd stay away from that part of their website until they get it fixed.

1/25/2018 7:36:54 PM

smoothcrim
Universal Magnetic!
18223 Posts
user info
edit post

^

I'm working on a compliance lib for nist 800-53. For those in the know, that's 1200ish controls (rules) about your infrastructure. This lib needs to be written in the language we wrote (functional DSL on top of haskell). I say, you know, rather than writing these all by hand, we should auto generate them. Our constructors are the only values we need to constrain and there's a well defined grammar for that.

No no no, that'll take too long to get started, we need something now! Just brute force it!
Despite my plea, here we are, several sprints later, barely making a dent, writing really menial code.

So a coworker and say fuck it and go write the tool and he helps me put a js front end on it. Now anyone can create the rules, just like an outlook inbox rule. Took us a week to write the tool in spare time.

1/26/2018 8:20:40 AM

FroshKiller
All American
50899 Posts
user info
edit post

Wasted a good few hours this morning because whatever shitbird wrote the configuration front end for an internal service swallowed exceptions on saving changes. The user didn't have permission to write to the config file, but you'd never know it from the front end.

2/12/2018 10:40:09 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

if (foo is SomeType)
{
if (((SomeType)foo).Property1 == "bar" && ((SomeType)foo).Property2 > 3 && ((SomeType)foo).Property3 is FooBar && ((FooBar)((SomeType)foo).Property3).WhatTheFuck))
{
((SomeType)foo).RunMethod();
((FooBar)((SomeType)foo).Property3).DoSomeShit();
((FooBar)((SomeType)foo).Property3).ShitWasDone = true;
}
}


Saw this shit in the codebase last week. Told the guy to cut that shit out and just use an as-cast so that he only casts once. His response? "I don't want to do the extra allocation, and direct casts are faster than as-casts." Bruuuuuuuuuuuuuuuuuuuuuuh.

Oh, and an hour-and-a-half later, he checks in more of that shit

[Edited on March 4, 2018 at 10:12 PM. Reason : ]

3/4/2018 10:04:55 PM

FroshKiller
All American
50899 Posts
user info
edit post

I like how it's also a leaky abstraction.

I eliminated all dependencies on an internal framework from a service after being specifically told not to waste my time on it, and the build system is still configured to build the framework first to satisfy the dependencies. I guess I'm the asshole.

[Edited on March 6, 2018 at 10:29 AM. Reason : ///]

3/6/2018 10:28:01 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

Two months later, and the Post Office STILL hasn't fixed their website. I'm about to blast this ish on Facebook.

3/21/2018 9:33:54 PM

aaronburro
Sup, B
51663 Posts
user info
edit post

Dude at work failed the FizzBuzz test this week. He no longer works for us.

5/4/2018 10:33:13 PM

CaelNCSU
All American
6160 Posts
user info
edit post

How do you fail fizzbuzz if you already got a job?!

5/5/2018 9:33:14 AM

jaZon
All American
26818 Posts
user info
edit post

Quote :
"Two months later, and the Post Office STILL hasn't fixed their website. I'm about to blast this ish on Facebook."


No idea if it's still doing it, but I was considering getting a PO Box about a month ago and the fucking thing kept redirecting to a Brooklyn location

5/5/2018 3:24:17 PM

aaronburro
Sup, B
51663 Posts
user info
edit post

^^ Hell if I know. That's his problem now

5/6/2018 12:05:17 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

Saw IValueConverters yesterday which have side effects. Good times

5/9/2018 7:58:41 AM

CaelNCSU
All American
6160 Posts
user info
edit post

I took over an API that had toString methods with loads of side effects. Was the point I decided it was hopeless to fix it and throw it away. Sometimes a rewrite is better.

5/9/2018 9:08:39 AM

aaronburro
Sup, B
51663 Posts
user info
edit post

Side-effects man has struck again... Created a method named "FooHasErrors" which takes a Foo and tells you if it has errors. It also changes the value of multiple instance fields on the class the method is defined on. Like, wtf.

5/25/2018 11:04:15 PM

 Message Boards » Tech Talk » Stupid Software Engineering & Design Decisions Page 1 2 3 4 5 [6], Prev  
go to top | |
Admin Options : move topic | lock topic

© 2018 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.37 - our disclaimer.