r/AskProgramming • • Dec 19 '25

Career/Edu Refactoring conditional heavy logic

133 Upvotes

I’m dealing with a piece of code that’s grown a lot of conditional logic over time. It works, it’s covered by tests but the control flow is hard to explain because there are multiple branches handling slightly different cases. I can refactor it into something much cleaner by restructuring the conditions and collapsing some branches but that also means touching logic that’s been stable for a while. Functionally it should be equivalent but the risk is in subtle behavior changes that aren’t obvious. This came up for me because I had to explain similar logic out loud and realized how hard it is to clearly reason about once it gets real especially in interview style discussions where you’re expected to justify decisions on the spot. From a programming standpoint how do you decide when it’s worth refactoring for clarity versus leaving working but ugly logic alone?


r/AskProgramming • • Oct 07 '20

Careers Does anyone else with a programming job just feel mentally exhausted just working a few hours?

133 Upvotes

Especially when I’m stuck on something, I lose so much motivation and want to quit working and think I should just start delivering for Amazon or something. It’s so hard to get myself to keep going... and idk how to fix this.

I just started working about 6 months ago, and everyday I start off strong but lack so much motivation when I hit a wall. What can I do to keep me more motivated? Anyone else in the same boat as me?

Edit: Just took a bunch of your guy's advice! Took a break, looked through the thread, went out for a run, and then changed my task. Was able to get through the newer task, felt a lot better and more motivated. Thanks for all the advice!


r/AskProgramming • • Mar 19 '26

My original encryption software has been deleted from the internet and now i cant decrypt

131 Upvotes

I have a text file i encrypted with an AES 256 software called EncryptionSafe but had my laptop serviced and wiped so now im just stuck with an encrypted file, i have the key i believe.

how would i go about decrypting it?

EDIT: i fucking love you reddit


r/AskProgramming • • Feb 21 '26

My boss has the goal to not write any code in the company at the end of the year

130 Upvotes

Hi folks

I'm a senior dev with 10 years of experience, 8 in my current company. Today I heard from by boss that the current goal of the company is to not have to write any line of code at the end of the year.

The senior architect in the company is an enthusiast of coderabbit and claudecode and all of my PR's are reviewed by him with those LLM's.

This enthusiasm came when one of my bosses (ex-developer) used claudecode to refactor an old CodeIgniter3 project to Laravel. 2 devs where doing this refactor for some days and it wasn't finished, and then my boss did it with claudecode and took 6h to him, then, the senior architect of my company said that it needs to be adjusted but it seems ok.

We started a year ago with CodeRabbit reviewing our PR's automatically, humans do code, AI reviews it. But now they think it is in the opposite way, AI writes code guided by the developers and then the developers review it.

I'm not an AI hater, I use it to do some things, sometimes to improve my code, sometimes when I need a little refactor... but I try to not rely too much on it to don't make my brain lazy, and I don't trust too much on AI when it comes to architecture.

My PM asked to me that if I think this is a terrible idea I have to prepare some arguments and argue it with my bosses, so I'm here to ask you what you think that I should tell to my bosses.

Right now I have this:

- AI needs a human behind, I'm not afraid of it

- AI sometimes can make mistakes, we obviously need to review its code

- AI is good complementing a senior dev, but for juniors makes them to don't evolve and don't understand their mistakes

- It's not sure if "AI bubble" will explode, it's very cheap for ours right now, but we don't know how it will evolve in the future, making a leap of faith on this seems crazy to me

I'm not entering in the ethic debate of wasting of water and energy, I don't think this will attract them

Any more ideas?

P.S.: I'm not a native english speaker


r/AskProgramming • • Mar 07 '26

My coworker uses lots of AI and I don't know how to feel about it myself

127 Upvotes

He's the sort of guy who actually has opinions about different models, does the whole .md/context thing, and has automated workflows set up for stuff. I'm not judging, I actually find all of that pretty impressive, so I’ll go straight to the point.

We have an upcoming feature for native OS Bluetooth support for our devices, which we’re still doing with proprietary hardware. As the hardware guy, I suggested doing this with a systems programming language and then interfacing directly with Node via the C ABI. But that’s a lot of work.

Enter my coworker. While I was on vacation, he gave it a shot and with heavy LLM usage, he built a prototype using Web Bluetooth and Electron (which we’re already using anyway). It works, so I definitely count that as a success.

I got the task of making the whole thing production-ready asap, and yesterday I looked at the code for the first time. There’s still some work to do. For instance, not all communication was properly async. The example simply fired events to the browser process and then just continued with random wait statements. for repsonses IPC event handlers where added as well and everything in the same blob of code.

