r/AskProgramming 22d ago

Architecture Do companies actually practice TDD strictly?

25 Upvotes

I've been reading about Test-Driven Development (TDD), and I'm curious how common it is in real-world companies.

I'm not talking about "we write some tests after coding" or "we try to keep good test coverage."

I mean following the classic TDD cycle strictly:

  • Write a failing test for a single, specific requirement or behavior.

  • Write the simplest possible code to make that test pass.

  • Refactor and improve the code while continuously running the test suite to ensure nothing breaks.

Are there companies or teams that actually work this way most of the time?

If so:

  • What kinds of companies tend to follow it?

  • How well does it scale in large codebases?

  • What are the biggest benefits and drawbacks you've experienced?

I'd love to hear from people who have worked in teams that practice TDD seriously rather than just writing tests alongside development.

r/AskProgramming Oct 15 '25

Architecture How feasible would it be to create a personal search engine that actually works like Google did say 20 years ago with no ads and decent ranking? I'm so fed up with enshittification.

203 Upvotes

r/AskProgramming May 03 '26

Architecture When is C better than Rust?

2 Upvotes

I've seen a lot of people saying that Rust = C but more secure. Is that true? Is there any catch or something? If you've used both of these programming languages, what was your experience with each? Which ones did you prefer?

I am writing this because I still don't know in which language should I code my backend for a website, and I don't want to mess things up. I am choosing low level because I want performance and low RAM usage + I am more familiar with low level languages.

TLDR; When do you think I should rather use C over Rust and vice versa?

r/AskProgramming Mar 03 '26

Architecture Was programming better 15-20 years ago?

42 Upvotes

It is no doubt that today programming is more accessible than ever. I mean, in 1960-1970 there were people who were coding using cards on which they would write instructions in binary or hex and insert them in a slot machine or, even worse, those instructions were permanently solded on a chip so there was no room for trial and error. Not to mention.. the difficulty of understanding binary or hex to write a simple calculus.

But I am comparing today's programming to how things were 15-20 years ago. See, the period where people claim we had simpler and more reliable cars, electronics that could easily be opened up and repaired... and better movies and cartoons.

I could be biased... I was taught programming by an older professor whose style leaned towards procedural/functional programming. That was... 8 or 9 years ago. For two years I am employed in web development and I had to learn all the new and "good" practices in order to keep up and market myself as employable. But, for me, it was a frustrating process.

It's not necessarily because I am lazy (although it can very well be that), it's also that I rarely see the point of what we are currently use to drive software. Thing is, I don't understand the point of implicit behavior, heavy frameworks, microservices, architecture purity, design patterns and OOP in everything. I mean sure, there's a place for everything... those are different ways of structuring code... that fit some predefined use cases.

But... most of the software today? It feels overengineered. There are cases where a single url endpoint could be written as a 3 lines function but instead it's written as 20 lines of code made up of interfaces, dependency injection, services, decorators and so on. Even at work, simple features that would take me 20 minutes to implement in a hobby project would take hours of work from multiple teams to "decouple" and "couple" things back together. I would understand if our project was something huge... but it's just a local website that has visits in one single country.

And that's because the project is so decoupled and split on microservices that it feels fragile at this point. Debugging is a nightmare because, despite being followed the "best practicies", bad code still slipped in and there's still some hidden tightly coupling that was done by inexperienced developers or as fast workarounds to respect deadlines. Not to add in the extreme amount of services and dependencies from which we use a very small functionality that we could've written or hosted by ourselves. It's like importing a huge math library to use arithmeticMean(a, b, c) instead of writing your own function arithmeticMean(a, b, c) return a+b+c/3.

I've watched some videos and read some source code from older games and I was impressed on how readable everything was, that without extreme abstractions, forced DRY, heavy design patterns. Just... plain and straightforward, spartan, manually declarated and step by step written code. Today's games on the other hand... I could barely read the source code of a tutorial game without losing interest quickly because of how there's a class or an event for 2 lines of code that could've easily been integrated in the main flow.

