r/AskComputerScience

is clean code usually not fast?

to be specific i'm writing a cpu-based rasterizer. the maths are not difficult but i find a strange property: if i divide the procedure into some small functions, the code looks cleaner and is easier to maintain but a bit slower. on the contrary if i put everything into a single procedure, it looks stupid but fast. why is that? an example illustrating this

code 1:

if cross_product(x0,y0,x1,y1)>0 then zzz

(and i write a "cross_product" function separately)

code 2:

c=x0y1-y0x1

if c>0 then zzz

code 3:

if x0y1-y0x1>0 then zzz

if i write the entire algorithm in the style of "code 3", it runs the fastest. "code 1" is slowest

is it normal?

reddit.com
u/20260819 — 19 hours ago

How do large software teams avoid conflicts when many developers work on the same codebase?

I mostly work on projects alone, so I’m trying to understand this from a computer science / software engineering perspective.

When a large team has many developers working on the same codebase at the same time, how are conflicts and broken changes usually handled?

I know Git can handle merge conflicts, and CI/CD can catch some broken builds, but I’m curious about the bigger picture:

  • How do teams reduce the chance of two people changing the same logic in incompatible ways?
  • What role do tests, code reviews, branching strategies, and ownership rules play?
  • Are there common patterns or systems used to keep large codebases stable?
  • Does AI-generated code change this problem in any meaningful way, or is it still handled by the same processes?

I’m not asking for career advice or tool recommendations. I’m trying to understand the engineering concepts behind how large teams keep software development organized and reliable.

reddit.com
u/orelrevivo — 3 days ago

How does encryption of messages work over the internet?

For example, Facebook messenger says that it is fully encrypted end to end. But if it is sent over Wi-Fi that is not secure, can the data still be seen?

On the flipside if you’re using a messaging service that is not secure, but the Wi-Fi is secure, will the data still be able to be seen?

reddit.com
u/WiggWamm — 4 days ago

I'm a theoretical physicist, and feel algorithms are out of place and data doesn't exist

I have a PhD in theoretical physics and never got on with experimental physics. I've spent several years in software engineering.

This is going to sound weird, but intuitively I don't believe in data, and algorithms seem out of place, like how you get to the answer is irrelevant. Practically speaking, I find algorithms easy to learn and use, and see how they make things faster. But I still don't intuitively understand why they're involved. It's like computation itself makes no sense to me.

I strongly feel there is a good reason to feel this way, one founded in mathematics, logic or even philosophy, but I don't know what it would be. It does remind me of how quantum computers don't compute things in the "this then that" fashion that digital computers do, that they - and correct my hand-wavy understanding if I'm wrong - just "coalesce" on the answer.

Does anyone recognise this?

reddit.com
u/QuarktotheCosmos — 3 days ago
▲ 15 r/AskComputerScience+1 crossposts

Any books similar to SICP Chapter 5?

I loved Chapter 5 of Structure and Interpretation of Computer Programs. Building a virtual register machine with an assembler and compiler in Scheme. Are there any other books/online classes or resources that involve building a computing machine (or any machine) from scratch using code?

reddit.com
u/Bongril_Joe — 4 days ago

Difference between address width, addressability and word size.

I’ve been reading through a computer systems book to become a more knowledgable programmer and I’m not fully understanding the difference between the concepts of address width, addressability and word size. This is how I currently understand them:

Address width refers to the size of pointer data — that is, the value of the pointer. The address width determines how many possible addresses are capable of representation and thus, is one factor in determining the total size of addressable memory.

Addressability refers to the size of data stored at a given address.

Word size refers to the “natural” unit of instruction of the processor. Conventionally, most CPU registers have a width that corresponds with the address width so that a full pointer fits inside a single register. This simplifies the set of operations necessary for the CPU to understand.

I think the connection between address width and word size is what I’m most confused about. For example, if the address width was 2x the word size, would that mean that the CPU would need a combined “read+move” instruction to fully process a single pointer?

reddit.com
u/Junior-Title-1987 — 5 days ago

Why can't I find a genuine certification course for free?

It has been almost 2 months since I've been finding a legit, widely recognized and respected certification course on DSA in Python, And I am very surprised to know that there aren't any courses available on the internet that provide certificates after completion for free.

