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 - "singletons"
-
Me: Oh I see were using a non-standard architecture on this app. I like this bit but what is this doing? never seen it before.
Him: Ah we use that to abstract the navigation layer.
Me: oh ok, interesting idea, but that means we need an extra file per screen + 1 per module. We also can't use this inbuilt control, which I really like, and we've to write a tonne of code to avoid that.
Him: Yeah we wanted to take a new approach to fix X, this is what we came up with. Were not 100% happy with it. Do you have any ideas?
**
Queue really long, multi-day architecture discussion. Lots of interesting points, neither side being precious or childish in anyway. Was honestly fantastic.
**
Me: So after researching your last email a bit, I think I found a happy middle ground. If we turn X into a singleton, we can store the state its generating inside itself. We can go back to using the in-built navigation control and have the data being fetched like Y. If you want to keep your dependency injection stuff, we can copy the Angular services approach and inject the singletons instead of all of these things. That means we can delete the entire layer Z.
Even with the app only having 25% of the screens, we could delete like 30+ files, and still have the architecture, at a high level, identical and textbook MVVM.
Him: singleton? no I don't like those, best off keeping it the way it is.
... are you fucking kidding me? You've reinvented probably 3 wheels, doubled the code in the app and forced us to take ownership of something the system handles ... but a singleton is a bad idea? ... based off no concrete evidence or facts, but a personal opinion.
... your face is a bad idea15 -
!rant
People : Hey, cool wallpaper. Where did you get it from?
Me :
for (Person p : People){
if(p.equals("dev"))
return "It's from somewhere you'd love to be and never come back!";
else
return "Ahh..internet..wait, guess what? Don't bother!";
}6 -
A friend called ITIS guys about some network issue on his system.
Frnd : Hi, I'm facing some security policy issues on my system. Could you help me connect?
ITIS guy: Ok. Please run 'gpupdate /force' cmd from cmdpromt.
Frnd: Well actually I'm on Linux.
ITIS guy: Well, at least give it a try and tell me how it goes.
*Facepalm*? *Bodypalm*? Murder?4 -
Never used Linux before. At least not enough to say I've worked on it. But these discussions in here, they've pushed me. I'll do it now. I'll try Fedora. Right now! And never come back...till it's ABSOLUTELY needed.25
-
Found this online while searching for something about shitty existing code that I just didn't understand. Irony!
-
Indian tech companies can put in weird skill requirements at times. See point 2, for fuck's sake is this real?! And it obviously contradicts point with point 5 right?6
-
Some honest to God declarations are in place here! Hope no new js frameworks get added before this rant is seen.5
-
Learning to use Singletons in Java. Then reading online that it might be an antipattern. Software Engineering ... 👌10
-
Manager : I wish to upload an excel sheet from my browser, and based on *some conditions*, could you please highlight the cells with incorrect values.
Me: And then download the new edited sheet with highlighted cells, right?
Manager: No just change the file that I have on my desktop. So I can repeat whenever I need, with the same file.
Me: :/1 -
When manager scolds you for the team but there was some other lazy ass who didn't put his work in place.1
-
Still can't stream videos absolutely smooth on Fedora. Tried Chromium, Firefox and every fckin' plug-in they keep asking for. Half the stuff either just keeps loading or buffering. And the moment I give up and switch to Windows, everything just works. Why are we not building better stuff on linux? *Sigh*8
-
The reason for half the web-dev world sufferings is that Microsoft won't stop choking their users with explorer or edge, and half of the client are too dumb or lazy to download a different browser to test stuff. Fuck this shit man! Nothing works the way it should on this bitch.
Everytime my manager says- It should work perfectly on IE because client doesn't have any other browser, I curse IE for exisiting. If you can't improve it, just remove it you freakin' sadists. It'll not be an embarrassment to load something better on your OS. If anything, it'll get people to like you maybe. Like you for accepting your fuckery and making a decision in favor of the web dev world and innocent windows users, who only use your explorer to download other browser asap. For just that one time and for all your arrogance, you're making the whole world suffer.2 -
My manager believes every bug can be solved by adding a thousand printf(s) and checking which part of the code isn't being hit. How do I politely tell him to get his shit straight? 😂😂😂8
-
Contex: Working on a c++ frankenstein code (mixture of legacy and new stuff whith things depending on the client using it)
User Story: Migration from oracle to SQLite for half of the DB data
Summoner: One client wants to keep using legacy for now, therefore we need an strategy chooser templated singleton...
Satan 666 = Singletons + Static methods + Different compilation units
Result: 3/4 of the files of the full backend being modified for the migration.
Conclusion: When will be loaded on production company will probably lose many clients due to unspected bugs everywhere.
Insert potato here2 -
Why is DevRant consuming so much power in the background? My Android starts ranting about it every time I leave the app minimized.6
-
Even Fedora has 'very frequent' updates. But they don't irritate you like hell! Who doesn't like updates when they come easy? But luckily for Microsoft, they've always been able to find a unique way to piss off their users someway or the other!4
-
Got rejected from a really nice opportunity today. Irrelevant experience as it seems to the company.
As it turns out I'm an unlucky beginner in the industry who's stuck with a wrong, legacy code project. Doesn't mean I don't know anything and I can't learn new stuff. They were not judging capabilities, just judging people by the project they're working on in their current firm.1 -
Eclipse and it's fuckery!
Shows error/warning on random line. Don't know what's wrong, coz nothing is! Select all, cut and paste the selection on the same page and save again. Woof! Errors gone! Dafuq Eclipse? What sorcery is this bitch? -
Started learning to code and built applications using spring, hibernate, jsf and sql dbs. Never called ourselves 'full stack bitches'! And now, with these JS toys around, no one is less than a full stack ninja! Fckin' full stack experts everywhere!5
-
This lack of real human contact is getting on my nerves. Most of the text messages, discussions, especially in PR or design roads to follow develop into pissing contests. Always proving how much one is right and the others are wrong. -
I get so pissed off with little details, e.g. useless, wrongly handled boolean return values. Cannot understand how they don't see it my way. Or how they can feel superior by offering platitudes like "One should never use singletons". As if following some stupid rules and patterns from a book made you a better programmer instead of looking closely what each problem really needs. Or how they don't measure properly/scientifically or can't interpret the numbers.
My blood pressure already rising just from writing about it. Maybe I need to get some time off. But at the same time I feel like, they are doing it all wrong or not the way it should be done, so it's hard to let go. To obsessed with all that shit...1 -
Our original backend codebase used so-called "clean architecture" and really put the Java back in JavaScript (actually TypeScript, but hopefully you get my meaning).
For every endpoint I want to create, our design needs at least two classes that are basically callable singletons. If my understanding doesn't fail me, it could have been simple old functions... I think?10 -
It kills me when people performing UAT do not know how to test a particular functionality but still mark it as a defect when something uneven happens! We use IMF to build the input using tags. Sometimes they won't even care to know the right tag to fit in the params, but would still mark it as a bug whatsoever!
-
Best:
- I built a good automation mechanism with a decent UI [slackbot]
- used as few frameworks and ext libs as I could. Mostly based on bare java
- client wanted to migrate it to Spring
- got 3 peeps assigned for the migration
- 2 months later their effort failed.
- win: my project has not been molested with Spring
Worst:
- i had an idea to develop smth on top of jmeter, using jmeter as a lib
- I downloaded and imported jmeter's src code
- static contexts, singletons, jmx/rmi everywhere [java is deprecating rmi support]
- not gonna happen... Not gonna build a new project on top of a legacy codebase.5 -
"Oh just promote the fixes already! Don't worry, it won't break other stuff."
Not the worst advice maybe but certainly something that got me doing a lot of rework. I freakin' hate rework.2 -
I propagate to others that the use of singletons is bad, but still use them on rare occasions in code, which only I touch. 😈🐒4
-
Suggestions for a book (if possible german) about php design patterns like mvc, singletons, dependency injections etc.?
If explained good it can also be in another language instead of php. -
Was going through a Java book that jokingly read 'The volatile modifier may also be applied to project managers'.
I do get what volatile does to instance variables. But I didn't really get the joke though. Anybody care to explain?2 -
Oh for fucks sake! Why so we have threading when we synchronize EVERYTHING with a singleton... and when I actually show you that even unthreaded spaghetti code runs 40% faster under real life conditions than your shit you just brush it of because I'm still at university and don't know what I'm talking about... And not because changing it would require money or time we don't have... no, just because I “lack the necessary experience with such things.“
-
I just hate the 'inline injection annotation' way of doing stuff in Angular. Why? Why would you want to make the reader's life so tough? Coz minification? Well, fuck minification! Maybe I'm ranting coz I just started learning, ok, whatever!
-
Here's a fun fact (which actually will be accompanied with a source) about node.js. When you import or require a module it will be imported as a singleton. Or put another way, ```export const Foo = { };``` is one of the simplest* and most readable singletons you can have in that runtime. And of course here's the thing you always should be asking for when people make a claim like this https://nodejs.org/api/...
So why write this? Well some of you might feel inclined to write a medium (or other) post about "design patterns in Javascript" where you basically just translate the GOF book from Java to Javascript and now you have something that isn't just awkwardly translated Java code! -
Writing unit tests for singletons...
I would just want to refactor it so it’d be easier to unit test, but need to write unit tests in order to be allowed to refactor. Geez...3 -
Pro tip:
Don't make stateful singletons. Just spent an entire fucking morning debugging because one of those fuckers was trying to use prod, and not the demo environment.10 -
Sorta just had a realization but wanted to confirm if that's how it works.
@Bean adds the object to global objects collection?
And @AutoWired in a object returned in like @Bean ClassA classA() { return new ClassA(); }
Gets the instance from these global collections?
In which case Spring is just a way to use global variables/singletons... Isn't that like bad?14