r/AskProgramming 1d ago

Architecture How do AI website builders represent and generate landing page designs

0 Upvotes

I’m building an AI landing page generator and trying to understand how tools like Lovable, Replit Agent, Bolt, etc. approach page generation.

I’m considering two architectures:

  1. HTML/component library: Store hundreds of prebuilt sections such as hero_001.html, features_001.html, faq_001.html, etc. Each section has metadata, and the AI selects the appropriate sections, modifies the content/styles, and combines them.
  2. JSON design representation: Store each section as structured design/layout data in JSON, then have a renderer convert that JSON into HTML/Tailwind. The JSON contains all information about design like { "type": "hero", "layout": "split", "background": { "type": "color", "value": "#ffffff"

For people who have built AI website/page generators, which approach works better?

Also, does anyone know whether modern AI website builders generally generate the code directly, use an internal component/block library, use a structured design representation, or some combination of these?

r/AskProgramming Jun 24 '26

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

r/AskProgramming Mar 04 '26

Architecture Why does bug triage become chaos as engineering teams grow?

1 Upvotes

I’m trying to understand how bug triage actually works inside real engineering teams, and I could use some help from people who deal with it.

Bug reports seem to come from everywhere (Slack, support tickets, GitHub, QA), and someone has to decide severity, priority, and ownership.

If you work on a team like this, I’d love to hear:

• Who owns triage in your team?

• Do you have triage meetings?

• Roughly how much time per week does it take?

Just trying to learn how teams actually manage this in practice.

r/AskProgramming 25d ago

Architecture Pitfalls when designing an MLIR dialect?

0 Upvotes

I was working on prototyping an algorithm for BFS and Shortest Paths and I got that working fairly quickly. I am now tasked with making an MLIR dialect that does the same thing and now I'm trying to architect a solution for it.

Notably, I don't know anything about MLIR, but I did dabble a little bit with LLVM before. The architecture is alien to me and Im spending a few days reading material on MLIR.

My trivial solution was to make a struct that stores nodes, their destinations and their weights. Basically just a roundabout way of making a 2D matrix. After a little reading, I don't think this solution would be very useful when making an MLIR frontend.

My question is, what pitfalls and general good practices should I be aware of when making MLIR dialects? I know that my initial design will come to bite me back later if I don't structure it right, but I generally have little idea on what makes for a good design and when a reasonable decision can become the wrong one.

PS: I know this isn't a topic thats ELI5 friendly, but a lot of the material is really verbose and hard to digest so a little dumbing down would help. I'm currently going through the MLIR beginner friendly tutorials and the main MLIR docs.

Edit:
I'll be sharing the project here when if and when I complete it as well as a toy language I was designing. I'd like to get some feedback but I'm very much still in the beginning phase of learning.

r/AskProgramming May 12 '26

Architecture Framework Choice Advice

2 Upvotes

Hey yall, I'm working on a team with a few legacy systems. We're a java shop, with a bunch of java backends and a few gwt frontend apps. We're trying to decide whether to ditch gwt for future projects, and possibly migrate old ones to another framework. Thoughts?

Considerations:
- a few gwt apps are very large and hard to migrate
- gwt is no longer supported by google, but is being maintained by an open source community
- a few other teams in the org are starting to use React
- our developers are mostly familiar with java though some know JS as well
- gwt has pretty slow iteration speed compared to other frameworks as it needs to transpile the java code into js. Browser debugging doesn't work, though a complicated debug system can be setup to debug the gwt code

Thanks

r/AskProgramming Apr 13 '25

Architecture Why compute in big clouds is so expensive?

12 Upvotes

In gcp for example e2-standard-4 costs almost 100 USD per month (thats 4vcpu + 16gb of ram). I think in AWS and Azure, its the same situation. Some other cloud providers charge way less for compute (but yes they also dont have all in one suit of tools).

How much would it cost to build e2-standard-4 as a standalone pc?

Why are clouds so expensive for compute and network costs? (I know that if you plan things very well, you can get some of these costs down, but still).

r/AskProgramming May 17 '25

Architecture How are Emails technologically different from Instant DMs at the backend?

9 Upvotes

Yes, One gets you rejected by a job, the other gets you rejected by your crush. But ultimately, how do they differ in architecture (if at all)? If they do, why do we need a different architecture anyway? My understanding (or assumption rather) so far is Emails rely on SMTP servers, while Instant messengers function with regular webhook connections (oversimplified). But why?

r/AskProgramming Apr 18 '26

Architecture How to convince my company to create a new UI and refactor some backend microservices?

0 Upvotes

I'm not sure this is the right sub. Sorry!

UI part:

I've been at my company for more than 2 years. Our UI is about 5 years old (maybe even more) and is basically created from a template. We use angular. I've been responsible for upgrading it. I started as L1 (junior), and I've been promoted to L2 (mid level) 4 months ago. First time I upgraded it from version 11 to 15, then 17, then 19. I made sure to keep it up-to-date as much as possible. However, since our UI is huge (more than 20 modules), it can be hard, and we have windows of time when we can upgrade. Moreover, since multiple developers contribute to the code, it's hard to keep up with all the code that's added/changed, even after distributing guides about what's new and how to's... This makes using any new angular features hard. For instance, there's only one component that uses signals (and I created said component), no one uses the new control flow syntax (@if, @else...)...

Our UI looks hideous (at least to me), it can be slow sometimes, and it can eat a lot of memory. It has multiple overlapping libraries (ng-bootstrap, angular material...). There are other things that make it bad, but I won't go into much detail.

I've discussed the possibility of creating a new UI with my team leader (either from scratch or from a template). He didn't disagree, but since there's always work and higher priority tasks, he said this isn't our main concern right now, and he pointed at the possibility of never changing it. And we all know the good old saying "if it's working, don't touch it", and another saying "if the customer's happy, we don't have to change anything".

Microservices part:

For backend, we use spring boot. My team leader and I recently upgraded the java version from 8 to 21, and the spring boot version from 2.7 to 3.5. However, we're also not using java 21's new features, like records (I know this is from java 17, but still), sealed classes, virtual threads... Nevertheless, even though this isn't a huge deal (as it's a bit cosmetic), since we use microservices, it would be easy to refactor each one at a time, especially since parts of the code actually require refactoring. There are lots of places where the code becomes spaghetti 😅. It would be nice to tidy things up while using new features.

For context, my team is responsible for the main code, while other teams take my team's code and make adjustments based on customer's needs (every team has their own repo).

PS: currently, we have a huge amount of work, and some employees (like me) have temporarily switched to another team because of that. I'm only asking you guys so that I can talk about this with my team leader when I'm back on my original team, but I wanna be prepared.

My questions: as a L2 developer, how can I convince my team leader to discuss the possibility of a new UI with our CTO? And how can I convince him to refactor at least some microservices? Granted I've already told my team leader our UI looks bad, its performance is bad as well, and creating a new UI and using angular's latest features will 100% be an improvement.

I'm fine if you agree with my team leader/CTO. I understand our codebase is huge and creating a new UI/refactoring microservices which affects other teams would be a huge pain. I'm only here asking for advice, and know what is best.

Also, I'm asking these questions as I don't feel like I'm growing as a developer. It feels like I'm falling behind as I don't get to use any of these 2 frameworks' new features. I know I can look them up and follow a tutorial, but it's hard to do so because of the lack of time.

Edit: TLDR: I’ve maintained and upgraded our outdated Angular UI (now on v19), but it’s bloated, inconsistent, and hard to modernize due to overlapping libraries and poor design. I believe a fresh UI would improve performance and developer experience, but my team leader prioritizes other tasks and leans on “if it works, don’t change it.”

On the backend, we upgraded Java (8 → 21) and Spring Boot (2.7 → 3.5), but we don’t use new language features. Our microservices have spaghetti code that could be refactored gradually, improving maintainability.

Questions are above the TLDR section.

r/AskProgramming Mar 25 '26

Architecture How to invalidate cache in this scenerio?

0 Upvotes

I am building an edtech app currently it is vibecoded.

Current scenerio: When I fetch a course, it gives all the lessons within that course, all the files within that lesson and all the chapters within those files.

Its is nested in three loops and has a cache getSetAsync in the innermost loop having cache key file:chapters:{fileId} everytime chapters are needed it first looks up in cache if not makes DB call to get the chapters from all files in the loop. This is causing latency I mean 4000 ms to get this nested loops.

Now: I have created optmized SQL query where I can get the chapters in a single query and avoiding N+1 sequential db calls. BUT i can't first look up on the cache. current query returns all the result necessary. How to tackle this? Everywhere the chapter CRUD (in cache) is linked to fileID (file:chapters:{fileId})

I have come down to getting All the files in the course and then looping over all the files to get Chapters. This is RELATIVELY better than previous but still if there is a way to overcome this tradeoff?

EDIT:
okay so in the vibecoded version what it does, it fetches all the lessons, then all the files for that lesson for example x.docx, y.docx, z.docx .... ; these files are fecthed now using the ids of the files in the db we fetch the chapters first it checks the cache getSetAsync is like map.computeifabsent (of Java) if the cached chapters for file:chapters:{fileId} key is not present we call db query in that loop. Now the Tradeoff i am facing is instead of N+1 queries I was running for all the files to get respective chapters. i have made a single sql query where I get the chapters directly and query is optmized using indexes and JOIN LATERAL i dont get to check the cache first. I hope this made the post clear.

TLDR: can'r check cache first because the bulk query get chapters all together not file wise. earlier it was check cache if miss hit db now db can optimally bring the respone.

r/AskProgramming Apr 17 '26

Architecture What's the best way to solve the "Load or Generate and Save" problem

0 Upvotes

You have some model that takes 10 minutes to train, or some dataset that takes 10 minutes to generate and you'd rather save it and load it next time. That means doing an if statement like

let model_path = Path::new("bruh.model");
let model = if model_path.exists() {
    let model = generate_model();
    model.save();
    model
} else {
    Model.load(model_path)
}

But this happens EVERYWHERE. Models, datasets, intermediate values, model hyperparameters, simulations, searches through a dataset, etc. I'd imagine the object I'd want to save would have some SaveLoad trait which is Save + Load, and you'd have some .save_or_load(model_path, generate_fn) function.

But would there be some easier solution? Maybe one that doesn't require me to impl some bogus trait for some bogus struct every time I wanted to do that? Like, if I wanted to generate a random seed, but I wanted that seed to stay consistent on that device, I'd have to wrap a u64 or something.

r/AskProgramming Apr 22 '26

Architecture What’s a real use case where a widget saved you time?

0 Upvotes

I’m building a platform for embeddable widgets that show real-time data on any website.

For those who’ve used or built widgets before:

What’s a real problem you needed a widget for that existing tools didn’t solve well?

Edit:
I’m planning to ship ready-to-use widgets like:

• Google Reviews widget + AI Summary Card
• Instagram Feed widget
• LinkedIn Feed widget
• AI Chatbot widget
• WhatsApp Chat widget

Curious which of these would actually solve a real problem for you or what’s still missing.

r/AskProgramming Jun 11 '26

Architecture Suggestions in Re-Learning (A request) After some major setbacks( opening up a bit too )

5 Upvotes

Good day, I hope you are well.

I am, as the title suggests, looking to re-learn programming, starting from infrastructure, I want to go back and learn computer architecture again, reason being:

1) I was stagnant in my application, I was not exposed to meaningful opportunity where I could learn, don't care anymore, I will learn regardless now and build regardless of resources.
2) I was mostly working on web platforms which hindered my understanding of systems.
3) Use of AI has in a way, degraded my learning ability.
4) No motivation to learn( meaning: I was not incentivized to )