If you do know any free certification courses, then please let me know. I cannot afford to spend much on courses.

Thanks!

reddit.com
u/DARKEN_side_of_me — 5 days ago

How do you choose a CS capstone when AI has made implementation so much easier?

I'm about to start my undergrad capstone, and I've been struggling on how to think about it, especially since AI has changed the way (or at least the perception) on how to approach junior/mid-level software projects.

For most of my degree, the assumption has basically been that you learn to program, understand how things work under the hood, and use that to build something useful.

But, with AI, implementation has become really cheap! You can prototype, degug, and heck, even build fairly complex applications entirely w/ AI.

For those who have done a capstone recently, how did you approach choosing a project? Did you look for a genuinely difficult problem, interesting engineering constraints, something research-oriented, or just a useful product?

I’m curious how people who've been through this recently, would approach a capstone, from scratch today.

reddit.com
u/danielfeltonia — 7 days ago

can someone PLEASE help me

im trying to create a 8-bit binary adder with logic gates in logisim evolution and im genuinely dying, this does not look like anything i have ever seen online, im probably the first to discover this horrendous looking mess of logic gates (a little exaggerated). Can someone please tell me how to make actually make this properly?

reddit.com
u/Powerful-Mind9268 — 6 days ago

Should Computer Science be your only focus during university

So I’m in sophomore year on my CompSci degree, and this summer I found interest in reading literature, editing, and other stuff in general.

I found interest in these stuff since I saw that I lack skills in some areas, being emotional intelligence, being well read and spoken, etc.

I have various projects and 2 internships in Full-Stack development.

But my programming skills have gotten worse.

So my question is: Should I give my 100% to learning CompSci or should I also develop other skills?

Thank you!

reddit.com
u/AdOnly5924 — 9 days ago

being alone on Computer science path

Hi, I'm really tired of going down this path alone; it's affecting my learning and my deadlines, and I'm falling behind others.
anyone have any ideas for this situation?
I think about communities ...

reddit.com
u/Stock_Nothing4528 — 9 days ago

Is anyone else losing their passion for CompSci ?

I am losing passion and interest in CompSci/programming/IT, and I would like to know if there are some other people going through the same thing.

Some context:

I started programming at a relatively early age (16yo*), which was around 2020, before LLMs** and coding agents.

I discovered it and started doing it because I was really curious and deeply interested in science and tech. And it directly clicked. I liked the idea of having an idea in your head and then programming it and making it come true, something from your head to the real world.

I liked the thinking you had to go through, and the problems you encountered, and how you had to think really hard to find a solution and see it work after implementing it. It was really satisfying, and boy, I spent hours and hours coding and researching and understanding complex architectures. You know, when you're a kid, you have a lot of free time, and I used to code day and night, staying up until 4 or 5 am coding.

All of this just to tell you that everything I built, I understood it from top to bottom, and I knew every detail and expected every behavior, knew why and how and what my code did exactly. I could answer every question about my apps, why I chose some architecture or why I did something a certain way or what my code did or didn't do, etc.

Also, something very important: I used to talk with a lot of CompSci peers that actually knew what they were doing, just like me.

Fast-forward, we're in 2026. I graduated, and now I'm working in IT, but everything changed. Now, with the rise of coding agents and LLMs, at work, LLMs do all the coding work and even big parts (if not all) of the architecture. So now everyone is expecting you to go very fast because of this. You're forced to delegate all the architecture and coding work to the LLMs.

Result of this: you have a very light idea of what your app code does exactly and how it does things. I mean, sure, you go through the code that the AI wrote, but come on, it will never be like code you wrote line by line and know every detail of and expect its behavior.

Also, what PISSES ME OFF is that you can't answer most questions about your code, because you were forced to delegate your work to the AIs, and now you don't know how it works. You're asked a question, and you start to stutter because you need your claude to be near you.

And the last thing, no one really knows what they're doing anymore. There no longer are any interesting talks about architecture or implementations. It's mostly just, "well let's ask what claude thinks about this..."

