Three years ago I wrote a php code to sum the total number of bought items and by mistake I forgot to add userid column so whenever someone added items it got save in the database but do not show in the user order section. I lost almost INR 30,000 of sales that week.
This is a good question. I sometimes ponder how those who write military software such as surface to air missile guidance may feel. When they started Computing Science did they have any idea they'd land up writing such code??
it is something i have thought about occasionally. i don’t have a fully formed opinion, so am open to others challenging my logic here…
i have come to accept that a strong military power can serve as a deterrent to others, and ultimately lead to a more peaceful existence (in the aggregate). i don’t believe that human beings can co-exist peacefully, so this deterrent is necessary (until we have some other means to achieve peace).
i would use a similar thought process to morally justify work on a general AI. given enough time i believe that humanity will destroy ourselves and this planet. in lieu of another solution, we may need an AI to assert control to prevent this from happening (or backfire and bring us fully into a hollywood dystopian future).
at the risk of going on a rant now, i have often found it hard to morally justify working on space travel, as i don’t believe that humanity has demonstrated that it deserves to colonize beyond Earth. that would only enable us to consume and destroy more of the universe.
Why doesn't the universe have the right to "destroy" itself through its most sophisticated subset of matter-energy known to date?
I put "destroy" in quotes since I think that's ridiculously loaded. The biosphere itself is naturally unsustainable at its current complexity for more than 1 billion years from now[0], the Sun is going to go red giant past the next 5 billion years, and, as far as we know, the universe will end in heat death. Entropy and transformation is inevitable. Humans contribute to that, but doing it in the service of higher cognitive functions by which the universe can know itself should be the noblest reason for it to happen (from a human perspective), no?
Another counterpoint: what if humanity only becomes worthy of spreading itself in civilizations that can only form post-Earth (too far into the future to still be living on Earth)? Should those be condemned to non-existence because humanity's original nucleus didn't bootstrap itself impressively enough to earn a chance at outliving its planet?
Pretty much all of it. For the first few years of my programming career I would review weeks or months old code in horror. What barbarian had written this useless, convoluted gibberish? Then, the code I would go on to write that very day would be reviewed by a future me, who was again horrified by the sheer idiocy of what I had written.
Eventually I just gave up. Look, I'm a game programmer. I code because it makes pretty colors move on my screen. I favor the fast over the correct, and I only do things "right" when my inner self remembers the pain of doing it wrong before; so I stick to simple behaviors separated, rip things out immediately if they start to be a headache, build one-off behaviors that aren't scalable, because damnit I don't have time to think about how to build this correctly. I want it to work so that I can use it and move on.
I started my path as an aspiring architect who would write pure, scalable, performant and dare I say beautiful code. My programs would hum like a fugue by Bach and my comments would hang off the page like sweet blackberry bunches, easy to pluck and digest. My hopes were so high for myself!
But today I burn a path to my goal without consideration to the debt or damage it deals, my heart without morals and my mind without regret. Each day I stray further from god. Yesterday I had to rip out a utility function that took an entity and type as its input and searched the hierarchy for a parent of that entity with that type to return it, so that I could message root level objects on collisions with their child objects. What a disgusting beast I had created! What have I become! But I soldier on, unhindered by my evils. I cast code beneath my feet and it crumbles instantly as I take each step closer to hell.
I somewhat regret spending my time at companies that were ultimately shutdown or acquired and my code being unceremoniously thrown out, but that isn't really about the code but rather lifestyle/career choice of working for startups.
I don't think from a creative or learning perspective I regret any of the actual coding. Sure some of it wasn't great code but that was generally a product of circumstances, generally the value I personally derived from the code was solid.
I did made an explicit career choice early on not to go into aviation/avionics because of it's dual-use. Originally being very interested in UAVs before they were cool I did built my own both fixed wing and quad-copter. After spending some time thinking about how my code would inevitably be used if I joined Boeing, Raytheon or Thales though I decided maybe something else would be better.
On my first day at my current company several years ago I was told to refactor something that was very poorly designed and written by the tech lead who had written it. The code was impossible to work with and it took months to add the features they wanted, both because the PR process demanded small deployable PRs and because I had to avoid breaking the thing while working on it. Because I was new and because the tech lead I was working under had written the terrible code I was working on, I didn’t immediately say ‘This code is awful and the entire thing needs to be rewritten, both backend and front end.’ Instead I attempted to introduce right patterns to the data shape, etc. Suffice it to say the code was even worse and less maintainable at the end, only now I was taking the blame for it being that way because now my name was all over the git history.
It was eventually rewritten anyway by another team. Suffice it to say, DO NOT touch code if it is designed in such a way as to be impossible to change. Throw it back up the chain and say , This needs to be rewritten, now. The consequences will be worse for you if you try to work around other people’s bad architecture as you will eventually be blamed for both the original mess and whatever you did to work around it given whatever condtraints on process you have.
Years later. I am fixing another massive architecture mistake by the same engineer, who has since been promoted to higher levels. Over a year in, another data design mistake at a fundamental level that makes the system impossible to change without a huge refactor.
Sigh.
Throw people under the bus if necessary. Don’t accept ownership of code that sucks.
In my experience bad code isn’t written for the sake of being bad. A lot of companies don’t value IT and software they work with almost daily as much as they should. The idea is that if they click a button and it works, it works. Next project. Not enough time, pressure from everywhere to develop new features and behaviours and there you go, badly written code.
15 comments
[ 3.1 ms ] story [ 50.4 ms ] threadi have come to accept that a strong military power can serve as a deterrent to others, and ultimately lead to a more peaceful existence (in the aggregate). i don’t believe that human beings can co-exist peacefully, so this deterrent is necessary (until we have some other means to achieve peace).
i would use a similar thought process to morally justify work on a general AI. given enough time i believe that humanity will destroy ourselves and this planet. in lieu of another solution, we may need an AI to assert control to prevent this from happening (or backfire and bring us fully into a hollywood dystopian future).
at the risk of going on a rant now, i have often found it hard to morally justify working on space travel, as i don’t believe that humanity has demonstrated that it deserves to colonize beyond Earth. that would only enable us to consume and destroy more of the universe.
I put "destroy" in quotes since I think that's ridiculously loaded. The biosphere itself is naturally unsustainable at its current complexity for more than 1 billion years from now[0], the Sun is going to go red giant past the next 5 billion years, and, as far as we know, the universe will end in heat death. Entropy and transformation is inevitable. Humans contribute to that, but doing it in the service of higher cognitive functions by which the universe can know itself should be the noblest reason for it to happen (from a human perspective), no?
Another counterpoint: what if humanity only becomes worthy of spreading itself in civilizations that can only form post-Earth (too far into the future to still be living on Earth)? Should those be condemned to non-existence because humanity's original nucleus didn't bootstrap itself impressively enough to earn a chance at outliving its planet?
0: See https://en.wikipedia.org/wiki/Timeline_of_the_far_future and Ctrl+f "c4 photosynthesis"
Eventually I just gave up. Look, I'm a game programmer. I code because it makes pretty colors move on my screen. I favor the fast over the correct, and I only do things "right" when my inner self remembers the pain of doing it wrong before; so I stick to simple behaviors separated, rip things out immediately if they start to be a headache, build one-off behaviors that aren't scalable, because damnit I don't have time to think about how to build this correctly. I want it to work so that I can use it and move on.
I started my path as an aspiring architect who would write pure, scalable, performant and dare I say beautiful code. My programs would hum like a fugue by Bach and my comments would hang off the page like sweet blackberry bunches, easy to pluck and digest. My hopes were so high for myself!
But today I burn a path to my goal without consideration to the debt or damage it deals, my heart without morals and my mind without regret. Each day I stray further from god. Yesterday I had to rip out a utility function that took an entity and type as its input and searched the hierarchy for a parent of that entity with that type to return it, so that I could message root level objects on collisions with their child objects. What a disgusting beast I had created! What have I become! But I soldier on, unhindered by my evils. I cast code beneath my feet and it crumbles instantly as I take each step closer to hell.
But my game is really fun to play! :D
I somewhat regret spending my time at companies that were ultimately shutdown or acquired and my code being unceremoniously thrown out, but that isn't really about the code but rather lifestyle/career choice of working for startups.
I don't think from a creative or learning perspective I regret any of the actual coding. Sure some of it wasn't great code but that was generally a product of circumstances, generally the value I personally derived from the code was solid.
I did made an explicit career choice early on not to go into aviation/avionics because of it's dual-use. Originally being very interested in UAVs before they were cool I did built my own both fixed wing and quad-copter. After spending some time thinking about how my code would inevitably be used if I joined Boeing, Raytheon or Thales though I decided maybe something else would be better.
Throw people under the bus if necessary. Don’t accept ownership of code that sucks.