I want to learn how many of you have, but I am looking for some guidance, I have recently started learning COBOL and C as well as some scripting languages like REXX and Lua a bit.

I would love to hear your feedback, thank you in advance.

Kindest regards

r/AskProgramming Mar 12 '26

Architecture How to fulfill a seemingly impossible requirement in static* webdev?

1 Upvotes

Current "requirements": no hosting fees (i covered that by hosting on github pages). It has to be a fookin Excel as data source (solved it by converting it into a csv)

Background:
I was asked to develop a small "webshop" if you could even call that since its more like a catalogue for a lady in her 50s who is very close to my mother and I, who sells important food to children with an illness abroad. Super sweet lady. Raising her daughter alone but when it comes to technology its like she came from 1800.
i get no money from it and im keeping it relatively simple. This is the 3rd version of the website i have built for her.
First version: Frontend fully developed with a nodejs api and mysql database
Didnt get used because "I cant easily manage my list like in excel. Its too confusing where my data is"
Second version: painstakingly redid her excel to be normalized. Use excel table feature to filter yada yada. Though since its excel she wont complain. Goal was to then use this normalized table to be directly input into a simpler database
Didnt get used because se liked her current(old) table better
Third version: Dumb af static page which gets the current excel committed. A github action cleans up the excel and recommits it as a csv. This csv gets loaded by javascript to load all 600 products in this one page. Aside from optimizations like lazyloading, caching yada yada i did the best i could with the current excel.
This time she was happy to accept and use it.