I spent the whole day figuring out what is happneing, moving things around, abstracting away the Electron dependency (eww…), and doing a lot of refactoring. In the end, I rewrote most of it with honest old-school manual labor, gave all a bit more structure and reduced the LOC of the original slop to about a third. Yet all I’ve done so far is break the working example by “senior-izing” all over it. Not much practical progress so far.

That got me thinking: who’s the sucker here?

Maybe, just maybe, I could have simply prompted my concerns back into the LLM and “AI-centipeded” another iteration, saving a lot of time. On the other hand, I have my doubts about whether AI can ever produce more than toy versions of the real thing. Programmers who breeze through everything with code generation might end up struggling forever with the last mile. It’s really hard to compare the actual productivity between AI-generated code and just raw-dogging it with honest manual work. Do you guys have an opinion on that?


r/AskProgramming • • Dec 19 '25

Why aren’t AI companies “canceled” for openly saying they want to replace engineers?

127 Upvotes

There’s a concept that has been bothering me for a while, and I’d genuinely like to understand how others see it.

Some AI companies — for example Anthropic, and more broadly AI labs focused on code generation — openly state that their long-term goal is to automate programming to the point where software engineers are no longer needed, or at least dramatically reduced.

What I find strange isn’t just the goal itself, but the social reaction to it.

In most industries, if a company openly said “our goal is to eliminate this entire profession,” there would be significant backlash. Yet in this case, there’s very little pushback — even though the primary users, customers, and contributors to these tools are software engineers themselves.

This creates a weird paradox:

  • AI companies largely exist and improve thanks to engineers using them

  • At the same time, they openly say their end goal is to replace those same engineers

My questions are:

  • Why isn’t there stronger resistance or criticism from the engineering community?

  • Is this just seen as “inevitable technological progress”?

  • Do most engineers believe they’ll simply move to higher-level roles rather than be replaced?

  • Or do people think these companies are overstating their goals for marketing/investment reasons?

I’m not trying to start a witch hunt or say “AI bad.” I use these tools myself. I’m just genuinely curious about the mindset that makes this situation socially acceptable compared to similar statements in other industries.

Would love to hear different perspectives.


r/AskProgramming • • Dec 29 '24

Who are today's Linus Torvaldses

122 Upvotes

I was wondering, people like Linus Torvalds were at the cutting edge of the field and created innovative thingys that everyone uses now like Git and Linux

in the modern day, who are the modern Linus Torvaldses, making todays cutting edge tech stuff?


r/AskProgramming • • Jan 23 '25

Career/Edu Might be the stupidest question here: What do programmers actually do?

121 Upvotes

Last year I decided to slightly tilt my career towards data analysis. Python was part of my studying, accompanied by deeper knowledge of statistics, SQL and other stuff. Last two months I have solely spent on studying Python due to genuine interest. I barely touch other subjects as they seem boring now. I never considered to become a programmer. But now I question if I were one what would it be?

Generally, I understand that software developers create... software, either web, desktop, cloud or else. But I wonder how different real job from exercises? Obviously, you don't get tasks like calculating variations of cash change or creating cellular automata. But is the workflow the same? You get a task with requirements on I/O, performance etc., and are supposed to deliver code?


r/AskProgramming • • Sep 13 '24

Other How often do people actually use AI code?

121 Upvotes

Hey everyone,

I just got off work and was recomended a subreddit called r/ChatGPTCoding and was kind of shocked to see how many people were subbed to it and then how many people were saying they are trying to make all their development 50/50 AI and manual and that seems like insane to me.

Do any seasoned devs actually do this?

I recently have had my job become more development based, building mainly internal applications and business processs applications for the company I work for and this came up and it felt like it was kind of strange, i feel like a lot of people a relying on this as a crutch instead of an aid. The only time i've really even used it in a code context has been to use it as a learning aid or to make a quick psuedo code outline of how I want my code to run before I write the actual code.


r/AskProgramming • • Feb 21 '25

Other Is hiring a programmer to make a niche tool for private use something people do?

119 Upvotes

Disclaimer: this is not a job listing.

I respect programming as a craft, and I wish I had to the time to teach myself but I understand programming about as much as I understand the stock market (2%). I'm probably not the only one who has ever said this, but I could probably put together a laundry list of stupid super specific tools that met my every personal requirement. Is it feasible to hire a programmer to make a program just for me to run locally on a desktop?

As an example, what would a ballpark cost be to have a custom calculator app with GUI made? I know I could search Fiverr or wherever, but someone quoting $5 and another quoting $5000 doesn't mean that's a realistic price range.

Please don't say "just download one of the billion existing calculator apps", as that's not the point.


r/AskProgramming • • May 19 '26