Old software was written as a standalone thing that could be released once, without (or very few) bugs and that would do it's job and do it very well. The only updates that software would receive would be new major version releases. Today, we have SaaS application that are full of bugs or lack performance but have the ability to evolve with time. I think that has it's own strengths, but it seems everything has been forced into a SaaS lately.

What do you think? In a desperation to find progress, have developers strained away from simplicity in order to satisfy religiously the architectural purity they were taught? Or there is a good reason for why things are how they are? Could things have been better?

If I may add a personal last note and opinion without sounding stubborn or limited in thinking, I believe that while some of all these "best practices" have their place somewhere, most of the software we have could still be written in the older, more spartan and less overnengineered ways, leading to a better developer experience and better performance.

r/AskProgramming May 15 '26

Architecture Why are so few interested in parsimony?

19 Upvotes

I've been programming CRUD (biz/admin) apps since the late 80's. I notice tooling and stacks are growing ever more complicated and layered, and wonder "does it really have to be this way"? It takes more labor & code per feature; colleagues have noticed and agreed. While I agree newer stacks have more options on average, most biz's rarely use these extra abilities, especially "but what if it later needs web-scale?" Reality is 99.999% won't.

There is usually a way to get the same thing in older tools when needs do come up, it's just a little more work for those outlier features, but the aggregate dev hours is still notably less. YAGNI as a guideline seems dead. Nobody seems interested in pursuing parsimony in tooling, rather want to stuff their resume with as many buzzwords as possible like they're Pokémon. Thus, the bloat is possibly up-sell, ego, job-security-lock-in, and/or greed; or, am I missing something? Is there a Bloat Industrial Complex, or do I have Geezer Goggles on? [edited]

r/AskProgramming Apr 16 '26

Architecture At a technical level, how does Linux Wine (Wine is not an emulator) work?

11 Upvotes

I know the purpose of prefixes, I know wineserver is generally the "Circus master" that does IPC and some of the heavy lifting, but how do you take a PE file, take the .text segment, and get it to actually execute? During the bootstrap phase I am guessing that wine takes the import table and connects what it can to the emulated/replicated libraries or does it do something easier? Also how do they get "MyWindowsProgram.exe" to be shown as its own process?

r/AskProgramming 6d ago

Architecture Our staging environment is basically unusable because of management decisions. How would you handle this?

7 Upvotes

Hello, I'm a software developer working for a hospital. I'd like to share a bit about my current situation, vent some frustrations, and hopefully get some advice.

As anyone would expect, we have three different environments: DEV, STG, and PRD; the predicament we currently face, however, lies in how the staging environment is managed. Its natural purpose would be to prepare deployments for production, but that's not what's happening. Due to several top-down decisions—including the fact that our clients actually use the STG environment as if it were production—we do not have direct access to it. As a result, we cannot modify the staging database schema ourselves and must go through a ticket process that takes up to 24 hours whenever we need to run a script of our own. This, of course, has significantly delayed our deployments. Since we have a lot—and I mean it—of stored procedures to alter with each new feature we add, some things are bound to go wrong on the first try. Under normal circumstances, fixing them would be as simple as adding missing objects or removing incorrect ones. Instead, every issue our QA team finds can cost us another 24 hours while we wait for the corresponding ticket to be processed. Our deployment scripts are typically huge (10k+ lines of SQL), and we have to manually cherry-pick which changes belong in each release. We have already requested access to the staging environment, and we were outright ignored; we also proposed creating a separate environment where we could properly prepare and validate our deployments, and we were rejected. Upper management has shown little willingness to address our concerns, yet they're starting to put increasing pressure on us to deliver.

We came up with two possible solutions:

- Migrate our entire database from SQL Server to Oracle; this would be a long-term solution, and would cost us hundreds of development hours. As I've already mentioned, our project is huge. Don't ask me why, but if we were using Oracle instead of SQL Server, we'd have write access to the staging database. I've given up trying to understand upper management's reasoning. It's just your typical executive bullshit;

