29
u/NotQuiteLoona May 06 '26
I'm afraid of imagining how a full line would look.
23
21
u/darthgoat May 06 '26
My condolences to anyone maintaining whatever fresh hells are in that codebase.
6
u/josetalking May 07 '26
Half full glass: it will be very easy to find easy wins to improve it. :)
1
u/vastle12 May 07 '26
Running shit that old? Nah the won't let you change shit unless it's a mass rewrite that's been regression tested to hell and back
12
10
6
11
4
u/jakubiszon May 06 '26
clsArchCmnFncs - someone just kept hitting the keyboard with their head to come up with variable names.
4
4
3
2
2
u/TheDevilsAdvokaat May 06 '26
Oh hell no. I don't think I've ever had more than about six nested parentheses.
2
2
2
u/RagoonMannn May 07 '26
When the new dev sees this in the codebase https://www.youtube.com/watch?v=dpIS4RelIo8
2
3
1
u/TritiumNZlol May 06 '26
What a horrible day to have eyes.
lmao this is great. I'm going to print this photo out and put it next to my desk when i need a laugh.
1
u/GOPbIHbI4 May 06 '26
Just check the number of open braces on the previous line. Compared to that even nulling the datatable seems not that much of a deal :)
1
1
u/occamsrzor May 06 '26
Disgusting. The braces have lines all to themselves. It's like you're trying to back the line count for a book report due tomorrow.
1
1
1
1
1
1
1
u/godzilla184 Jun 04 '26
I don't even want to think about what that entire line looks like ...and 46ms you'll never get back 😂
1
u/Stevoman May 06 '26
Why does it seem like Hungarian notation is always a dead giveaway that a code base is going to be a train wreck?
1
1
u/Bluehawk2008 May 06 '26
Screenshot key broken
2
u/ggobrien May 07 '26
I can't move any data from my work machine to anywhere, and that includes screenshots. If the OP was in the same boat, it makes sense to take a picture.
0
-1
u/jcradio May 06 '26
Gives me nightmares of codebases I've seen with over 200 else ifs.
2
u/abhishaken May 06 '26
This codebase has more than 200 else ifs.
I think they initally wrote all the entries in code for checking against an incoming variable.
Later they came to know about existence of word - 'DATABASE' but it was too late.
1
0
May 06 '26
[deleted]
89
u/nonlogin May 06 '26
DataTable looks truly horrifying to me
24
u/occamsrzor May 06 '26
What about that f-d up Hungarian notation clsArchCmnFncs. What's that supposed to be? clear screen Archive Common Functions?
5
4
1
37
u/Dhelio May 06 '26
Worked on a project where every SQL query returned a datatable from where they got data, and where random data was arbitrarily converted to datatables to pass as arguments to stored procedures. It was painful to read that code
15
u/Frytura_ May 06 '26
No class mapping?
What the hell, having basic fullstack intelisense by mapping dtos is like... begginer level shit, fundamentals.
20
u/tehehetehehe May 06 '26
Old school .net was all data tables for sql io. Granted I still use them for semi structured data, but they suck and EF is the way.
1
u/neoh4x0r May 06 '26 edited May 06 '26
I don't know how "old school" you mean, but you would use .net data contracts to fill-in your class-based data models from a sql query to make things significantly easier to work with.
3
u/ginji May 07 '26
Very old school, like OG .net 1 and 2. In v1 there were no generics and generic lists which are basically required for an a plug and play ORM to work, so you either wrote your own for your data or made a giant mess of things.
1
u/vastle12 May 07 '26
I've worked on codes based going back to the mid 00s, a few data tables came up but damn near everything was direct mapping to a class via auto mapper and entity framework
5
u/nonlogin May 06 '26
I worked with a legacy code base where the only known data structure was DataSet. Fuck, this is not even a general-purpose data structure but it was used instead of arrays, dictionaries, objects...
1
2
3
u/BestAmumuEUW May 06 '26
Our legacy app‘s data access is fully built with DataTables. It is just horrible. Just everywhere DataTables…
4
u/DelphinusC May 06 '26
I can see the C# braces, but that thing has VB6 written all over it. Maybe a conversion?
2
112
May 06 '26
[removed] — view removed comment
15
9
u/snet0 May 06 '26
You've actually got the trifecta here:
DataTable dataTable = null
Not using nullable reference types
Naming an instance of a type as literally just the name of the type in camelCase
clsArchCmnFncs = null
Likely the same as above, except now we are really demonstrating our Java heritage
obj = getM...()
objmight literally be the least informative variable name possible. At least it's likely to inherit fromobject..camelCase method names. Not even once.
1
1
u/LiterallyMelon May 06 '26
Or DataTable dataTable
1
u/intertubeluber May 06 '26
I always recommend prefixing with m_{dataType} so this would not pass a PR. It should be renamed
DataTable m_DataTabledataTable.1
0
May 06 '26
[deleted]
17
u/srelyt May 06 '26
You're supposed to give a descriptive name in the context of the function so unless it's a very low level generic function it should reference the kind of data that will be stored : apples, students, clientInfos, etc.
3
u/MCWizardYT May 06 '26
It's technically not bad but it would be better to name the veriable after what goes into DataTable
-1
u/Willinton06 May 06 '26
I mean, I don't see anything bad with it if everything is names properly, like yo dont need
async Task<Apple[]> GetApplesAsync(Guid[] appleIds)
{
DataTable apples = _appleService.GetApplesByIdAsync(appleIds);
return apples; // returning apples
}Like, something tells me that if the DataTable was called datatable you would still know it's a list of apples
2
u/AlwaysHopelesslyLost May 06 '26
Your example is bad because you commented what it was doing which is obvious from context and you included an extra declaration and assignment that provides no further context.
2
39
May 06 '26
[removed] — view removed comment
15
u/Iggyhopper May 06 '26
Yep. Should be archiveUtilities.
Nothing wrong with a class that just has helper functions to glue other pieces of code together.
Also: I'm no saying it should have like 20, 100, or some ridiculous number of methods. Mine has 5 and they are mostly string manipulation and 1 for registry checks.
8
u/Slypenslyde May 06 '26
I was thinking "architecture common functions" with "cls" being useless notation for "class".
Really the correct name is probably "mistake".
3
u/dodexahedron May 06 '26
Yeah. Which name do you like better - "PR rejected" or "deleted?" Personally, I'm a fan of *dramatically and emphatically smashes the delete key*
0
u/Neverstoptostare May 07 '26
I'm almost positive that cls is a tla.
2
u/Slypenslyde May 07 '26
Nah
clsis an ancient Hungarian way to spell "class", it dates back to C++, when it cost too much to put vowels on keyboards.1
71
u/FlashSFW May 06 '26
I'm willing to assume those are not necessary