Other Terry A. Davis is really a genius of programing or its just a "meme"?

118 Upvotes

I know, he created a fucking OS and the language HolyC (made It all with schizophrenia) or have a better programer than he? (Like, reach your level, do a OS the and a language alone with problems)

R.I.P King Terry Davis (i know, he passed away a like 8/9 years)


r/AskProgramming • • Aug 03 '25

C/C++ Why python got so popular despite being slow?

117 Upvotes

So i just got a random thought: why python got so much popular despite being slower than the other already popular languages like C when it got launched? As there were more hardware limitations at that time so i guess it made more sense for them to go with the faster lang. I know there are different contexts depending on which lang to go with but I am talking about when it was not established as a mainstream but was in a transition towards that. Or am I wrong? I have a few speculations:

  1. Python got famous because it was simple and easy and they preferred that over speed. (Also why would they have preferred that? I mean there are/were many geniuses who would not have any problem coding in a little more "harder" lang if it gave them significant speed)

  2. It didn't got famous at first but slowly and gradually as its community grew (I still wonder who were those people though).


r/AskProgramming • • Jun 06 '25

What is the “Jack of all trades, master of none” of programming languages?

115 Upvotes

r/AskProgramming • • Mar 23 '25

"Vibe coding" vs. Using AI for coding isnt it Two different things?

115 Upvotes

I've been thinking about how people use AI in coding, and I think there's a difference between "vibe coding" and using AI as a coding assistant.

Vibe coding seems more for people with little to no coding knowledge. They rely on tools like Cursor to build entire apps just by prompting, accepting whatever output they get, and not really reviewing or understanding the code.

Using AI for coding, on the other hand, is more like an enhanced version of what developers have always done with Google and Stack Overflow. You ask for help feature by feature, review and understand the output, and test each step as you go. The process is just faster and more efficient now.

What do you guys think? Do you agree with this distinction?


r/AskProgramming • • Sep 17 '23

Other Why has Windows never been entirely re-rewritten?

115 Upvotes

Each new release of Windows is just expanding and and slightly modifying the interface and if you go deep enough into the advanced options there are still things from the first versions of Windows.

Why has it never been entirely re-written from scratch with newer and better coding practices?

After a rewrite and fixing it up a bit after feedback and some time why couldn't Windows 12 be an entirely new much more efficient system with all the features implemented even better and faster?

Edit: Why are people downvoting a question? I'm not expecting upvotes but downvoting me for not knowing better seems... petty.


r/AskProgramming • • Jan 14 '21

Music or No music while coding?

115 Upvotes

As I've noticed, some devs see music as a distraction and absolutely hate it, while some won't write a single line of code without headphones on ears.

Which type of person are you and could you please elaborate a bit on your reasons behind it?


r/AskProgramming • • Feb 23 '20

Other What's "real" programming in a day to day job like?

114 Upvotes

I'm going to assume it's VERY different from the scope of school assignment programming but how different is it? What's an average "project" and how long do they take and what makes it so much harder/more complex than a school assignment would be?


r/AskProgramming • • Oct 14 '25

Is there a technical reason why there is no real alternative to JavaScript in the browser?

113 Upvotes

Of course I understand why JavaScript can't be replaced and will probably be supported for the next century, and that there are plenty of great languages that compile to JS. But, it's surprising that the browser-makers/standards committees never came up with a generalized virtual machine that could be targeted by any language to accomplish anything JS can to today. WASM has lots of deliberate limitations, and even that runs inside JS.

I work on mainframes and hear a lot of people comparing JavaScript to COBOL, but the difference is that nobody is really writing new applications in COBOL, or compiling other languages down to COBOL. If you're starting a greenfield project on the mainframe you can use a JVM language, or Go, or C/C++.