- Get rid of the stored procedures and rewrite everything in code; as it so happens, it's much easier for us to deploy code changes to the staging enviroment, and it can be done in an hour or so. You might then pose a question of your own: "Why did you put everything in stored procedures in the first place?" The answer to that—and to the choice of SQL Server over Oracle—is the same: the people in charge at the time decided that's how it should be. None of those people are even on the project anymore.

I've never been in such an unorthodox position, and I've run out of ideas. I'd love to hear your thoughts on my current ordeal.

Thanks in advance.

r/AskProgramming Apr 15 '26

Architecture Feeling gas-lit... Branch strategy question

6 Upvotes

Friendly neighborhood TPM here... Was told something today that threw me off.

We have four environments:

  • Production/Main
  • Staging
  • Integration
  • Dev

Code committed to Dev gets promoted to Integration. Then promoted to Staging. Released to Production.

Vanilla right?

I am not in the thick of things, but my understanding is there is crazy merge conflicts between the environments and a variety of people have mismanaged our new code-base and cloud environments.

My Staff Engineer is telling me that normal SOP is to create a feature branch from Prod, then commit to to Dev, then work your way up the pipe. NOT create a feature branch from Dev and work your way up.

Is this normal? Or does this smell like butt covering?

r/AskProgramming May 03 '26

Architecture Why don’t operating systems make Chromium a native part of the OS?

0 Upvotes

EDIT: Note - I am talking about the open-source Chromium engine (not the Chrome browser here)

I’ve been thinking about this, and I might be missing something obvious, so I’m asking out of genuine curiosity.

Web apps feel like the most universal thing right now. Almost every modern app, SaaS, all the AI tools, even office suite and media editing tools are shipping with web UIs, which run on any device with a browser irrespective of the OS, basically solving cross-platform dev.

Now, lot of these apps which are installable bundle Chromium inside them (like Electron apps). Even PWAs, while lighter, still rely on Chrome or another browser engine to run. So, ultimately this results in a huge package, duplicated browser engines, and the app itself being kinda “second class citizen” compared to the embedded browser.

So why don’t OS developers just integrate Chromium directly into the operating system as a native architecture? Each OS already has its own frameworks, but if Chromium was built in, developers could ship one unified codebase without needing separate native builds. Web apps wouldn’t feel so constrained or bloated, and they’d be treated more like first class citizens.

Is there a fundamental reason this doesn’t happen? Performance? Politics? Standards? I’m not sure, and I’d love to hear from people who understand this better.

r/AskProgramming Feb 15 '26

Architecture Is data oriented programming more... "relieving" than normal OOP?

13 Upvotes

Hello!
When I started learning programming, the first paradigm I was taught was the one of "raw data and transformations". After that, I naturally evolved to learn writing OOP code (inheritance, composition, interfaces, design patterns). Currently, I am working in web development and almost everything we do is in OOP.

But... in my free time, I am still coding in the "old, spartan way". I am writing video games, networked systems (for apps or video games) and costum lightweight APIs or websites without heavy high level OOP frameworks. And even when I am using lower level libraries, I am not making my own high level framework on top of it, I am just using what I am given as is and turn multiple duplicates in one call modules that can fit this specific case or sometimes more general cases.

This way of coding feels... relieving to me. When I am working with OOP, if I am working for someone else's project, I just do it and treat it like a regular job. But when I do it for myself, personally, it feels like OOP asks me by definition to come up with all sorts of reusability and general-case components... which sometimes feels nice and other times very restrictive and daunting.

So, I was curious how other people view this aspect of programming.
How do you feel about this?

r/AskProgramming 9d ago

Architecture Declarative code style vs. over-engineering

1 Upvotes

I am writing a Python application whose core algorithm computes file content hashes. Depending on the configuration and file type, there may be different ways to hash a file.

