Ranter
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
Comments
-
IntrusionCM14751322d
-
devRancid648322d> But that would lead to redundancy... Oh no
Ironically all the noobs who blindly apply the "clean code" and "dry" patterns everywhere have the worst and least maintainable/debuggable code
A bit of redundancy that simplifies it is 100x better
Seen someone refactor a 2-liner into a fucking 30 line monstrosity with enums and hash maps and loops etc just to avoid duplication and to make it "extendable" in the future (for cases that will never happen) -
awesomeest1209227dThis reminds me of about 2yrs ago when i, unfortunately, had to start using python (i know it from a long time ago, just dont use it unless there's a reeeeally good reason). I tried using VS code (im a dinosaur that prefers notepad, sublime text minus any auto*, or notepad++) so downloaded the interpreter.
Trying to catch up a bit with whatever current shenanigans were afoot, i googled a bit to see what was popular now. One of the most commonly downloaded 'packages' was python-is-python3. I wondered wtf that was so looked it up...
It was literally a small text file that aliased the "python3" command that was implemented to differentiate from previous ver to "python".
I kept looking for wtf i was missing... nope, people that call themselves devs were literally typing more chars to download and 'install' (for lack of a better term) a single cli alias than it'd take to write the basic af 'package'.
Im still shocked by this and how many 'devs' dont realise you can edit mods/libs. -
devJs1323226d@devRancid wait what? Is it really possible to be worse than JS ecosystem?
I know that there was some beef between python2 vs python3 and that they diverged at some point.
I did wrote some web file scraping scripts in python3, it was easy thing to do. -
awesomeest1209226d@devJs at least js is big enough to have several options for most things (still a double-edged blade).
-
devJs1323225d@awesomeest until you have to make widget with no co-dependencies that bundles in a single file.
It was pain in the ass to find charting library that wasn't built on d3 or that packs its dependencies with it, not just referencing it.
But yeah, There's-another-js-library-out-this-week™ approach kinda gives a lot of options for the same thing. -
awesomeest1209225d@devJs well that's because, like most scripted languages it wasn't intended to be used that way. Use java or one of the Cs.
-
devJs1323225d@awesomeest I get you and I agree with you on tech choices. Especially for OS widgets.
But, this was it, you know, 'one in a lifetime million dollars idea'. I was just dev in the agency that client hired to work on this 'incredible opportunity'.
Idea was to inject js-widget on the website, like an ad that is actually an app with API request (with actual product data from the page).
Response is comparing the product you currently look at in some webshop with clients products with the opportunity to see the big mountain of money that you will save if you buy the product that this widget is pitching instead of the one you are looking at.
Easy project, shitty idea with even shittier ux that shows you the savings graph which was the biggest part of the widget size-wise.
I don't even get how is that piece of shit profitable and why would I as the webshop owner put this kind of crap on my site in the first place.
Subscribe for more shitty projects I did for agencies, awesome stories! XD -
awesomeest1209225d@devJs
I see...
Personally, I rarely work with typical widgets. It's not that it's out of my expertise to do something like that. Just reading your comment I thought of a few sure ways to accomplish those params (not like 'i probably could do X if i look it up or use some framework... like down to the file structure, dbs, call methods etc... my brain thinks about everything that way, im autistic af and have been programming since 6 or 7(depending on if you count cli scripting and regedits)).
ChatGPT calls me legacy and my code "complex" or "advanced" (thats just from when i tried to have it comment shit since idfk what to comment or where).
If i needed to make that thing id likely end up just writing it as individual elements stacked on top of eachother and called by a function that passes a key for verification of the instance while requiring the wrapper-like code to verify params of the pseudo-widget and vice versa. Ofc itd be easier to set a custom api or even webhook to do it -
awesomeest1209225d@devJs
Simply put, i have nearly a literal 0 idea what's standard, common practice or even if others would comprehend my methods... i just know how to engineer stuff that works and suits necessary, logical, params.
Fyi, my engineering ability isn't just code/*ware. Ive tutored multiple people through both electrical and mechanical engineering degrees (it might be genetic, my grandpa, who i have a mixed opinion of, created/patented hundreds of things in mech/electrical engineering).
For example, i needed a wall in my 2-door 2-car garage. I needed/wanted it built immediately, am physically handicapped (incl a highly dysfunctional left arm), wanted it to appear unmovable yet didnt want to permanently alter structure in case i ever sell. No clue what the 'right' way is, i just know a lot of physics and housing code. I made 2 partitions, each with 3 hinged segments of 3ft 8in wide x ~8ft (to exact joists), 2x4 frames and wall panels secured to 2 dollies, connected via 2 giant cable ties -
devJs1323225d@awesomeest tbh i don't understand everything about everything you just said, but weird enough I kinda get it.
And I just wanted to say that in the end if the product does the job it itends to do, that's it.
Lets create a library.
Lets use that library in a project.
Lets wrap the library call in a wrapper functione to remove duplicate code.
Lets add an overloaded wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
Lets add another overloaded wrapper call that wraps the wrapper call that wraps the wrapper call that calls the library to partially undo the duplicate code removal.
How I love it. Not.
Sometimes redundancy makes sense, especially when it are two lines which make it obvious whats going on vs a single line that leads to a fuckton of overloaded wrapper functions.
Sheeesh.
Today in "code monkeys deserve divine punishment".
Another funny thing is creating a Helper class for Junit 5 tests, making it instantiable and adding to it all kinds of shit like testcontainer creation, applications instantiation, mocks, ....
... Then " crying " why the tests are so slow.
Yeah. Logic. Isolation of concerns, each test should be a stand alone complex.
But that would lead to redundancy... Oh no.
Better to create a global state god object.
Some devs... Really amaze me, especially when they argument in ways that makes one really wonder whether they are serious or just brain dead.
rant