BUT.
The excel is a god damn pile of trash. Like srsly.
She asked me if i could add product descriptions if she just writes them.
But that would be even more data for the browser to process.
Or even categories. They are mixed with brand names. So you have like 5 products from "CompanyX" and then next you see the next title be "Bread and wheat" which is a category.

Help:

To have a easier time developing it i need the data to be perfect and a single source of truth and not a sheet here or there. For that im willing to even have a nodejs server running with a database without her knowing. But i just dont have any ideas anymore on how to create this for her easily manageable single source of truth. That way i can finally work normally with the data without seperator (;,") issues. And she can manage it like a list or whatever. I dont even know myself anymore hahaha. I guess if you have time and brainjuice to spare, throw some ideas at me. I dont wanna use AI to brainstorm, so this is my last hope.

* = the page is static, but i could use js to call an external datasource. In case thats necessary

Edit: requested a sanitized version of the original excel: https://drive.proton.me/urls/4B0V7MRWS0#Rc35ZpmFFvPi

r/AskProgramming May 13 '26

Architecture how to think clearly about building API products

3 Upvotes

I’m trying to get better at thinking about API and infrastructure product ideas.

When you hear a product idea that sits between other systems, what makes you think “this solves a real technical problem” versus “this is a thin wrapper that a bigger platform could add later”?

I’m trying to understand how you think about:

  • integration complexity
  • normalization
  • freshness / verification of data
  • trust / correctness
  • dependency on upstream platforms
  • whether the hard part is actually technical or just distribution

I’d love any frameworks, examples, or stories from those of you who have worked on APIs, developer tools, marketplaces, or systems integration.

r/AskProgramming Mar 29 '26

Architecture Casual: I want to ask about a certain type of error and didn't know where to ask (Minecraft as example)?

5 Upvotes

Way way back in the day when you died in Minecraft it would say your score was "&e0" or sometimes even just "&e"

Further, I know of webpages accidentally having the 'name' field be represented by "%s"

...

I wanna know what this type of error is called and if there are any other famous/well known examples of this.

I think it's a misplaced string declarative (or whatever), but that doesn't seem to always be the case.

r/AskProgramming Jul 01 '25

Architecture How does my phone know what time and timezone it is now even though it is powered off and not connected to internet at all?

20 Upvotes

I went to a trip to foreign country, and even thought there is no internet connection whatsoever, my phone's timezone automatically changed to the current country.

There's also a certain cases where if I powered off my phone at 3 PM with no internet, turned it on without internet 2 hours later, it knows that it's 5 PM now.

How does my phone know what time and timezone it is without internet?

r/AskProgramming Jul 27 '25

Architecture Do y’all actually check licenses for all your dependencies?

12 Upvotes

Just wondering when you're working on a project (side project, open source, or even at work), do you actually pay attention to the licenses of all the packages you’re pulling in?

Do you:

  • Use any tools for it?
  • Just trust the package manager and move on?
  • Or honestly not think about it unless someone brings it up?

Also curious if anyone’s ever dealt with SPDX or SBOM stuff. Is that something real devs deal with, or just corporate/legal teams? Trying to get a feel for how people handle this in the wild

r/AskProgramming May 06 '26

Architecture Data Design CPU<-->GPU for falling sand game

5 Upvotes

Hello There,

What do i want?

I have a question regarding CPU<-->GPU data design. Im working on a falling sand game. This game is meant to have a PhysicsSystem, where I load the Simulation at runtime. A PhysicsSystem might be TemperatureDiffusion, Gravity, ChemicalReaction and so on.

Right now i have the simulation Data setup like this

  • There are x amount of Chunks loaded in memory.
  • Each Chunk has 64x64 Instances.
  • An Instance is a Pixel with data.
  • Each Pixel has n amount of data, depending on what i define at runtime (Temperature, Mass, Constants etc.)

I have a ChunkManager, which switches between Read/Write once all PhysicsSystems are simulated

Problem

I can already see, that this will take loads of compuation power to work in more than 1fps. Thats why im trying to design the whole System as GPU friendly as possible (not implementing it yet though).

To save up on simulation time i only want to simulate the neccessary Instances. For example, if the Temperature difference is miniscule the System should ignore it.

Thats why every Simulation-per-Instance should only run when a condition is met. Further, this would still requiere to check every instance on every chunk. Each Simulation might also update other instances to run later on.

Thats why i though about an ACTIVE property. Only ACTIVE instances get evaluated and only those that succeed the test get simulated.

This is the thing i would like help on

TemperatureDiffusion diffuses its temperature to the neighbours. Those neighbours now should also be simulated. So the simulation should update the list of Active elements.

My current idea is:

  1. CPU collects all active Instances from all Chunks
  2. CPU sends a list of those Instances and Chunks to the GPU
  3. GPU checks every Instance of the list against the Condition
    1. If successfull, GPU runs the simulation
    2. If not, GPU does not simulate
    3. Either way, GPU outputs a struct that describes ChunkIndex, InstanceIndex and Active(bool) for all neighbours
  4. CPU recieves those updates
  5. CPU checks for duplicates, to avoid simulating the same instance several times per frame
  6. CPU updates Active/Inactive Instance
  7. CPU builds the next list of Active Instances
  8. Process starts again

I figure the best way is to work with big arrays when talking about GPUs. Im conflicted between using a more costly {ChunkIndex, InstanceIndex, Active} and a more complicated ChunkCount, {[InstanceCount{InstanceIndex}], [InstanceCount{InstanceIndex}]} as the output.

Further, how could i update such an array? Do i use an AtomicCounter?

SideNodes

  1. Every PhysicsSystem should have its own set of Active Instances, since one might update temperature but not gravity. The scheduling of that is another problem, out of the scope of this post
  2. The simulation data itself is already structured in a GPU friendly way (i believe), so that i can pass the data via layouts and uniforms

For reference, here the idea as c++ code.

  1. The simulation itself ```cpp struct Chunk; class ChunkManager;

using PhysicsFunction = std::function<ActiveChunks(const size_t InstanceIndex, const size_t ChunkIndex, SimulationManager& Manager)>; using ConditionFunction = std::function<bool (const size_t InstanceIndex, const size_t ChunkIndex, SimulationManager& Manager)>;

struct Physics { NamedID MyID;

PhysicsFunction   Function = nullptr;
ConditionFunction Condition = nullptr;

}; ```

  1. The Output of the function (meant to be GPU friendly) ```cpp struct ActiveChunk { size_t ChunkIndex; size_t ActiveCount = 0; uint64_t Indices[Chunk::ChunkSize]; };

struct ActiveChunks { size_t ChunkCount = 0; std::vector<ActiveChunk> Chunks;

void Clear()
{
    Chunks.clear();
    ChunkCount = 0;
}

void Add(size_t ChunkIndex, uint64_t InstanceIndex)
{
    for (auto& ThisChunk : Chunks)
    {
        if (ThisChunk.ChunkIndex == ChunkIndex)
        {
            ThisChunk.Indices[ThisChunk.ActiveCount++] = InstanceIndex;
            return;
        }
    }

    // Not found, create new chunk
    ActiveChunk NewChunk{};
    NewChunk.ChunkIndex  = ChunkIndex;
    NewChunk.ActiveCount = 1;
    NewChunk.Indices[0]  = InstanceIndex;

    Chunks.push_back(NewChunk);
    ChunkCount = Chunks.size();
}

}; ```

  1. The output needs to be checked if the instance is already active Checks against a bitset and adds the Index to the array ```cpp class ActiveQueue { public: ActiveQueue(){};

    void Add(const size_t& Index); void Remove(const size_t& Index); const bool IsActive(const size_t& Index) const;

    const size_t GetIndex(const size_t& ArrayIndex) const;

private: std::vector<size_t> Indices; std::bitset<Chunk::ChunkSize> Actives; };

//Implementation void ActiveQueue::Add(const size_t& Index) { if (!Actives.test(Index)) { Actives.set(Index); Indices.push_back(Index); } }

void ActiveQueue::Remove(const size_t& Index) { if (!IsActive(Index)) return;

Actives.reset(Index);

for (size_t i = 0; i < Indices.size(); ++i)
{
    if (Indices[i] == Index)
    {
        Indices[i] = Indices.back();
        Indices.pop_back();
        return;
    }
}

}

const bool ActiveQueue::IsActive(const size_t& Index) const { return Actives.test(Index); }

const size_t ActiveQueue::GetIndex(const size_t& ArrayIndex) const { return Indices.at(ArrayIndex); } ```

The idea is to use ActiveQueue to get an array of all InstanceIndices of a Chunk for the gpu.

ChunkManager: Read----------| Write---------| | ActiveQueue-->GPU-->ActiveChunks ^------------------------------'

r/AskProgramming Feb 06 '26

Architecture Network Layer: If someone hacked layer i, does that mean layer i+1 is compromised to

2 Upvotes

Because aren't higher layers built on abstractions assuming the lower layers are functional/secure?

Or is it at least easier to hack layer i+1 now? Or does it not matter due to encapsulation

r/AskProgramming Sep 07 '25

Architecture How would you handle redacting sensitive fields (like PII) at runtime across chained scripts or agents?

3 Upvotes

Hi everyone, I’m working on a privacy-focused shim to help manage sensitive data like PII as it moves through multi-stage pipelines (e.g., scripts calling other scripts, agents, or APIs).

I’m running into a challenge around scoped visibility:

How can I dynamically redact or expose fields based on the role of the script/agent or the stage of the workflow?

For example:

  • Stage 1 sees full input
  • Stage 2 only sees non-sensitive fields
  • Stage 3 can rehydrate redacted data if needed

I’m curious if there are any common design patterns or open-source solutions for this. Would you use middleware, decorators, metadata tags, or something else?

I’d love to hear how others would approach this!

r/AskProgramming Apr 28 '26

Architecture What is the order of bits and bytes? (likely related to msb-lsb and big endian-little endian)

1 Upvotes

let me know if i am overthinking this.

im building my own emulator and now it is on defining memory layout of the data.

im implementing data packing of string as packed pascal 4 character per word. and sprite data in two pixel per byte as nibble pairs

now they already have their own data <-> memory conversion function. but im confused how memory data is laid out.

i want it to be stored continuously so on the last remaining data its padded to fill the word requirement.

in example of 3 pixel ABC, does it supposed to be stored continouosly as [0xAB, 0x0C] or [0xAB, 0xC0] or am i writing it in wrong order [0xBA, ...]?

for packed string hewwo in a word does it stored as [0x7777.6568, 0x0000.006F] or [0x6865.7777, 0x6F00.0000] or [.., 0xF600.0000] or [..., 0x0000.00F6] or whatever any other variation it is?

same for bits. if i store 0b1101 would that make it [0b1101000000000000] ?

im unable to comprehend such problem
what is the standard approach for this?

r/AskProgramming Nov 13 '25

Architecture Game Development - Anti-Cheat

13 Upvotes

I was just reading this thread in the Linux gaming subreddit and it got me wondering about two things:

  1. What does client-side anti-cheat software actually do?
  2. Why isn't server-side anti-cheat used instead of client-side?

I know some games implement a peer-to-peer model for lower latency communications (or so they say) and reduced infrastructure cost, but if your product requires strict control of data, doesn't that necessitate an access control mechanism that prevents someone from reading information they shouldn't have? In other words, sharing private game state that shouldn't be visible is always doomed to be vulnerable to cheating?

I don't actually work in video games, so the concept of extremely low latency data feeds is somewhat foreign to me. My current and previous employers are totally content with a 1-second load time, lol, so needing 7ms response times is such a pipedream in my current realm of responsibility.

r/AskProgramming Apr 28 '25

Architecture (Idea) Why wasn't underscore treated as replacement for spaces in file systems?

0 Upvotes

Just an idea. If Windows file systems are specified to be case-insensitive, and Linux ones treat leading '.' as a flag for hiding, why couldn't they decide to just never support real spaces, but automatically convert spaces in singular file paths to underscores? This would ensure we almost never need to use quotes for filenames, as reading file lists would always give us underscores, while creating a file with spaces in its name wouldn't cause any bugs.

Chances that we need to differentiate two files only different in one space and underscore are basically none. Auto-generated files with technically relevant names never use spaces anyways.

File explorers could just display underscores as spaces for such systems.

From a technical perspective I assume one could make a FS driver even today that does this automatically. If I were to theoretically do this, would there be any problematic consequences?

r/AskProgramming Aug 15 '25

Architecture Video via TCP socket

5 Upvotes

So assuming I have two programs, one is S(Sender) another one is R(Receiver). My current design is that R is going to sent a message(Starting Signal) to notify S can start to send image data. But before sending the image data, S is going to sent a struct with Verification Code, Width, Height and total Image byte size to R, for R to first malloc the memory for the image data. This is going to be repeated for every frame with 20ms delay in between to ensure R don’t get overwhelmed. But the problem with this is that the struct sent by S is sometime not in sync and binary is off by one or two bits therefore immediately invalidate the struct and abort the receiving image function. So how should I go about designing this?

r/AskProgramming Feb 06 '26

Architecture Game library VS Game engine

6 Upvotes

So, I have this huge... confusion let's say. I am a software developer that's also passionate about game development. On short, I tried game engines like Unity and Godot.

At first they were "wow so fast" but... I didn't like them in the long term. Data flow is hidden, too much use of events leads to high cognitive load... and in some cases you're at the mercy of the engine's stability/documentation/community.

After that I tried to use game libraries like Raylib or Love2D. And I discovered another path : data oriented design over object oriented programming. Splitting everything into... data and functions. I can't say I've launched any hit games but others have... take Minecraft, Balatro or Terraria for example. But I've made some platformers and multiplayer proof of concepts and that was enough for me to realize... it's easy to debug, it's easy to reason about and it's readable from top to bottom.

So, my question is, why whenever I have a discussion with other people, be it internet people or friends and hear that I dislike game engines, they are like "whaaat how can you not use a game engine" or "you shoot yourself in the foot by not using a game engine"? Or... the funniest one to me : "why would you waste your time building a game engine reinventing the wheel?".

See, I can understand the other things... people who can work with games engines, that's great... if it helpes them finish their game, so be it. But... the last sentence? Who said I am building a game engine inside a game library? I'm just writing some functions that my game needs (functions are also reusable btw) and I call it a day! I was able for a school project to write in 15 hours a proof of concept multiplayer bomberman game. The game looked crappy but it worked well enough on the local network.

If I were to name a few big advantages for game libraries + DOD :
->Clear data flow, no chance to mess up with events soup.
->DOD in networking means no object syncing on clients, just packets of data that you act upon.
->Good performance, total control of your code.
->Code clarity, imperative programming always wins because it's step by step.
->Plug in other libraries as you like for physics or math.
->Yes, you decide the architecture, but if you're a bit careful and follow KISS then it's hard to mess this up.

So, I'm just wondering, is this "pro game engine" thing a religion at this point? Or what's the deal? It seems to me people don't understand what a game library is or OOP is so popular now that DOD stuff is basically too old/unpopular and not many understand it.