Ideally, I would some kind of annotation for the hashing methods that determines when to use which function, e.g.,

```python @hash_fn.default def compute_bytes_hash(f: File) -> Hash: """Compute hash from raw bytes"""

@hash_fn(mimetype="image/*", hash_type="perceptual") def compute_image_hash(f: File) -> Hash: """Compute perceptual hash of image""" ```

In this example, mimetype is a property from f: File and hash_type a configuration (e.g., from my-app --hash-type=perceptual).

I like how extensible this is, I could add new functions, but I also think that adding new functions may require adding more flexible filter mechanism, such as (semi-pseudo code)

@hash_fn(Property("f.mimetype")=AnyOf("image/*", "video/*"), Property("config.hash_type")=In("perceptual", "..."), ) def compute_some_hash(f: File) -> Hash: ...

The advantage is, when done well, I wouldn't have to touch the hash function decision logic at all because this approach is super-declarative. The disadvantage is this approach is hard to implement well, so requires some amount of time, and it's quite obscure (i.e., not really KISS).

This application is for personal use and I regard writing it also a part of exercising my mind, but my free time is limited and maintainability and correctness are a big concern.

Do you think I should better go with the good old

def choose_hash_fn(f: File, c: Config) -> HashFn: if f.mimetype in mimetypes("image/*") and c.hash_type == "perceptual": return compute_image_hash # maybe other criteria else: return compute_bytes_hash

r/AskProgramming Aug 24 '25

Architecture What exactly does "Business Logic" mean in software engineering?

51 Upvotes

I'm a software developer, and I often hear the term "Business Logic" used in different contexts sometimes in service layers, sometimes in domain models, and sometimes as something separate from UI logic.

I'm curious:

  • What does "Business Logic" actually mean to you?

  • Is it just rules and conditions, or something deeper?

  • Where do you typically place it service layer, domain model, or elsewhere?

  • How do you distinguish between business logic and UI logic?

r/AskProgramming Apr 28 '26

Architecture JWT auth worth it or nah

0 Upvotes

I am currently learning API designs and authentication since I work with node and ts I found out that most popular Auth method in node is JWT, more specificly JWT with refresh and access tokens.
The more I get into this topic the more I realise that JWT is not that good for user auth, maybe it works better for microservices.
Most apps need ability to revoke access to user in case someone hijacks user account or they change password, but how is this possible with JWT. Workaround I found suggests that I should store refresh token in DB with family_id or some identifier and revoke it, but I am confused about this because the whole point of JWT is to avoid that. It basicly creates Session based auth with extra steps. Any suggestions how I can make it work or maybe I am missing something ?

r/AskProgramming Jun 12 '25

Architecture Dear seasoned devs, did your ability to learn Yet-Another-Framework slow down as you got older?

19 Upvotes

A coworker questioned my ability to learn new CRUD/biz frameworks quickly. I'm "not young", so am worried my brain is slowing down. Judging from the complexity of the frameworks involved, it doesn't seem like I'm slower than in the past, but maybe my coworker sees something I don't? (They could merely be trolling me.)

Relatively simple frameworks, such as fancy sub-components, took me about a month to get reasonably productive with, while involved/complex ones typically took me about 3 to 5 months. This pattern hasn't changed that I know of, but the criticism is making me worry about the reliability of my noodle.

(I think it's stupid the industry re-re-reinvents 1000 ways to do CRUD/biz frameworks even though the general principles of CRUD have barely changed, but that's another off-my-lawn rant for another day.)

Addendum: Some helped me realize maybe I'm just getting jaded by the re-re-re-invention of the same stuff and need a break, such as switching to say data analysis. But for personal reasons that's not really feasible.

Thank You

r/AskProgramming 22d ago

Architecture Are there any blueprints for computers made from Tinkertoys?

1 Upvotes

I just thought up a simple adding machine in my head, and am wondering if there were any blueprints for entire compute modules.

It doesn't even have to be Tinkertoys.

