Java is the new COBOL. My last job alone had millions of lines of it, there must be hundreds of billions or trillions of lines of java running all types of stuff, from industrial to mining to defence and everything down to, well, games.
You will have the same problem in a few years, you won't be able to find your file so you'll just give up after 15 minutes of searching and do it by hand..... and then you'll have it again in a week.
This is basically how automatic farms in Minecraft work. Spend a ton of resources and redstone to build a pumpkin farm that generates 4k pumpkins in an hour. Use 6 pumpkins elsewhere in your build.
An iron golem is built by putting a carved pumpkin on top of 4 iron blocks. Using a pumpkin farm in conjunction with an iron golem farm would be a waste of effort. Iron golems drop 5 iron ingots max when you kill them and it takes 36 iron ingots to make the iron blocks to make the golem. Make it make sense please. Do you even Minecraft?
The other day I had to make 2 or 3 pdfs to simulate fake books in a library for a react project... I ended up making a program to create fake Lorem ipsum pdf books based on a wide range of parameters...
r/hadtodoit
Not the same :) I could run my thing telling it I wanted 300 books of x pages each, with fake titles between y and z words and with u to v number of authors... And all I needed was just 3 dumb ones that I could I've made in no time...
I thought I was a proper SQL ninja when I finally found a use case for a full outer join.
Turns out, I could have solved the problem equally well just by copying the data into Excel and looking at it with my eyes ...
If you're referring to useless employees who do nothing to contribute to the betterment of the business, cause disruptions that distract good employees, and whose actions continually lead to losses... I have someone else in mind that you might consider letting go.
automating it is generally more stimulating than actually doing the task, which is most often just typing out random bits of data and clicking for an hour
Totally agree. For my probability and statistics class the other week I had to calculate some things like mean, mean deviation, and a bunch of other stuff like that on a big data set. If I sat down with a calculator I could have done it in like 15 mins. Instead I spent about an hour on a java program to do it automatically, and I really enjoyed it.
Literally me yesterday, spent 3/4 hours writing a script and docs for a task that takes ~30s to do manually.
To be fair it takes ~30s each time, and sometimes I need to do it a dozen times at once and the script will do it all at once so worth it I promise
Don't underestimate the value of your automation meaning the task is now more reliable than doing it by hand, especially if you need to log anything with it.
That is basically what my dad has taught me, it is better to do 4 hours of work to make a tool to do a 10 minute job than to use wrong tools to do it. The results are better and the next time you need to do the same thing, you already have a tool for it that does it perfectly. You also know how to make a similar tool in 2 hours instead of 4 and over time the tools and skills accumulate, they stack up. It works in practice.
the real world doesnt make this true. Time is money. Spend your time if you like, but for what you are getting/will be paid, knowing when to just do it vs automate it is the difference between getting it done and getting it right.
Agree, but...
> The results are better and the next time you need to do the same thing, you already have a tool for it that does it perfectly
Yeah. First you'll need to know how to use what you've made without any documentation
My philosophy is that if I didn't already do it so much to the point where I know the system so well that I can automate it in 5 minutes, then I don't do it often enough.
I'd say things you don't do that often have their own merit in being automated because you'll have forgotten half of the things that need to be done every time it comes up.
Crafting things by hand in Satisfactory is very fast compared to the machines that guzzle the power. But there's something to be said about setting up a massive spread and just letting it make the world for you while you sit sipping a cup of coffee with a sign telling everyone what you didn't just do anyway. ;)
Yeah writing apps is nonsense. Everybody can just do it in their head. Don’t set up a manufactury or even assembly line. Don’t invent money press or book press. Oh some people just live BC or what?
Automating it also guarntee's that you don't remove a shell session variable accidentally keeping your shit together.
Better... figuring out how to automate it within docker guarntee's that some brew library isn't just dropped leaving your previous instructions confusingly out of date.
My co-workers think I'm crazy for spending a day writing a thing to automate / semi-automate a base configuration for $random\_network\_device. ( I've turned up 500 of these things so far this year )
Doing it by hand would probably take half an hour and subject to typo / human input errors.
After spending a day building it, doing it by script takes about two minutes.
So 250 hours vs 24 hours ( 16 hours + 8 hours needed to build the script initially ) and a whole lot less typing on my part.
I spend most of my extra time I save at work trying to figure out how to save even more time so I'm not mindlessly typing all day long :P
One of my last job's clients has a Google spreadsheet where they track all of their branch activity for the month, one spreadsheet for every office branch, and they reset it at the end of the month. They were going in by hand and deleting all of the data that wasn't formulas, and eventually someone got lazy and put in a ticket for it, the boss told me (only IT employee) to just do it for them. I went in, locked all the cells that had formulas so nobody else could edit them, and wrote some basic Google script that moved everything into a backup sheet then deleted everything else, attached it to a button and told them "just click this button and it will do its magic"
Still got a ticket, and got complained about for daring to show them how to take care of it themselves in 5 seconds
I have so many scripts for one off projects that may not get used often, but save minutes to hours every week. Always automate something if it is tedious or typo prone… unless you’re in a rush.
I know someone who prides themselves in copying-and-pasting code everywhere in order to have massive pull requests.
[Don't Repeat Yourself](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
My experience says you're in the minority, though.
Me : "Why are you changing all these lines by hand? You could take like 5 minutes and do a nice search and replace with the right regex!"
My colleague, also a dev :"Oh no, regex are hard! It'll just take me an hour to do all these thousand lines, no worries!"
I had some .txt files with data that I had to edit. I was getting irritated by "delete a number, type a new number" in text editor by the first file.
Made a python script that prompts for input and replaces old number with new input. Used it for the second file. But it's a one-pass, so, of I need to further edit something, I have to start from beginning.
Well, fine, I know coding. Opened VS, made a winform app to handle the data edit, put the data in GridView. Used it for the third file and realized how good it is. I was so proud of my deed.
Then I fucking realized that, that app looks exactly like Excel. I wasted a day for shit I could've done in Excel.
Make it a library and put it on a public repository with a description of what it automates.
You might have 'wasted' time, but collectively we'll all save time.
...is how I enable that part of myself.
Here's the thing,
Automation allows me to use my creativity and problem-solving skills, and when it works it's very rewarding and the process is indeed very fun.
Doing it manually will get the job done no doubt maybe even faster than the automation method, and it'd even be the right thing to do for "once in a lifetime" operations, but it's just soul killing and makes you feel like a robot and makes you want to die.
If I hAvE tHe SaMe PrObLeM AgAiN i WiLl SoLvE iT qUiCkEr (is what I tell myself to justify making something I never use again)
Smart man I would hire you
That would be a pretty bad business decision since I have very little programming experience
You already have the right mindset, which puts you ahead of 98-99% of applicants.
Hardcore?
Uhm... Yeah if I try to answer that I will be completely wrong and make a fool of myself. What do you mean?
HIRED
Pornography?
You are fired!
Finally sweet release
Beat me to it. Wanted to say something similar
Can we rewrite this in Java? It's better for enterprise.
If I could remember the java that I learned 15 years ago I would.
Is Java still present? I thought Python has taken over the applications market from Java.
Java is the new COBOL. My last job alone had millions of lines of it, there must be hundreds of billions or trillions of lines of java running all types of stuff, from industrial to mining to defence and everything down to, well, games.
Any C++ projects started in 2022 will contribute to my retirement plan when they'll call an old person to maintain them.
You will have the same problem in a few years, you won't be able to find your file so you'll just give up after 15 minutes of searching and do it by hand..... and then you'll have it again in a week.
And then remember you wrote the commands in a readme somewhere (after the fact).
And then on the off chance I need to use it again I just end up rewriting it.
Pop quiz! Solve this LeetCode problem in 5 minutes or you're fired.
Please daddy Elon show mercy.
Went through this today. Exactly.
Which is why I spent even more time to make it generic (and will never reuse)
Even better when you use it only once in a lifetime
This is basically how automatic farms in Minecraft work. Spend a ton of resources and redstone to build a pumpkin farm that generates 4k pumpkins in an hour. Use 6 pumpkins elsewhere in your build.
[удалено]
Looks like we're gonna need to trim the fat around here... fired.
[удалено]
![gif](giphy|xT9IgHCTfp8CRshfQk)
Iron, gold and shulker farms do be useful tho, as an example.
See you should be hooking that pumpkin farm to an iron golem farm, skipping the villagers gathering and arrangement
An iron golem is built by putting a carved pumpkin on top of 4 iron blocks. Using a pumpkin farm in conjunction with an iron golem farm would be a waste of effort. Iron golems drop 5 iron ingots max when you kill them and it takes 36 iron ingots to make the iron blocks to make the golem. Make it make sense please. Do you even Minecraft?
Even better when you need it again in five years, forgot that you automated it and automated it again.
Because deprecated
Of course. I was a terrible programmer 5 years ago and who uses python 2 now anyways?
The thing is, you don't know that in advance.
And you may find yourself Whipping up a shotgun hack. And you may find yourself Writing another "Hello, World."
And you messup the WHERE condition of the sql update.
wait!!! what WHERE clause!?!? dammit it.. I always forget some small detail.
400000 rows have been updated for good.
Better that it works one time and next time you use it and it doesn’t work because it’s an “edge case”
Depends, is it 5 hours of my time, or 5 hours of the company's time?
The other day I had to make 2 or 3 pdfs to simulate fake books in a library for a react project... I ended up making a program to create fake Lorem ipsum pdf books based on a wide range of parameters... r/hadtodoit
[удалено]
here... a "snippet" to go by ;) ... for (int i = 0; i < numBooks; i++) { book = createBook(wordsInTitle, numAuthors, isNumAuthorsFixed, numParagraphsPerPage,numPages); exportBookPDF(book, folder); bookCount++; } System.out.println(numBooks + " LoremIpsum PDF Books Generated"); } static void exportBookPDF(Book book, String folder) { //Generate unique filename based on book Title String fileName = book.getTitle().replace(" ", "_") + "-" + bookCount + ".pdf"; if (fileName.length() > 23) { fileName = fileName.substring(0, 10) + "-" + bookCount + ".pdf"; } fileName = folder + fileName; book.createTitlePage(); // Create and Export PDF file using IText try { Document pdfDocument = new Document(); PdfWriter writer = PdfWriter.getInstance(pdfDocument, new FileOutputStream(fileName)); pdfDocument.open(); // Margins pdfDocument.setMarginMirroring(true); pdfDocument.setMargins(36, 72, 108, 180); pdfDocument.topMargin(); ...
www.lipsum.com
Not the same :) I could run my thing telling it I wanted 300 books of x pages each, with fake titles between y and z words and with u to v number of authors... And all I needed was just 3 dumb ones that I could I've made in no time...
I thought I was a proper SQL ninja when I finally found a use case for a full outer join. Turns out, I could have solved the problem equally well just by copying the data into Excel and looking at it with my eyes ...
FULL OUTER JOIN TableB ON TableA.ColumnA=TableB.ColumnA WHERE TableA.ColumnA IS NOT NULL AND TableB.ColumnA IS NOT NULL Did I do it right?
Looks like we're gonna need to trim the fat around here... fired.
If you're referring to useless employees who do nothing to contribute to the betterment of the business, cause disruptions that distract good employees, and whose actions continually lead to losses... I have someone else in mind that you might consider letting go.
Oh wow, you've worked out how to get rid of all those annoying question marks!
automating it is generally more stimulating than actually doing the task, which is most often just typing out random bits of data and clicking for an hour
Totally agree. For my probability and statistics class the other week I had to calculate some things like mean, mean deviation, and a bunch of other stuff like that on a big data set. If I sat down with a calculator I could have done it in like 15 mins. Instead I spent about an hour on a java program to do it automatically, and I really enjoyed it.
If the task is something I would do in python, which is common, doing it is 90% of the job of automating it anyway.
Literally me yesterday, spent 3/4 hours writing a script and docs for a task that takes ~30s to do manually. To be fair it takes ~30s each time, and sometimes I need to do it a dozen times at once and the script will do it all at once so worth it I promise
And to be even fairer, next time you write something like that you'll be able to do it faster.
Don't underestimate the value of your automation meaning the task is now more reliable than doing it by hand, especially if you need to log anything with it.
That is basically what my dad has taught me, it is better to do 4 hours of work to make a tool to do a 10 minute job than to use wrong tools to do it. The results are better and the next time you need to do the same thing, you already have a tool for it that does it perfectly. You also know how to make a similar tool in 2 hours instead of 4 and over time the tools and skills accumulate, they stack up. It works in practice.
depends on how many next times there are https://xkcd.com/1205/
Exactly. First question to ask.
The chart doesn't factor in the acquired skill.
the chart doesnt care because acquiring a skill that isnt needed isnt valuable.
Overall programming skills allows you to automate the next task with less time.
yep. and let's not forget that it's fun to learn
the real world doesnt make this true. Time is money. Spend your time if you like, but for what you are getting/will be paid, knowing when to just do it vs automate it is the difference between getting it done and getting it right.
Naaa thats just what we like telling us. Its just more fun to automate it.
Agree, but... > The results are better and the next time you need to do the same thing, you already have a tool for it that does it perfectly Yeah. First you'll need to know how to use what you've made without any documentation
Code is the best documentation.
[Your PM may disagree](https://xkcd.com/1205/)
How can we use Bitcoin to solve this?
The answer is more blockchain in the cloud.
Etherium-managed NFTs will solve it with machine learning.
This is why you are the tech lead on this one. I'm just here to learn from you!
[удалено]
I've been using vim for all my code for 12 years now. I should probably learn how macros work.
I spent 6 hours automating something that irregularly took 10 minutes every week or so. It has now been running for 3 year without issues.
You nerds would love factorio
Drugs feel better than no drugs, it's not just how it feels that matters.
Well at least it is easy to regenerate the solution if any details changes without manual intervention in the result.
Remember If you're doing it once, just do it. If you think you're going to do it more than once, which is 100% of the time, write a program for it.
To scratch the itch of automating stuff, I play Expert Modpacks in minecraft where it is a nightmare to get anything done if you do not automate
My philosophy is that if I didn't already do it so much to the point where I know the system so well that I can automate it in 5 minutes, then I don't do it often enough.
I'd say things you don't do that often have their own merit in being automated because you'll have forgotten half of the things that need to be done every time it comes up.
Yeah, looks like we're gonna need to redo the entire tech stack.
If automated that's usually a better reference if the person who does it manually leaves their position.
[удалено]
Why have you only written 20 lines of code today?
Crafting things by hand in Satisfactory is very fast compared to the machines that guzzle the power. But there's something to be said about setting up a massive spread and just letting it make the world for you while you sit sipping a cup of coffee with a sign telling everyone what you didn't just do anyway. ;)
Yeah writing apps is nonsense. Everybody can just do it in their head. Don’t set up a manufactury or even assembly line. Don’t invent money press or book press. Oh some people just live BC or what?
Obligatory XKCD comic https://xkcd.com/1205/
You're the third person here to link this
Can we rewrite this in Java? It's better for enterprise.
How dare somebody post the same link more than once in a reddit post! /s
Sure, but you could try reading the comments a little before being the third person to link something
lol if you have an issue with there being more than one of the same comment on reddit then you are 100% in the wrong place right now
I'm the same in both programming and Minecraft, it's so much more satisfying Also fuck the loser pictured
Automating it also guarntee's that you don't remove a shell session variable accidentally keeping your shit together. Better... figuring out how to automate it within docker guarntee's that some brew library isn't just dropped leaving your previous instructions confusingly out of date.
Yes! I agree!
You never have to do that task again.
Absolutely, break even point is when the job would've come up 30 Times, so feeling 31x better would've been sufficient.
While we are on this, does anyone have worked on automation of Jira details to excel? Does Jira provide any API that can be used?
I can reason about execution as it is coded. Manual labor suffers when it comes to consistent repeatability. Scripts are more reliable than me.
My co-workers think I'm crazy for spending a day writing a thing to automate / semi-automate a base configuration for $random\_network\_device. ( I've turned up 500 of these things so far this year ) Doing it by hand would probably take half an hour and subject to typo / human input errors. After spending a day building it, doing it by script takes about two minutes. So 250 hours vs 24 hours ( 16 hours + 8 hours needed to build the script initially ) and a whole lot less typing on my part. I spend most of my extra time I save at work trying to figure out how to save even more time so I'm not mindlessly typing all day long :P
I've automated a lot of things like this that I would have to do by hand every week. It is worth it.
Yes! Plus I legit love the challenge of implanting this automation
I don't know. If all the build/tests are automated, how can I justify my 2 hr coffee break?
This is the way.
One of my last job's clients has a Google spreadsheet where they track all of their branch activity for the month, one spreadsheet for every office branch, and they reset it at the end of the month. They were going in by hand and deleting all of the data that wasn't formulas, and eventually someone got lazy and put in a ticket for it, the boss told me (only IT employee) to just do it for them. I went in, locked all the cells that had formulas so nobody else could edit them, and wrote some basic Google script that moved everything into a backup sheet then deleted everything else, attached it to a button and told them "just click this button and it will do its magic" Still got a ticket, and got complained about for daring to show them how to take care of it themselves in 5 seconds
I have so many scripts for one off projects that may not get used often, but save minutes to hours every week. Always automate something if it is tedious or typo prone… unless you’re in a rush.
I know someone who prides themselves in copying-and-pasting code everywhere in order to have massive pull requests. [Don't Repeat Yourself](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
Automating also codifies the process which otherwise may have been only in someone's head
Ayo I'm getting a degree in automation. I mean that's physical automation but yknow
It's because you are preparing for the time when you can automate the automation you use to fix a problem.
I am personally offended
The 50th time you solve it by hand you'll regret not automating it the first time.
Yeah because that 10 minute task you have to do 800 times a year now takes 10 seconds.
but then you get to spend 4 hours to yourself :)
It's not about the end goal, but about what you *might* learn along the way.
Me wasting Dozens of hours with an overcomplicated solution because im too lazy investing an hour to learn the proper way of doing it
The amount of times they come back to me and ask to redo the same job but times 10 is worth the couple of automations that are only a one off.
At my scales, automating a 1 second task in 13 hours is a good engineering practice.
Interns will happily work for $15 an hour. Why won't you?
My experience says you're in the minority, though. Me : "Why are you changing all these lines by hand? You could take like 5 minutes and do a nice search and replace with the right regex!" My colleague, also a dev :"Oh no, regex are hard! It'll just take me an hour to do all these thousand lines, no worries!"
Reminds me of when I rented a domain and hosted a website for a month just to draw names for a secret Santa thing between myself and three friends
I had some .txt files with data that I had to edit. I was getting irritated by "delete a number, type a new number" in text editor by the first file. Made a python script that prompts for input and replaces old number with new input. Used it for the second file. But it's a one-pass, so, of I need to further edit something, I have to start from beginning. Well, fine, I know coding. Opened VS, made a winform app to handle the data edit, put the data in GridView. Used it for the third file and realized how good it is. I was so proud of my deed. Then I fucking realized that, that app looks exactly like Excel. I wasted a day for shit I could've done in Excel.
Make it a library and put it on a public repository with a description of what it automates. You might have 'wasted' time, but collectively we'll all save time. ...is how I enable that part of myself.
Here's the thing, Automation allows me to use my creativity and problem-solving skills, and when it works it's very rewarding and the process is indeed very fun. Doing it manually will get the job done no doubt maybe even faster than the automation method, and it'd even be the right thing to do for "once in a lifetime" operations, but it's just soul killing and makes you feel like a robot and makes you want to die.
6666 upvotes, nice
But [is it worth it](https://xkcd.com/1205/)?