People that started programming not out of passion but just because they heard that CompSci pays a lot and code exclusively from 9 to 5 might not understand this, which is fine. I am not belittling anyone, and I don't expect everyone to be passionate about their job. But you know, I think these guys won't necessarily feel this. They might be just like, "Oh cool, AI does my job, I can chill a little" which is understandable, but in my case, this is what makes me lose passion. We're no longer doing the hard parts.

Bottom line: the field is advancing, which is great. It is changing, and you can't do anything about it. But in this change, the things that used to be my passion are disappearing, and I don't know what to do with my life ahaha

My first idea is to somehow change fields, and leave programming and CompSci only as a pleasure and an activity I do at home, because I can no longer stand it being my job and forcing me to develop AI slop.

I have nothing against AI and LLMs. If it allows us to ship faster and more cheaply, then it will be adopted, whether I want it or not. I am not saying we shouldn't use AI. I'm just expressing my feelings and how my passion for CompSci is fading away.

Does anyone feel like me?

*16yo might sound not that early for some, but in my country it is.

** LLMs existed back then but were not used for coding, and it was pre-chatgpt revolution.

reddit.com
u/redaben_ — 13 days ago

I don't know anything about computer science. Can you explain to me how can I calculate number of steps in an algorithm? How do we count them? Are there atomic instructions for the machine that we can count as one step?

I have recently read about RAM model in a book which explains what a single step in an algorithm is but I don't understand

reddit.com
u/Open_Recording_2281 — 14 days ago

Does empirical complexity analysis in a container on a server pose any problems?

I haven't worked with servers or containers that much and so I wanted to ask if I try to measure the complexity of an algorithm, by repeatedly running the script with larger n, how likely is it that my measurements will be falsified?
If I do the same approach on a desktop the differences in time measurements depending on, memory and other processes running on the computer are negligible. Is there any difference when I am trying to measure on a server while that same server is also handling requests and do you think this is going to cause me problems with assessing the complexity correctly?

reddit.com
u/silvers_puppet — 13 days ago
▲ 11 r/AskComputerScience+3 crossposts

how can i build a CA model to portray diseases (like alzheimer's) in 2D/3D?

i've been messing around with cellular automata and the Game of Life to see if glider guns can model disease growth, specifically brain related diseases such as alzheimer's and the build up of amyloid-beta plaques. however, i'm also heavily interested in portraying this in 3D, like maybe a model of cells in a brain-like shape, similar to this project: https://community.wolfram.com/groups/-/m/t/3502932

if i was doing something more similar to the latter idea, i would use CA to model the decay of brain tissue instead, at least in the case of alzheimer's.

if anyone has experience or advice to give on how i should go about portraying this (if i go more so the first route, i should use Golly/GoL, probably; if i go the second route, i should use Python, Wolfram, or smth else? maybe?) that would be greatly appreciated!! ideally, i'd like to eventually do both projects.

i also have a paper that i wrote on CA, and i'm willing to DM it to anyone, as it aligns with the projects i have in mind. i would also love some advice on the paper.

tysm!

u/-vanillaBeans- — 14 days ago

How to study computer science?

Hi everyone. I have a master's degree in software engineering since 2019 and now, I'm studying for a competitive exam that covers fairly advanced topics of algorithms, databases and software engineering.

The thing is, I've never been particularly strong. And years later, I have no idea how to study academically for this major. I believe I need to practice with lots and lots of exercises. Do you please have resources for it ? Like exercises with solutions (advanced level) or from where can I get them ?

I'm self studying so I dont have access to university or professors...

Thank you in advance.

reddit.com
u/Aji_three — 13 days ago

Help regarding System Design of Online Competition/Quiz for an Edtech Platform

I am working in a startup which is an AI edtech ,

I am working in backend and am trying to design the exam/ quiz module

Users : <5000 in initial phase

And I would really like your advises on a few points

Eg. Should I store the ongoing state of exam in redis or db or both

should I use SQL or MongoDB/Dynamo DB

And I am sure there are many points I am ignoring

So please if anyone has worked in an edtech company's or project or can help me with the same , will be really appreciated,

I couldn't find relevant production grade implementation in the internet,but if theres any resource , please share the link

reddit.com
u/happyy_developer — 13 days ago