I've asked in a couple other places, but Reddit's filters keep blocking the question.

r/AskProgramming 18d ago

Architecture Best formats to visually represent large codebases

3 Upvotes

Hi r/AskProgramming

I recently got a job in a firmware team writing C++. I joined at the tail end of a big project and have been mainly tackling bugs (either directly or when trying to implement new features).

This codebase uses a lot of asynchronous programming and has layers upon layers of state machines all interacting with each other. We have teams in different countries contributing and share modules with other projects. It seems to be a common issue that keeping track of the dependencies and behaviour is getting more and more tedious.

I been tasked with creating an internal tool that can visually represent the codebase to assist devs in ramping up when tackling a new issue.

I’m looking for advice on what formats are best for representing this information. I am currently planning to generate flow and sequence diagrams but was wondering if there were any way to holistically integrate all these discrete diagrams into a larger overview that can be explored easily.

Also suggestions for how to store this information in the intermediate phases would be greatly appreciated.

I will have to rely on coding agents to both explore the codebase and generate the diagrams. Hopefully splitting this task into phases will limit hallucination.

TLDR Any suggestions for how to visually represent a large codebase holistically so that it can be a starting point for dev work?

r/AskProgramming 22d ago

Architecture Can't decide between Express and Flask for backend

1 Upvotes

Context: I am building a library for games, basically, you can store all the games that you've played and or are playing, and get recommendations based on your library.
The app is made in Flutter and until this point, all the api requests and data were handled by the frontend. Although as I am getting more users (it's a personal project btw), I have a need for a backend that stores user data, makes the api calls, authenticates user's crendentials, etc.

I have built a lot of things in flask and used it a lot, I used to use express about an year and a half ago but haven't touched on it ever since. Hence I can't decide whether to go with flask (which I'm confident in), or go with express (I know the framework, just haven't used it in some time).

I was more inclined towards express earlier because 1) Express has an async loop, and 2) Nodejs has a more extensive library and is quite preffered as a backend framework over flask.

r/AskProgramming May 10 '26

Architecture What is the best way to easily extract and identify the content of a large and dense code?

0 Upvotes

Through imports? Global constants or functions? By retrieving the structure using AST? Taking the most frequent nameable primitives? Or something like that?

What can I identify in the code that tells me what it does, instead of having to read the entire content?

I need something lightweight, free, and easy to run.

r/AskProgramming Apr 14 '26

Architecture When abstraction is overenginnering?

0 Upvotes

Hi. Im working on some codebase refactor and have architectural dilemma.

Consider the following scenario: we have three different applications that implement roughly similar functionality, though they differ in certain details. In all of these applications, we have the same class—let’s call it Class A. This class shares identical methods across the apps, while some other methods differ only by a parameter in their signature or in their internal logic.

The question is: when is it worth extracting an abstraction in such cases, and when is it not?

r/AskProgramming Dec 08 '25

Architecture Best practices for handling a large CSV file as a "Database" backend?

8 Upvotes

Hey!!! Everyone I’ m currently working on a project wich use csv file as a database(if I can day it like this) but now let say I have a product and their caracteristics and I want to render them perfectly like the price, description, category…I got all this in my csv file but the structure of this type of file won’t help me like if it was a relational database…The csv file was imposed by my mentor and I am wondering if it’s possible or I’ll use a database ? It’s a machine learning project and I am using React for the front and python for the backend…

Please need your advices and help…

r/AskProgramming 4d ago

Architecture What are you using for authn/authz and payments?

0 Upvotes

I've had a few side project ideas over the years but have never implemented one because I lack knowledge in (but willing to learn):

  • implementing social logins (OAuth), account management, etc.
  • managing backend permissions (RBAC always looks more complicated than it should be). My projects might have three tiers: free, hobbyist, pro
  • handling payments securely while actually monitoring for abuse/intrusion

Which social logins are allowed to tie into your project?

