Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "wk58"
-
We must develop and test our code
...via VirtualBox...
...running Windows XP...
...using IE...
..with vanilla Javascript...
...help me...19 -
After opening the legacy code and finding out that the entire shit has 15000+ LOC and without proper commentsundefined devrant please help fbi fucking comment the code properly comments thensa legacy code notnsa devil wk58 god3
-
Who needs Legacy Code to f*ck up your day when you can't understand the code you wrote 2 weeks ago3
-
Our project is a legacy of all legacy projects. The developers imported the third-party libraries by copy-pasting the whole source codes into the project. Ohhhh yeahhh!!!8
-
I have a lot of interesting code snippets from some kind of inhouse CRM/billing software, but for now let's look at this very useful PHP function.4
-
If you thought your legacy code was bad, this is what I'm dealing with. The below SQL is stored in a cookie on login and executed to on every further request to determine the user / privileges.15
-
I used to work in a role that was basically tech support for engineers. Folks would call, we'd look at their code and see where things were going wrong.
One customer calls in, they're having timing problems with a satellite control system.
I dig down through their code, and buried in one of the modules is a comment to the effect of:
"Once we upgrade to Windows 98, we'll need to change this call to the precision counter"
They never did.
This system was running XP.
Somehow, they'd avoided destroying satellites despite having the code run on Win98, and ME without fixing that call. It wasn't until they upgraded to a multi core system and XP that their gyros stopped responding correctly.
Holy shit.9 -
I've written a lot of bad code, seen a lot, but attached is the most recent 'worst' I've seen.
What makes the situation worse/funny is:
1. The developer's code comment.
2. Check-in passed a code review.
3. The 'legacy code' was written last week.29 -
One of my first jobs as a Web Designer / Developer.
Boss had me update a WordPress site that the previous dude built. It had some pages that only members were meant to access.
These were listed on a navbar at all times. If the user clicked on them, a JS alert would show up telling the visitor to log in first.
That was the ONLY protection those pages had. No matter it was a WordPress-powered site, to begin. If you knew the URL or simply altered the code right there on the browser to remove the onclick-bound JS, you could get in.
And that was just the beginning of it. Eventually I convinced the boss to rebuild the site.4 -
My second job. I've been hired as a research specialist, not a developer, but they found out I could code during the interview.
Boss: hey, so we have our main product line that shares the control panel for all the models, right?
Me: unh, yeah
B: well, we need to know how it works.
M: sorry?
B: yeah, I mean, we should have a manual with all the tech documentation so we know how everything works
M: ...and didn't you handle the tech docs to the developers?
B: uh...no, actually we requests feature to the devs (note: external company) with a phone call, or email...now we need the specs.
Me: omg
...
The other company (which is part of the same group) handles me the source code.
It is a huge, 25k lines of spaghetti written by at least 7 people, one at a time, uncommented.
After a month I produce a 50page doc with how everything works, after actually compiling my resignation letter 3 times.
M: boss, here the docs
B: fine, I'll take a look
15 mins later
B: this is not what we need! You cannot describe those algorithm like this!
( I described the algorithms with their block flow, with a punctual verbal description)
M: umh.. So how do you need it?
B: we need an excel table, with all the entering conditions on the rows and all the exit conditions in columns, and the description of the condition of work in the crossing cells!
M: are you even serious?7 -
Worst legacy experience...
Called in by a client who had had a pen test on their website and it showed up many, many security holes. I was tasked with coming in and implementing the required fixes.
Site turned out to be Classic ASP built on an MS Access database. Due to the nature of the client, everything had to be done on their premises (kind of ironic but there you go). So I'm on-site trying to get access to code and server. My contact was *never* at her desk to approve anything. IT staff "worked" 11am to 3pm on a long day. The code itself was shite beyond belief.
The site was full of forms with no input validation, origin validation and no SQL injection checks. Sensitive data stored in plain text in cookies. Technical errors displayed on certain pages revealing site structure and even DB table names. Server configured to allow directory listing in file stores so that the public could see/access whatever they liked without any permission or authentication checks. I swear this was written by the child of some staff member. No company would have had the balls to charge for this.
Took me about 8 weeks to make and deploy the changes to client's satisfaction. Could have done it in 2 with some support from the actual people I was suppose to be helping!! But it was their money (well, my money as they were government funded!).1 -
"Errors? Won't happen to me!"
One of my first jobs was to finish and maintain a program, that was made by a guy who had a real genius image among others. Years later, people said "oh him, that smart guy."
I never met him, but that's what i heard.
However, he was not only smart, but it seems he was also very confident. That's what i deduct from his code.
He didn't use catch-blocks. They were all empty. Not even logged.
If errors appeared , it was not possible to see what happened and where and why. The program would continue it's execution and if following steps could not work, because there had been an unnoticed exception, it would just throw another unnoticed exception and at some point, end in an undefined state.5 -
One step through the door my wife whips around, a look so disgusted she barely seems human. "What's that smell?" she cries. "It's you! You smell like...like bad code!"
Indeed, I am covered with the scent of the forbidden love child of a man who read half a chapter on if-then statements and then pushed out into the world, earthworm-like, a mangled misshapened gelatinous mass that my employer gave the title of line-of-business application purely out of pity.
For more days than I'd like to count I have been porting a ColdFusion 5 application to .NET. Initially written in 2000 and last touched in 2006, it has a data architecture comparable to Dresden after the second world war. It features a table solely comprised of seven columns of IDs so that joins can be made between other tables lacking a common key. Columns that should be contained within a single table spread out among multiple tables. Single columns containing data that should be multiple columns (with handy flags to separate the subsets). A view with 14 joins that playfully displays unintended results. And so much more spread out over almost 200 stored procedures, views, triggers, and tables on the SQL server, and dozens of additional ADO-like SQL statements within the ColdFusion itself. Fortunately, the application overcomes these issues by having absolutely no data validation while allowing nulls pretty much everywhere.
When I am done this will be a very nice ASP.NET MVC app with at least 150 less stored procs, views, and tables. Auto-generated duplicate entries will be a thing of the past. Pop-up windows that inexplicably refresh the underlying screen to display a different part of the program than the one the user wants will be eliminated. And a UI based on the colors of a Rubik's Cube with usability that Mr. Rubik would find challenging will disappear with only the trauma of using it left behind.
Sadly, this is not my worse legacy code experience. Just the most recent. Just the most recent stench added to a lifetime of bathing in code rot.3 -
Oh, we don't know why it broke. I know you just did A HUGE FUCKING DATABASE SEVER UPGRADE to the server we're connected to, but no one understands this code, so can't update it to work. Can you roll back 3 VERSIONS so our application that hasn't had a code change in 11 years is optimized?2
-
Ooh this is good.
At my first job, i was hired as a c++ developer. The task seemed easy enough, it was a research and the previous developer died, leaving behind a lot of documentation and some legacy fortran code. Now you might not know, but fortran can be really easily converted to c, and then refactored to c++.
Fine, time to read the docs. The research was on pollen levels, cant really tell more. Mostly advanced maths. I dug through 500+ pages of algebra just to realize, theres no way this would ever work. Okay dont panic, im a data analyst, i can handle this.
Lets take a look at the fortran code, maybe that makes more sense. Turns out it had nothing to do with the task. It looped through some external data i couldnt find anywhere and thats it. Yay.
So i exported everything we had to a csv file, wrote a java program to apply linefit with linear regression and filter out the bad records. After that i spent 2 days in a hot server room, hoping that the old intel xeon wouldnt break down from sending java outputs directly to haskell, but it held on its own.1 -
I'm freelancing and there was a guy who needed help with JavaFX. He gave me code only to his view class so I don't steal the rest... It was around 5k lines and it was full of compilation errors because of missing classes. While checking the code I realised something is really wrong with his model classes. So I asked maybe he could send me this one model class that was suspicious. So he did and it was around 10k lines long and had around 200 fields... ALL OF THEM FUCKING STRINGS except 3. You know what the rest of 3 were? 2 Lists of strings and a boolean... It was his "main" model class, he was using it for everything. It had setters for all fields and empty default constructor, so he would just instantiate the object and would set the fields that he wanted to use. Need new functionality? Just add 5more String fields and set them!2
-
So I once had a job as a C# developer at a company that rewrote its legacy software in .Net after years of running VB3 code - the project had originally started in 1994 and ran on Windows 3.11.
As one of the only two guys in the team that actually knew VB I was eventually put in charge of bug for bug compatibility. Since our software did some financial estimations that were impossible to do without it (because they were not well defined), our clients didn't much care if the results were slightly wrong, as long as they were exactly compatible with the previous version - compatibility proved the results were correct.
This job mostly consisted of finding rounding errors caused by the old VB3 code, but that's not what I'm here to talk about today.
One day, after dealing with many smaller functions, I felt I was ready to finally tackle the most complicated function in our code. This was a beast of a function, called Calc, which was called from everywhere in the code, did a whole bunch of calculations, and returned a single number. It consisted of 500 or so lines of spaghetti.
This function had a very peculiar structure:
Function Calc(...)
...
If SomeVariable Then
...
If Not SomeVariable Then
...
(the most important bit of calculation happened here)
...
End If
...
End If
...
End Function
But for some reason it actually worked. For days I tried to find out what's going on, where the SomeVariable was being changed or how the nesting indentation was actually wrong and didn't match the source, but to no avail. Eventually, though, after many days, I did find the answer.
SomeVariable = 1
Somehow, the makers of VB3 though it would be a good idea for Not X to be calculated as (-1 - X). So if a variable was not a boolean (-1 for True, 0 for False), both X and Not X could be truthy, non-zero values.
And kids these days complain about JavaScript's handling of ==...7 -
All front end written in one file. File has over 6000 lines, mix of a php, javascript and extjs. It kills my IDE.5
-
Found this gem in some old piece of code:
public static void printStackTrace(Exception e){
e.printStackTrace();
}3 -
VB3.
In my last rant I mentioned I used to convert VB3 code to .Net. Before that, I used to work on the VB3 product itself. This software emulated something from the real world, and as such complied with a bunch of regulations that changed on a regular basis, and always had additions and removals that were to be done on a strict schedule (e.g. "we're adding a new product next month, so we have to be able to sell it by the first of the month"). As such, it was a huge sprawling mess.
One day, I was given a task to change some feature slightly. The task was simple enough and really only required adding one line of code. I added that line and clicked "Run".
Error: Too Much Code
What? What do you mean too much code? I asked a colleague for help. "Oh, don't worry, it happens when a function is too long. Just remove one or two of the comments and try again." The comments were, naturally, old deleted code that was quite meaningless so I had no qualms about removing some. It worked, and I went on with my life.
This started happening on a regular basis on our larger functions. But there were always comments to remove so it wasn't a big issue.
One day, though, it happened on a five-line function. This was puzzling - the error had always happened when a function was too big but this one clearly wasn't. What could the error mean? I went to the same colleague.
Apparently, there's also a limit to how big the entire code base can be. "Just find a function that isn't used any more and delete it." And so I did. There were many such functions, responsible for calculating things which no longer existed so they were never called. For months, I'd find functions and remove them. Until there weren't any more. I checked every function and subroutine in our codebase, and they were all used; I checked every possible code path and they were all needed.
What do I do now, I asked? The colleague, who was an expert on VB3 but worked on another project, came and take a look.
"Look at all these small functions you made! No wonder you're running out of space!" Apparently each function created a lot of overhead in the compiled executable. The solution was clear. Combine small functions into large monolithic ones, possibly passing flags in them to do completely unrelated things. Oh, and don't comment on the different parts because we have no room for comments in our code base.
Ah, the good old days.5 -
My worst "legacy code" experience was when the company I work at couldn't get their heads out of their asses and stubbornly continued to write legacy code. As of this day they are still doing everything according to what was hip around 2004. And they even force me to write new legacy code.
New legacy code: it sounds like a paradox, but this company makes it happen.6 -
Both apps I'm working on have legacy code:
iOS app has 100's and 1000's of lines of code with no documentation, no proper naming conventions and cut and pasted code off the net.
Android app has skeleton code from a Spanish taxi app + remnants of a funeral webcasting app, there's also the same no documentation, bad naming conventions and cut and paste code off the net.
The server is also as bad, it had methods that we're never used, I for one don't fully understand the server but from what I can see it's a mess.
I had a hard time understanding both apps and gladly majority of the modifications I made we're not including existing stuff, so I guess I just basically pilled my code onto of the already existing software.
I would have gladly started from scratch given the chance.8 -
Worst legacy experience is when you go back to a project you were working on when you first started learning. My own code disgusts me the most.2
-
Php code without any class. Every page is a separate php file in project root folder.
Everything is all over the place, code repetition is everywhere.
The worst part? No security. The sql calls are with mysql_ functions and string concatenation. Files are just uploaded without checking.
And I had to repair it.2 -
Working on a damn old Android app's source code so it's usable in more recent versions (back when 2.2 Froyo was new). So much has changed in the Android SDK...1
-
Anything that's written in Java at my current company.
It's a mess, inefficient and appears to be written by monkeys...
And somehow the ppl that wrote this stuff were senior developers....3 -
The worst was an open source project I tried to look at.
It was written in Turbo Pascal.
I am not sure, never really got so far, but it looked like it was one single class with hundreds of methods and hundreds of instance fields for data.
Almost no data objects, if it needed for example 4 sets of 6 variables it had 24 instance fields and in some instances 4 different sets of methods for accessing said variables.
Around there I stopped looking ;)3 -
Everyday is my worst legacy code experience...... I go into work, open up anything written less than a year ago, and another part of me dies.
-
Ok, here goes...
I was once asked to evaluate upgrade options for an online shop platform.
The thing was built on Zend 1, but that's not the problem.
The geniuses that worked on it before didn't have any clue about best practices, framework convention, modular thinking, testing, security issues...nothing!
There were some instances when querying was done using a rudimentary excuse for a model layer. Other times, they would just use raw queries and just ignore the previous method. Sometimes the database calls were made in strange function calls inside randomly loaded PHP files from different folders from all over the place. Sometimes they used JOINs to get the data from multiple tables, sometimes they would do a bunch of single table queries and just loop every data set to format it using multiple for loops.
And, best of all, there were some parts of the app that would just ignore any ideea of frameworks, conventions and all that and would be just a huge PHP file full of spagetti code just spalshed around, sometimes with no apparent logic to it. Queries, processing, HTML...everything crammed in one file...
The most amazing thing was that this code base somehow managed to function in production for more than 5 years and people actualy used it...
Imagine the reaction I got from the client the moment I said we should burn it to the ground and rebuild the whole thing from scratch...
Good thing my boss trusted me and backed me up (he is a great guy by the way) and we never had to go along with that Frankenstein monster... -
800+ lines of js, implementing business logic from an excel spreadsheet. All variables named as the excel cells, e.g "B32 = G11 * Min(A12, A13)" and so on, all grouped in a few giant functions.
PM told me to modify some of the logic, ended up rewriting the whole thing. At least the next person working on it won't have to deal with this mess...1 -
My worst legacy code experience was when I worked as a freelancer and got a tiny job to improve a VBA module in some Excel file for a very big company. So what's worse than VBA? Having to change parts of VBA code that was passed around to other freelancers before like the cheapest dockside whore. After meddling in there for about half an hour I felt like all those cheap ass punter, so I decided to write the whole thing from scratch. What a relief, after 3 hours I was very proud of the thing and it looked clean and well maintained again so I let it back on the streets. 😉
To the coder who comes after me: Please treat her (the code) nice or I will burry you alive in dog poop and burn the whole thing!1 -
so... 9 years ago we had this super awesome codebase. 1 file, complete logic COPIED to be used in ui and service/daemon. I scrolled to the middle of the file and there was no source. it was out of bounds of my monitor to the right because of nested ifs. ok... what the fuck!! the worst part: I had to implement a new FEATURE into this mess. 2 days. I said it would not work as expected because the feature was not thought through. but project said let's gooooo! ok there I was, a junior with an impossible to implement feature and a codebase from hell. I've implemented something, all night long. next day it was the problem of the consultants. they called me, I told them why it's impossible that this would ever work, they understood and talked to the customer. he accepted the solution. WTF?! anyway, in those days I thought about quitting developing software as my daily job....4
-
My first task in my current company, a few years ago.
I had to add features to a 10 year old microcontroller-based device written in C.
There was a struct named "global", which held hundreds of other structs that held variables or even more structs.
If one would have printed the structure of this mess it would haven needed several pages.
This "global"-struct was used in every single sourcefile to store and pass data around. Obviously there was no documentation and often useless comments.
Additionally there were a few protocol stacks involved, mainly similar, only differing in one or two protocol layers.
The implementation of the protocol stack was by setting flags in the "global"-struct in every protocol layer and having the application data in a buffer.
The complete telegram with all layer specific data (header, checksums, etc.) was then build at one single point right before sending it, based on the flags and the data buffer.
As there was no chance to reuse protocol layers with this implemenation. Three protocol implementations with special telegram builder existed in parallel, although they were nearly identical.
I needed a fourth variant of the protocol stack, so I had no chance but to make another copy with some minor changes.
But there was a benefit from this task.
As I had to do the software for the successor of this device from scratch I learned for many things how not to do them :-) -
I've been working for the last 5 years on some large legacy code used in production, more than 100K LOC, poor comments (when existing) often outdated, huge parts of code that can no longer be reached, over-engineered class hierarchy, functions of thousands lines, huge parts of deprecated code that cannot be removed because "someone might still be using it". Statistically, every small change caused 3 new issues somewhere else and every bug fix or new feature required 10 times the time that would be necessary with a decent codebase. But after five years in hell I can finally say that... Oh wait, nothing changed, the code is still legacy and nobody is going to do anything about that.1
-
My last company had a code base originating in the 90's and they still write most parts of the GUI with a library that is a thin layer on top of Win32 API, with a self-rolled "ORM" for DB access (with LOTS of enums) and all that with >2million lines of C++ code. The code includes at least two implementations of std vector and std:list. One of which is even *named* std::vector. Feels good remembering that I have left that behind2
-
So we had this legacy Objective-C codebase for a mobile app that was actually pretty good: I'd inherited the codebase and spent the past several years gradually improving it and I was actually quite proud of the work I put into it. So of course management decides to scrap it (with NO consultation from the engineers) and outsource a complete rewrite of the app in C# for Windows Universal.
Let me tell you. That code was without a doubt and without exaggeration the *worst* code I've seen in my close to 30 years of experience as a developer. I mean they broke every rule in the book, I'm talking rookie mistakes. Copypasta everywhere, no consistent separation of concerns, and yet way too many layers. Unnecessary layers. Layers for the sake of layers. There was en entire abstraction layer complete with a replicated version of every single data class *just* to map properties in pascal case to the same property in camel case. Adding a new field to a payload in the API amounted to hours of work and about eight different files that needed to be modified. It was a complete nightmare. This was supposed to be a thin client, yet it had a complete client-side Sqlite database with its own custom schema (oh and of course a layer for that!) completely unrelated to the serverside schema, just for kicks. The project was broken up into about eight or nine different subprojects, each having their own specific dependencies on various of the other subprojects in such a tightly-knit way that it made gradual refactoring almost impossible. This architecture was so impressively bad, it was actually self-preserving!
Suffice it to say it was a complete nightmare, and was one of the main reasons I ended up leaving that company. So just sayin', legacy code isn't always bad. :) -
No error handling at all, not even a single try catch. Program crashes when the wind changes direction. Previous developer developed his test plan around his bugs. 😭1
-
Having to use Xcode 4 alongside the new 8 to support old iOS versions. I almost wrote the code twice, once in Swift and once in Obj-C.
-
New client came asking for maintaining their Facebook tab with fb sign in, etc... they were still on the old api. We basically had to redevelop the whole thing
-
Adding a proof of concept directly to production and handing it over without a single test is God's blessing.1
-
When the CIO referred to our entire backend system as a "heritage" codebase in a press interview.
Cue every backend developer scrambling to change projects, every manager scrambling to reassure the backend developers, and HR scrambling to hire new backend developers. -
Apply a Fortran code patch on a Gould SEL via a Mod 40 TTY terminal, which is essentially an electric typewriter connected to the computer. No graphics display. Once you hit enter on a line, that was it. If you fat-fingered something, you got to start over. We've come a long way, Baby!
-
10 years ago my bosses came to me: Make a few adjustments to the logic of this website. Should be a quick thing they said. Got a zip file later. Hundreds of php files. Inside, thousands of lines of the best PHP/HTML Spaghetti I've ever seen. No CSS though, but lots of nested table layouts. The best part: everything was in french, content, comments, varnames. The original dev didn't use includes for the most repetitive stuff, even db credentials were copied in every file. Took me a week.
Two weeks later: Change that and that please....
We decided to write everything from scratch then. -
My worst legacy code experience:
>10k lines of switch case statement with "some" fall through.
Even fall through for 4 or 5 cases.
This monster was copy pasted and modified over years (Order of the case statements and another fall throughs).
So you can't diff this piece of shit for refactorings.
Luckily I leave that company. -
Having a static class in C# with 20 variables of generic type: ArrayList with zero documentation to know type of array content 😒1
-
My second worst experience with legacy code:
JSP with inline java to create JavaScript which creates HTML on every fucking page load.
Luckily I leave that company too.4 -
About 2/3 weeks ago had to deliver a college project where we were supposed to create a snake multilayer game on win32 API.
Just to discover how to create a simple dialogue box with sliders and retrieve the values it took 1 entire day. Just handle a simple dialogue box!
And I found the solution on a forum post from the last millennium. Literally!
That's the kind of job you don't wish even to your worst enemies. -
Hey, I need to get something from the database here. But I've already created the connection somewhere else. Oh... I know! Let's just copy paste it here, here and here... Maybe just here and here too... And some more over here...
- The thought process that probably went through the head of the moron who wrote the code I started working on2 -
In my previous job, we had in c# a class called static manager. This abomination was thousands of lines long, every member static. Eventually the dev responsible, did split it in to multiple files each thousands of lines using partial class. Worst part? It wasn't even legacy code yet.1
-
At my school library there is this system, made in php, to make monthly reports on student access, since everyone goes to the library everyone knows it and the guys who did it were considered the best of the school. So since I used to work on the library the director asked me to add some features to it, and I was like "Sure, cool I get to work on a real system", what I didn't know was that the system had no head or tail, the core were two files "load.php" and "db.php", everything was in those two files, no design patterns, no oops, safly that wasn't even the worst part, the modules were loaded through Ajax, which called files with lines like
`echo "<td>Student</td>";`
Literally most of the damn HTML was "echoed" WTH,undefined another useless tag student stories legacy wk58 pichardo for president php hate nightmares -
In one of my previous jobs. There are some scripts programmed by people that seems to don't know what a function is. It was a fractal of replicated if else code. Every half of the code is almost identical to the other one except for a simple things. Then if you see each half you can see the same pattern again and so on. Files like that are about 50.000 lines long. If you blame it, you see mostly the usernames of current managers. If that is not enough, it was written in perl
-
I had the "pleasure" of working with someone who though that it would be a good idea to create random strings and check if they were in a database, to ensure they are unique. What's even better, is that this was being used for batch generation of up to 100 such strings at a time!
-
Me maintaining my own old code, questioning why the fuck I thought it was a good idea to intertwine UI and logic. I gave up trying to do some major updates and started work on version 2 instead.
-
Currently modifing a old Excel VBA Application. Found code which try to parse a Textbox on every change. If its a valid Number, it saves the value into a label. When saving the form the label will be parsed and validated instead of the Textbox
-
Someone had created a program in VB that was used to properly format files for EFTs for a while. It wasn't working with a particular file, so I just ended up reverse-engineering it in Python.
-
When I want to travel back in time I take a look into the legacy code I've wrote more than a 10 years ago.
-
Wow. All these weekly rants work so well with my current project lol.
A 4-5 year old iOS project, written in Objective-C with some jQuery thrown in to keep things interesting. Its the kind of codebase where you look at some code and think "what the....how....you know what nevermind". Everything has CoreData mangled into it somewhere which causes all kinds of issues. got search results from a web API? better save those to CoreData. Why? Who knows...1 -
As a junior dev, i really appreciate these wk58 rants. Every time i begin to doubt my abilities, i get some insights into the work of past geniuses, and i feel like im doing pretty good for a rookie
-
Took over a project where a dev created a table with no primary key and enforce a unique constraint in code. Wtf? He also always selected top 1 so if you added a record directly in the table it completely fucked the expected data.
So, when I took this piece of shit over I didn't realize what the table was and when I tried to convert it to EF it barfed since there was no PK. Was a complete PITA and had to create all new tables.
Some people shouldn't develop software!!!!!!!!! -
Legacy code was so bad that it created the existence of my team to do a refactor and rewrite.
(Outsource to in house) -
ArseHole, for simple CRUD, my client suggest to use WordPress. Then they added payment and booking system. I asked why still using WordPress????? It's nightmare to work three peoples on functions.php file.
Fuck off. Go fuck yourself. 😣7 -
My last rant with example of usefull PHP function in old inhouse CRM software was somewhat popular, so I decided to post more stuff. This time we look at the login function. Besides obvious problem of SQL injection (that i of course tested) we have two calls to the same 'poslednji_login()' method (translated to english - 'last login') that actually just returns current time, not the last login time... twice...6
-
I haven't had to work with much legacy code other than mine. I always wonder what I was doing every time I have to fix something in an old project. At least it verifies I am learning and improving my programming skills.
-
Now where do i start. Hmm. Oh. How about a mountain of nested ifs. Or, super god codes. How about some unreadable variable names.
-
Not code per se but a company I worked at ran their document control from a giant spreadsheet. Each row had info and a link to the document.
It was all in one directory anyway... -
Why hasn't Google told us 5 years ago that we should use fragments whenever possible so it won't be a pain in the arse to add a navigation drawer?! 😥4
-
So far I've been pretty lucky... except for the code some of my professors at uni used in their assignments. A couple of them had this horrid habit of giving you a horribly-written, out-of-date (we're talking these chuckle heads used the same code for years on end and wondered why it didn't work on new versions of Java), messy source file with "fill in the blanks" sections like it was some kind of Java Mad Libs book. One of them had an entire jarchive of data structures we were required to use that he'd written in the '90s and NEVER UPDATED. Another one had a script he'd written for his own specialized assembly macro preprocessor that he'd been using without update for who even knows how long. Now, we were using one of those goofy virtual machines with its own simplified assembly language, and we were on the fourth version of the program. This guy'd written his macro processor in Java for the second version, never updated his Java source, only provided a barely-working .bat script for running it, even though the department's official preference was a *nix environment, and implemented this horrid "pretty-printer" that had a regrettable little habit of eating code. You heard that right. You'd run build.bat and it'd expand your macros then send it over to the pretty-printer which would very infrequently just replace the existing program file with an empty file. When we brought it to his attention, he goes "...huh. never happened to me." and proceeded to use the very same set of programs for the next three semesters, even when the assembly simulator was updated again. I heard wails of anguish from the poor sad souls that came after me as their macro processor created program files with deprecated operations, their pretty printer printed out beautiful, perfectly-organized empty files, and the professor responded to every second of a student begging for an updated version with "...huh. never happened to me." I never saw a single bug reported to either of those professors even acknowledged, let alone fixed. Some of the Java Mad Libs were the same ones they'd started using when they first switched the curriculum from Ada to Java. Thankfully after my first year I escaped into the bliss of the next three years, which were full of *nix and C and beauty.
-
30 years old PHP code (PHP 5.3). One big global variable holding system settings, entire row sets of data! and database cursors. Oh and HTML was mixed in between. Worst part, I had the task to secure the application. Sql injection didnt even exist back then.2
-
Sub Window_(some 20+ params)
...
Window_Fenster(...)
Sub Window_Fenster(even more params)
....
Altogether, these two procedures had ~20k LOCs. -
Inherited a legacy system from a previous "developer" who wrote code to sanitize input from sql injection in the front end and then called an web method called execSql which accepts am sql statement in a string value!
Obviously the app ran under admin privileges.2 -
That moment when you get asked if you know a language and database that your shop has never used, because an ex-employee in a different department decided to build a mission critical app on their own accord, and it just went tits up.