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 - "shared objects"
-
"You mean to tell me that you deleted the class that holds all our labels and spin boxes together?" I said exasperatedly.
~Record scratch.mp3
~Freeze frame.mp4
"You're probably wondering how we got to this stage? Let's wind back a little, shall we?"
~reverseRecordSound.wav
A light tapping was heard at the entrance of my office.
"Oh hey [Boss] how are you doing?" I said politely
"Do you want to talk here, or do you want to talk in my office? I don't have anyone in my office right now, so..."
"Ok, we can go to your office," I said.
We walked momentarily, my eyes following the newly placed carpeting.
Some words were shared, but nothing that seemed mildly important. Just necessary things to say. Platitudes, I supposed you could call them.
We get to his office, it was wider now because of some missing furniture. I quickly grab a seat.
"So tell me what you've been working on," I said politely.
"I just finished up on our [project] that required proper saving and restoring."
"Great! How did you pull it off?" I asked excitedly.
He starts to explain to me what he did, and even opens up the UI to display the changes working correctly.
"That's pretty cool," admiring his work.
"But what's going on here? It looks like you deleted my class." I said, looking at his code.
"Oh, yeah, that. It looked like spaghetti code so I deleted it. It seemed really bulky and unnecessary for what we were doing."
"Wait, hold on," I said wildly surprised that he thought that a class with some simple setters and getters was spaghetti code.
"You mean to tell me that you deleted the class that organizes all our labels and spin boxes together?" I said exasperatedly.
"Yeah! I put everything in a list of lists."
"What, that's not efficient at all!" I exclaimed
"Well, I mean look at what you were doing here," he said, as he displays to me my old code.
"What's confusing about that?" I asked politely, but a little unnerved that he did something like this.
"Well I mean look at this," he said, now showing his "improved" code.
"We don't have that huge block of code (referring to my class) anymore filling up the file." He said almost a little too joyously.
"Ok, hold on," I said to him, waving my hand. "Go back to my code and I can show you how it is working. Here we are getting all the labels and spin boxes into their own objects." I said pointing a little further down in the code. "Down here we are returning the spin boxes we want to work with. Here and here, are setters so we can set maximum and minimum values for the spin box."
"Oh... I guess that's not that complicated. but still, that doesn't seem like really good bookkeeping." He said.
"Well, there are some people that would argue with you on that," I said, thinking about devRant.
He quickly switches back to his code and shows me what he did. "Look, here." He said pointing to his list of lists. "We have our spin boxes and labels all called and accounted for. And further down we can use a for loop to parse through them."
He then drags both our version of the code and shows the differences. I pause him for a moment
"Hold on, you mean you think this" I'm now pointing at my setters "is more spaghetti than this" I'm now pointing at his list of lists.
"I mean yeah, it makes more sense to me to do it this way for the sake of bookkeeping because I don't understand your Object Oriented Programming stuff."
...
After some time of going back and forth on this, he finally said to me.
"It doesn't matter, this is my project."
Honestly, I was a little heart broken, because it may be his project but part of me is still in there. Part of my effort in making it the best it can be is in there.
I'm sorry, but it's just as much my project as it is yours.16 -
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 -
Legacy code.
Honestly though, this is some of the better legacy code I've worked with at this company. It's a nifty alert system wherein you can trigger sending messages to subscribers of that alert via whatever means (phone/email) they've entered.
I'll save you the technical analysis of its internals, but suffice to say it's actually pretty nice, with good separation of concerns, internal logic hidden away, dead-simple public interface, etc. documentation is kinda crap, but it exists (!), so that's a nice change.
but.
For some unknown and bloody bizarre reason, the thing breaks when a user wants both sms AND email notifications. Either by themselves work totally fine, but both together? nonono. Email alerts give ArgumentErrors, so something internal isn't correct, and SMS alerts complain about uninitialized Twilio::Error constants.
but.
they both work fine otherwise?
also, the two notification preferences aren't stored on the same object anywhere. if a user wants both, the user creates two AlertContact objects with different info, and when performed, the Alert basically iterates over these and does its thing for each, so there is no knowledge shared between them. totally should work the same regardless.
idfgi.
ALSO.
AND THIS PART REALLY PISSES ME OFF.
WHEN THERE'S AN ERROR, THIS THING DOESN'T LOG IT. IT STRINGIFIES THE ERROR OBJECT (basically just extracting the message) AND INSERTS THAT INTO THE DATABASE INSTEAD. WHAT THE CRAP.
So, I don't get a stack trace, line number, or anything. just the basic error message. instead of my alert text. because of course that makes sense and totally helps debugging.
aklsjfak;sldfj.
legacy code.5 -
The code is a freaking mess. Shared behavior, terrible variable/method naming, misleading module naming, dynamic polymorphic spaghetti, whitespace errors, no consistency, confusing even if you understand what the code is doing, ... . It should never have passed code review. It probably wasn't code reviewed.
The comments are sparse and useless. Quality level: // This is bridge.
The documentation does not exist.
Testing steps for QA are missing several steps, including setup, so actually using the feature is bloody challenging. If one thing is wrong, the feature just doesn't show up (and ofc won't tell you why).
The specs for the feature are outdated and cover only 4 of 19+ cases. And are neigh useless for those 4.
The specs for the report I'm fixing don't even check the data on the report; it just checks for one bit of data on each row it creates -- a name -- which is also the same on each row. gg.
The object factories (for specs) are a mess, and often create objects indirectly, or in backwards order with odd post-create overwriting to make things work. Following the factories is a major chore, let alone fixing or extending them.
The new type has practically zero test coverage.
The factory for the new type also only creates one variant -- and does so incorrectly.
And to top it all off: the guy who wrote the feature barely ever responds. If he does, he uses fewer words than my bird knows, then stops responding. I've yet to get a useful answer out of him. (and he apparently communicates just fine, according to my micromanager.)
But "it's just fixing a report; it'll be easy!"
Oh, fuck off.8 -
Had an online programming interview for a start-up, writing code into a shared Google doc while on the phone with the interviewer.
Specifically told that I could just use pseudocode, so I did, without worrying about access modifiers, full variable declarations and use of "new" for making objects, or specific type declarations, etc.
Got told at the end that I "lack experience, and really should have defined access modifiers, declared types, and so on, and that they needed someone proficient in Java. That was the first time I knew about their Java requirement.5 -
It’s late, and stupid RSpec has decided to only mock calls to a particular method in some specs but not in others.
`allow(object).to receive(:method).with(resource_arg).and_return(“some\ntext”)`
Works in a few specs, but not the rest. Why? Who the fuck knows. Probably some shared state between specs that isn’t supposed to happen.
HAHA JUST KIDDING
After refactoring my specs to use unique ‘resource’ names for each call because I’ve had shared state issues before.
and after refactoring my model code to remove a lot of now-unused dependency injection (because maybe it was mocking a different object than got passed in?)
Guess what?
When creating my mock objects, I forgot to link them together. That’s it. A 14-character change. And suddenly they all pass.
Asdjklfajg.
Time for bed.3 -
I am pulling my hair out on ducking low level stuff. This is why people (more importantly me!) should have the chance to learn, rather than assume how things work.
Has anyone of you detailed resources on how linking objects into shared libraries really works ? Especially Name Resolution. All those ducking tutorials and bloody blog post just have simple examples and explain shit not in detail!
Even ducking man pages on gcc/ld don’t help me out! Maybe I’m too dumb to type the right words into me search engine. I’d even love to read a bloody paper book.16 -
When did the meaning of
"Statically linked", under Linux, change from
This binary includes all libraries it depends on and will run on any device that runs a sufficiently compatible hardware and kernel.
to
This binary will only run on these 3 Ubuntu versions, because it still depends on a fuckton of shared-objects of " default" libraries and this shit-distro is the only one, that comes pre-bloated with all of them.5 -
Got a nice solution, part of a micro-services system. Interfaces where they should be. Single responsibilities. Easily unit testable (and plenty of tests in there).
Then the Senior rewrites things because he didn’t see the point in having interfaces and couples every layer to a shared set of objects, and those objects are now shared by all the other micro-services too. One change in one and we have to repeat it in every service. 🤦♂️4 -
I like the people I work with although they are very shit, I get paid a lot and I mostly enjoy the company but..
Our scrum implementation is incredibly fucked so much so that it is not even close to scrum but our scrum master doesn't know scrum and no one else cares so we do everything fucked.
Our prs are roughly 60 file hangers at a time, we only complete 50% of our work each sprint because the stories are so fucked up, we have no testers at all, team lead insists on creating sql table designs but doesn't understand normalisation so our tables often hold 3 or 4 sets of data types just jammed in.
Our software sits broken for months on end until someone notices (pre release), our architecture is garbage or practically non existent. Our front end apps that only I know the technology have approaches dictated by team lead that has no clue of the language or framework.
Our front end app is now about 50% tech debt because project management is so ineffectual and approaches are constantly changing. For instance we used to use view models for domain transfer objects... Now we use database entities, so there is no commonality between models but the system used to have shared features relying on that..sour roles and permissions are fucked since a role is a page regardless of the pages functionality so there is no ability to toggle features, but even though I know the design is fucked I still had to implement after hours of trying to convince team lead of it. Fast forward a few months and it's a huge cluster fuck to enforce.
We have no automated testing of any sort or manual testing in place.
I know of a few security vulnerabilities I can nuke our databases with but it got ignored.
Pr reviews are obviously a nightmare since they're so big.
I just tried to talk to scrum master again about story creation since any story involving front end ui as an aspect of it is crammed in under one pointed story as sub tasks, essentially throwing away any ability to calculate velocity. Been here a year now and the scrum master doesn't know what I mean by velocity... Her entire job is scrum master.
So anyway I am thinking about leaving because I like being a developer and it is slowly making me give up on doing things to a high standard and I have no chance of improving things, but at the same time the pay is great and I like the people.