My guess is that this is more of a people problem about designing and agreeing to a new standard and implementing it across the various browser engines (in my example, the mainfame doesn't have this problem because IBM controls the whole platform). But I'm curious to know if there is some technical problem in the way. After all, they have all been able to agree on and support newer versions of HTML and JS...


r/AskProgramming • • Feb 23 '21

Does Anyone else feel the Industry is Overly Obsessed with Scrum?

113 Upvotes

Hey everybody,

I graduated from uni with a degree in software engineering about a year ago, and I've held internships and jobs as a developer at a few different companies. Without exaggeration, I believe I've had to learn/be taught scrum/agile nearly 10 times, and every time the instructor believes it's God's gift to earth and that they're bestowing some sacred knowledge onto me. It's weird, and the whole computer science discipline seems obsessed with it.

And the thing is, for how much they sing it's praises, every single company I've worked with does it differently, even though the official scrum documentation advises against making major modifications. Is this all just a big show to look good to management or something? Why do people obsess about it but then do whatever they want anyway?

And the thing is, it's not that complicated. In fact, it's pretty simple. I feel I understood it well enough to be a useful member of the scrum team the first time I learned it, so every time after that it's a chore and complete waste of time. I literally have to get certified in scrum now. Which isn't even a bad thing per se, but why couldn't I have just done that at uni so every job doesn't feel obligated to reteach me? It feels like such a waste of time that doesn't improve my ability as a developer.

Now let me be clear. I don't think agile or scrum is bad, I think it's pretty solid. In fact, I loosely use it's principles in my own personal projects. But with the amount you hear about, it feels like a religion and I'm so tired of it. Like, it's not that hard, complicated, or life changing. Can we please move on?

I realize this hinges on rant territory but something about it just feels... Off. Sort of like that story of the guy who knew the stock market would crash because his shoe shiner was giving stock advice. I feel like this whole obsession is going to have strange ends. Is this just me?


r/AskProgramming • • Jul 20 '20

Other If you've ever programmed a deliberately toxic feature into a popular program (minor or major) how did it feel? Did you care?

113 Upvotes

Gross features like:

Spotify, and plenty of other apps automatically running on start-up, whether you asked for it or not.

Chrome, Twitch, or Bittorrent simply minimising by default when you click the big red fucking close button.

Windows repeatedly installing Candy Crush and other games without asking, or trying its absolute damn best to upload and sell/use your data.

Plus any number of awful features in smaller programs that need money/reach even more, like the classic "install extras" that would change your home page and search provider in the middle of an install wizard that you might not be paying too much attention to, especially if you're inexperienced online.


r/AskProgramming • • Dec 20 '24

Tech interview, scraping - is this ethical?

112 Upvotes

Throwaway account.

For a product engineer role, I am being asked to build a scraper. The target website looks real, legitimate and is not affiliated with the hiring compangy. I am explicitely asked to crack Datadome, which protects the target website from botting.

Am I dreaming or is this at the very least against the tos of the website (quote "all data herein are copyright protected and shall be copied only with the publisher's written consent") and unethical?

I am aware that they wont exploit this particular website, but am I right to be wary for what it might mean later on the job? That they might be regularly breaching websites protection against scraping without agreement, or is this a standard testing practice in dev jobs focusing on API/Data?


r/AskProgramming • • Dec 12 '21

Other Is anyone else disturbed by how inefficient software has become? Software's always had bloat, but I see people complain about not being able to run trivial programs (games, web browsers, etc.) on hardware that is easily THOUSANDS - if not more - times more powerful than what should be needed.

112 Upvotes

And as a developer, I feel like there's almost nothing I can do about it. I blame the framework, library and system developers (not all of them obviously).

What am I supposed to do when installing a basic development framework requires something like a thousand npm packages?

Writing stuff from scratch feels like such a waste, but why am I seeing gains literally 2 - 3+ orders of magnitude when writing stuff from scratch vs using stuff that's pre-built? Think about what that implies. 100 - 1000x code waste and inefficencies. (This is not at all an exaggeration, as you can still find certain games or apps that are kilobytes and built using ex: native C++ modules vs 14mb average at minimum - often much more - for framework-built mobile apps.)

I sort of get how we got here. I just don't understand why it's being brushed off. Some good things have happened in software but when every instance of Chrome is taking up 80% of one of my CPUs, it's a problem.


r/AskProgramming • • Feb 14 '26

My professor claims this function is O(n), and I’m certain it’s O(1). Can you settle a debate for me? The function is below

110 Upvotes

int f(int m, int n) {

int a = 0, c = 0;

for (int i = 0; i<sizeof(int)\*8; i++) {

	c += ((m & (1 << i)) + (n & (1 << i)) + (a << i)) & (1 << i);

	a = ((m & (1 << i)) >> i) + ((n & (1 << i)) >> i) + a > 1 ? 1 : 0;

	cout << "a = " << a << endl;

}

return c;

}


r/AskProgramming • • Jul 14 '26

Other Did any of you use AI and then decide to stop using it completely?

109 Upvotes

I originally learned to code without AI. I used it for a year and a half but it makes too much mistakes. I also feel my cognitive abilities and critical thinking skills deteriorating the more I use it. There was a point where I couldn’t even write emails without feeling like I needed to cognitive offload the task to AI.

Has anyone else also decided to quit using AI? How has it been going for you?

I still expect to eventually have to use it if I’m in a situation I absolutely need its help with but for now I am going to try to cut its use to an absolute minimum.

I’m also concerned that with the direction of the field, if I land a job I may be expected to use AI to do all my coding to improve productivity. Any thoughts on this?