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 - "time to rewrite it from scratch"
-
expect([
row[‘blah’][0][1],
row[‘blah’][1][1],
row[’blah’][2][1],
row[‘blah’][3][1],
row[‘blah’][4][1],
]).to contain_exactly(
a.name(user), # “John doe”
c.name(user), # “John doe”
e.name(user), # “John doe”
b.name(user), # “John doe”
d.name(user), # “John doe”
)
(Note: The comments are mine.)
See the problem? No, not the ugly code (which is actually worse than what i posted here).
It’s using the same ridiculous getter (if you can call it that) that pulls a name out of the passed user object, and then expecting each row to have that name, in order. Not that order matters when they’re all the same.
Upon inspection, all objects created by the spec have the exact same name, so the above test passes (as long as there are 5 rows). It passes, but totally not because it should: those aren’t the objects that are actually in the table. All of the specs — all 22 of them — only check for that shared name on various rows, and no other data. And it’s not like this is the only issue, either.
Fuck me these are bad.
And this guy is a senior dev earning significantly more than me. Jesus what the fuck Christ.18 -
The last person who might have taken offense at this recently quit, so time for a consequence-free rant. I just want to say...
Fuck absolutely every single one of my teammates who quit this year. Fuck your shitty, undocumented spaghetti code from hell that the rest of us will have to rewrite because it's utterly broken and functions mostly on prayer and luck. Fuck the 1000+ git repos we'll have to rename so we can even begin to tell them apart. Fuck your complete lack of any sort of processes or procedures or standards. Fuck the person who hated tickets and decided we could just have hundreds of people ask us for help on Slack whenever they need it. Fuck the people who quit because we got a new manager who told us we need to support the applications we build. Fuck the person who said "I'm leaving because I want to move forwards instead of backwards" as if fixing bugs in the code YOU WROTE TWO WEEKS AGO is really moving backwards. Fuck the two people who designed their own separate pipelines and then used both without bothering to debate and pick the better one (spoiler: both are completely undocumented and broken as hell).
I hope your various new employers figure out that your strategy of covering shit with gold paint doesn't change the smell.
Now the rest of us have to fix it all, and we're probably going to start by demolishing most of it so we can rebuild it from scratch.12 -
Question everything!
Comments lie.. sometimes code does too.. Customers..they lie the most..and are sloppy..
Don't be like customers, don't be sloppy. If you were sloppy own it & don't lie about it!
Pick your fights (trying to fix vs rewrite the shit out of it)..you will know what to do more with experience..
RTFM & docs.. If things still unclear, ask before your dick gets stuck in a toaster!
Ask away, learn about the customers & how they use your product.. you'll be surprised how something intuitive to you might be a rocket science for them..meaning more room to fuck things up when using it..more ways you can adapt & prevent things..
Most of all, don't fuckin lie.. ever!!
If you lie on you're CV, we will find out.. If you fuck up something & lie about it, we will find out.. but it will cost us precious time when solving it from scratch.. People fuck up..that's a fact..how you go about it is what makes/breaks it for me. So don't ever fuckin lie to me!!
And don't be arogant.. if you complain about fixing bugs, this is not a job for you.. if you can't even fix the obvious ones you've put there in the first place..twice as bad..
So think before you code..what do you want to do, how you want to accomplish this, is it reusable, can it be extended, does it introduce new technology into the project, will it fuck up current setup.. once you have this shit figured out, code will write itself..
Did I mention already you're not to lie to me, ever?!
And don't try talking about me behind my back either..I've seen it backfire before, results were not good..3 -
This is my first rant here, so I hope everyone has a good time reading it.
So, the company I am working for got me going on the task to do a rewrite of a firmware that was extended for about 20 years now. Which is fine, since all new machines will be on a new platform anyways. (The old firmware was written for an 8051 initially. That thing has 256 byte of ram. Just imagine the usage of unions and bitfields...)
So, me and a few colleagues go ahead and start from scratch.
In the meantime however, the client has hired one single lonely developer. Keep in mind that nobody there understands code!
And oh boy did he go nuts on the old code, only for having it used on the very last machine of the old platform, ever! Everything after that one will have our firmware!
There are other machines in that series, using the original extended firmware. Nothing is compatible, bootloaders do not match, memory layouts do not match, code is a horrible mess now, the client is writing the specification RIGHT NOW (mind, the machine is already sold to customers), there are no tests, and for the grand finale, the guy canceled his job and went to a different company. Did I mention the bugs it has and the features it lacks?
Guess who's got to maintain that single abomination of a firmware now?1 -
In only I were 1.15 times faster or had better planning (why didn’t I use the Saturday Sunday at the end of the first week 🤦🏼♂️), things would’ve happened differently. I think I’m becoming stupid and my tolerance levels are going down too.
So this happened a while back ..
I was given a code base which didn’t have any changes in the last two years and I was asked to add a feature to this. This was my first task in this new group I was part of. I had two weeks to do this starting on a Monday.
Partway through implementation I realised that the code base is a pile of shit and I wasn’t doing myself or anyone else any favours by shitting on it.
It’s Wednesday. I’ve dealt with many other codebases before but the urge to rewrite this particular one was just unlike anything else. And so I started changing code and before I realised, I modified almost all the important files.
I got sick of this mixed up code and started a rewrite from scratch. It was Friday and I finally had just the basic mechanics of the whole thing working. Now I needed to add all the functionalities and also my new feature.
It should be noted that at no point did I tell any of the superiors I was doing this fearing what they might say and also fearing going back to adding shit to shit.
By the end of the second week, the rewrite was complete and I only had the new feature to add. The rewrite was significantly smaller, compartmentalised and well commented because I did the bloody commenting (where it was not obvious from the code). So on Friday, I was asked about the progress and I told them that it needed some more work and that I need a couple more days. And I got shit for it. I was told it was a mistake giving this task to me and that I am not competent enough. One of the superiors told the other superior about perhaps giving me something more suited to my level. To be fair to them, they were expecting the work in the two weeks to be for the new feature.
And in two days’ time, on Monday (I worked on Saturday and half of Sunday), I finished the whole thing and gave it to them. New feature was working. And I still did not tell them what I did. The tool worked fine so they had no idea what happened because this project had no version control and I pointed them to a new directory with the new code with a first commit.3 -
A house.. or lego star destroyer..😝😆
Joke aside, I'd rewrite current project from scratch to get rid of all the automation and IE dependancies and make it cross browser and all the dead code...and all excess ORMs and especially EFCF..and also make support for db diff than oracle..and no need for ora client installation..
Yeah, I'm a work junky, I have no projects of my own.. one kid is demanding enough of my time.. 😉3 -
!rant
For a bunch of application redesigns that we are doing at work I am letting the other two developers in my department help with selecting the stack. Normally, we work with Java and PHP, and while they seem to enjoy php I find them concerned at the possibility of making it more Java centric.
So I compiled a list of examples of different tech stacks that are not only more modern (cuz our Java stuff is old JSP stuff) but also simple to learn and use. Mind you, the point is to make this a gradual change, not just rewrite the entire house from scratch.
the list contained examples in:
Python: django and flask
Ruby: Ruby on Rails
Java: Spring Boot
Golang: Small self made mvc framework I built, nothing fancy on it, it uses templates and shit, didn't make it api centric
Node: Express examples in both vanilla JS and TypeScript
php with Laravel.
Since we work with php most of the time as well I imagined that they would be more inclined for Laravel, but I was wrong :P they seemed to like the Node Express route and the Golang route more than anything else with Python and Django being close.
Personally I know that there is more to selecting a stack, but initial perceptions make for a lot of things in selection of the stack.
Pretty excited, if they gauge everything considered in regards to what we have and we found Golang to be a clear winner it would give them the chance to add a nice and competitive tech to their resumes.
not a rant, or anything per se, just wanted to share some stuff with y'all2 -
At this point I fucking hate my project. After 3 months I literally can not concentrate, I am just staring on a screen, smashing my hands on the keyboard and praying that it will fucking work without bugs. At this point it still works pretty well. I am so sorry for everyone that will have to work on this after I leave. According to the project leader it should not take more than 20 more hours. Hes a really cool guy, but if he's going to talk optimistically about this fucking project once more I am gonna rape his wife and his dog. Last fucking time he said that its just 2 already implemented features that just need to get connected together, I spent 30 hours rewriting half of the codebase because how inconsistent and shitty the code was. I am not fuckin suprised that we are going to rewrite whole shit from a scratch, because the code is already unmaintainable. Wish me luck, because I really need it to survive another week working on this trash.1
-
personal projects, of course, but let's count the only one that could actually be considered finished and released.
which was a local social network site. i was making and running it for about three years as a replacement for a site that its original admin took down without warning because he got fed up with the community. i loved the community and missed it, so that was my motivation to learn web stack (html, css, php, mysql, js).
first version was done and up in a week, single flat php file, no oop, just ifs. was about 5k lines long and was missing 90% of features, but i got it out and by word of mouth/mail is started gathering the community back.
right as i put it up, i learned about include directive, so i started re-coding it from scratch, and "this time properly", separated into one file per page.
that took about a month, got to about 10k lines of code, with about 30% of planned functionality.
i put it up, and then i learned that php can do objects, so i started another rewrite from scratch. two or three months later, about 15k lines of code, and 60% of the intended functionality.
i put it up, and learned about ajax (which was a pretty new thing since this was 2006), so i started another rewrite, this time not completely from scratch i think.
three months later, final length about 30k lines of code, and 120% of originally intended functionality (since i got some new features ideas along the way).
put it up, was very happy with it, and since i gathered quite a lot of user-generated data already through all of that time, i started seeing patterns, and started to think about some crazy stuff like auto-tagging posts based on their content (tags like positive, negative, angry, sad, family issues, health issues, etc), rewarding users based on auto-detection whether their comments stirred more (and good) discussion, or stifled it, tracking user's mental health and life situation (scale of great to horrible, something like that) based on the analysis of the texts of their posts...
... never got around to that though, missed two months hosting payments and in that time the admin of the original site put it back up, so i just told people to move back there.
awesome experience, though. worth every second.
to this day probably the project i'm most proud of (which is sad, i suppose) - the final version had its own builtin forum section with proper topics, reply threads, wysiwyg post editor, personal diaries where people could set per-post visibility (everyone, only logged in users, only my friends), mental health questionnaires that tracked user's results in time and showed them in a cool flash charts, questionnaire editor where users could make their own tests/quizzes, article section, like/dislike voting on everything, page-global ajax chat of all users that would stay open in bottom right corner, hangouts-style, private messages, even a "pointer" system where sending special commands to the chat aimed at a specific user would cause page elements to highlight on their client, meaning if someone asked "how do i do this thing on the page?", i could send that command and the button to the subpage would get highlighted, after they clicked it and the subpage loaded, the next step in the process would get highlighted, with a custom explanation text, etc...
dammit, now i got seriously nostalgic. it was an awesome piece of work, if i may say so. and i wasn't the only one thinking that, since showing the page off landed me my first two or three programming jobs, right out of highschool. 10 minutes of smalltalk, then they asked about my knowledge, i whipped up that site and gave a short walkthrough talking a bit about how the most interesting pieces were implemented, done, hired XD
those were good times, when I still felt like the programmer whiz kid =D
as i said, worth every second, every drop of sweat, every torn hair, several times over, even though "actual net financial profit" was around minus two hundred euro paid for those two or three years of hosting. -
Hire are a few tips to up productivity on development which has worked for me:
1) Use a system of at least 16gb ram when writing codes that requires compilation to run.
2) Test your code at most 3 times within an hour. This will combat the bad habit of practically checking changes on every new block you write.
3) Use internet modem in place of mobile hotspot and keep mobile data switched off. This will combat interruptions from your IM contacts and temptations to check your WA status update when working.
4) Implementation before optimisation... This is really important. It's tempting to rewrite a whole block even when other task are pending. If it works just leave it as is and move on to the next bull to kill, you can come back later to optimise.
5) Understand that no language is the best. Sometimes folks claim that PHP is faster than python. Okay I say but let's place a bet and I'll write a python code 10 times faster than your PHP on holiday. Focus more on your skill-set than the language else you'd find yourself switching frameworks more than necessary.
6) Check for existing code before writing an implementation from scratch... I bet you 50 bucks to your 10 someone already wrote that.
7) If it fails the first and then the second time... Don't try the third, check on StackOverflow for similar challenge.
8) When working with testers always ask for reproducible steps... Don't just start fixing bugs because sometimes their explanation looks like a bug when other times it's not and you can end up fixing what's never there.
9) If you're a tester always ask for explanations from the dev before calling a bug... It will save both your time and everybody's.
10) Don't be adamant to switching IDE... VSCode is much productive than Notepad++. Just give it a try an see for yourself.
My 10 cents.1 -
After one year working part time (10%) as new consultant in the company, the consultant calls the technical director in the evening and asks: "hey, how much do you think it will cost to rewrite a SaaS platform somewhat similar to ours from scratch in outsourcing and scaling from the actual 500 customers to 500 thousands? I need to know by tomorrow morning, as we have a pitch with investors. Do you think it's ok to ask for 500K$? Actually, I can only ask for 500K$."3
-
Not a horror. I'm rewriting services.
It started as a help request. I was asked to help with completing a service dealing with push notifications which was a research prototype. It was suggested to keep core part of it, but it was so awful that I just removed all files and wrote the service from scratch.
The second service had been developed for more than a year by a junior and then by our manager who wanted to complete it as fast as possible, without taking care of code quality. Then I was asked to take over the project and after some time I agreed with one condition: I'll have 1 month on takeover. But when I looked at the code, it became clear that it's much faster and better to rewrite everything except API and database than to takeover existing code.
The third service dealing with file exchange was working, but the junior who wrote it advised to rewrite it because it was a very simple service. So, I initiated rewriting, designed a new API and reviewed the final result.
And now I'm dealing with the fourth one. It was developed in my team but not under control. Now, when I "inherited" this complicated project, I decided to rewrite it because it should be simple, but it doesn't. It features reflection, layers inside layers, strange namespaces, strange solution structure. And that's after months of refactorings and improvements. So, wish me luck because I want to keep part of the infrastructure, but I don't know if it's possible.