Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "submodules"
i had an epiphany today, in a discussion with the software architect of our new project.
i'm having the epic job to design & implement a prototype for a C++ library in a new software project and collected some inspiration in our "old" software, where i'm maintaining the module that fulfills the same functionality (i thought). i've been maintaining this module for around a year now. i analyzed the different features and stuff to consider and created a partial model of the new library.
when i showed it to the architect today, he was like "oh my god, no no no, you don't need all this functionality, this shall not be part of the new library!"
this was the moment when i realized how deeply fucked up the code base of the old module is.
imagine it like this:
you want to automate the process of making yourself a good ol' cup of coffee.
the reasonable thing would be to have
- a smart water boiler where you set parameters water temperature and amount of water to be fetched from the water supply
- a smart coffee bean grinder where you can set type of beans, amount of beans and grinding fineness
- a component where water and ground coffee are joined to brew the coffee, where parameters like duration, pressure etc. are set
- a milk tank where amount of milk, desired temperature and duration / speed of foaming can be set
- a sugar dispenser where amount of applied sugar can be set
- optionally, additional modules with spices, syrup, ice cubes, whatever for your very personal coffee experience
on requesting a coffee, you would then configure and orchestrate all components to your wishes to make you a fine cup of coffee. you can also add routines like "makeCappucchino()", "makeEspresso()", or whatever.
our software is not like this.
it is like this:
- a smart water boiler consisting of submodules that know how to cook water for e.g. "cappucchino with sugar" or for "espresso without sugar, but with milk and ice cubes"
- 5 smart bean grinders that know how to grind beans for e.g. cappucchino, espresso, latte macchiato and for 73ml of water preheated to 82°C
- a very smart sugar dispenser that knows how to add sugar to 95, 98 and 100°C coffee and to coffee made of BOTH coffee arabica AND coffee robusta beans.
etc. etc., i think you're getting the gist.
when i realized this, it was like, right in front of my eyes, this terrible pattern emerged like a foul, corrupted caleidoscope of chaos, through the whole code base of this module.
i've already known how rotten from the core this code base is, but today i've actually identified a really bad pattern that i hadn't realized before. the whole architecture is so bloated that it is hard to have an overview of the whole thing. and it would require a LOT of refactoring to repair this pattern.
but i guess it would also be infinitely satisfying because i could probably reduce the code base for 30% or something...
but unfortunately, this is never going to happen, because screw refactoring.
it's a great feeling to start this new library from scratch, tho...6
That might seem a bit random, but I started off this year with a nightmare (a literal dream) where I've fallen victim to remote code execution, because I cloned someone's git repo.
Is such a thing even possible? The closest thing I've found was this blog
(and the info on it was already worrying enough), but that shouldn't have affected my dream computer.
Some details I more or less remember:
* The execution happened right after git clone
* The uri to the repo was a custom domain (no github, gitlab or anything)
* no submodules
Every time I have a large code base...
When you manage updating numerous 3rd party libraries by hand, git submodules sound like the greatest thing ever.
Replace all 3rd party sources with git submodules.
Realize how much of a pain in the ass they are and managing them yourself seems totally worth it again.
Replace submodules with folders of the 3rd party libraries.