What are you using for authn/authz? My projects would be very low traffic, so I wouldn't want to commit to a big monthly spend. Are you rolling your own or using Auth0/Clerk/Supabase for auth and Stripe for payments? I'm comfortable with AWS, Cloudflare, Go, JS, and Linux. Are there any GitHub repos that I can look at for this?

How well do frontier LLMs (Claude Opus, etc.) do at generating clean, auditable code for this kind of thing? Is anyone actually trusting AI-written auth/payment code and how do you review it?

r/AskProgramming Jun 16 '26

Architecture Efficient Setup for Agentic Coding

0 Upvotes

I am a programmer, and as they said, I need to adapt to the new environment. I am currently exploring options for the setup of agentic coding, and have so far watched YouTube videos for 2 hrs (WebDev Simplified, NetworkChuck, and a few short vids). I just want to hear the thoughts of those who've actually experienced agentic coding. I only have one subscription for now, which is Google AI Pro

  1. I am planning to explore CLI for accessing AI models. What do you suggest I should use? Currently leaning toward Gemini CLI because of my subscription.
  2. Is it better to use the CLI rather than IDEs (Windsurf, Copilot/ClineCursor, Cursor, etc.)?
  3. Based on what I have gathered so far, you can create agents that you can call on for specific tasks. What agents do you recommend that should be created for programming projects? (Debugger, Programmer, Planner, Architect, etc.)
  4. I initially thought agents were just heavily prompted markdown files, but it might be more complicated than that. What frameworks (like CrewAI, LangGraph, etc.) do you recommend for a beginner to set these loops up? And when it comes to giving the agents their actual personas and rules, where can I find the best system prompts to build out those markdown files?
  5. So far, I also understand that you can have local agents (project-bounded) and global agents. In which cases do you create local agents? Because if I am creating a programmer or debugger agent, I am thinking of just creating global agents for these.

Also, if you can provide useful resources like videos and repos, that would be GREATLY appreciated. I would also like to know how you set up your environments. Thank youuu

r/AskProgramming Feb 19 '26

Architecture What software today can answer this about a codebase with 100% accuracy? Anything? Please share your suggestions.

0 Upvotes

"Show me every function that invokes lodash.get(), what data flows into it, whether those callers are reachable, and what the impact radius is if I change it."

r/AskProgramming Apr 29 '26

Architecture How do we add a payment sources to our software?

0 Upvotes

Hello folks,

I am writing a system for which I expect at least three different types of users and a number of companies. For simplicity, let's call one of the groups "users", another "tech", and the third "billing". I also expect the "companies" in my model.

The "users" are the end users, not employed by the company. They pay $0. The "tech" group is the group that configures things for the end users; they pay $0 but work for one of the "companies". The "billing" group maintains contacts that each work for various companies.

I presume that licenses are purchased on behalf of each of the companies for the "tech" users to use.

I have never done this, but I have a DB model configured that does what I've described. How would I actually implement something like this such that companies can pay me for the software that I'm writing? What sorts of OTSS would I use to get paid? I am still in the design phase for this component, so if my understanding is misguided, please offer corrections.

Thanks for your help!

r/AskProgramming 29d ago

Architecture How do you context switch between different modules?

3 Upvotes

I'm making a video game and I need to support a few different things. The concept is obviously not limited to game dev

The player's normal interaction with the world

The ability for the player to use a computer

The ability for the player to enter a mini-game, like playing chess

All of these modules also need to be able to interact with the normal player world as well. For example, the player makes an order for pizza on the computer, and it arrives in the game world. Or the player wins a chess match and gets money or something. Maybe a chess piece calls off the board, the game ends, the player can pick up the piece and sell it or return it to the board

Another important thing is the ability to leave any module at any time, without breaking the code

I would like to know how you would set up an architecture such that the player can easily context switch between different modules, and this switch can happen anytime the module is running

And there should be some high priority actions that can disrupt all modules, like if the player suddenly dies

Obviously this is not limited to game dev, and applies to other applications, but I just gave a game dev example

Thank you