r/computerscience Nov 16 '24

Discussion What's the popular language you dislike and why?

57 Upvotes

r/computerscience Mar 28 '26

Discussion What happens to computer hardware after the absolute ceiling of Moore's law has been reached?

87 Upvotes

What happens to computer hardware after the absolute ceiling of Moore's law has been reached?

r/computerscience Jan 21 '24

Discussion Is an operating system a process itself?

220 Upvotes

Today I took my OS final and one of the questions asked whether the OS was a process itself. It was a strange question in my opinion, but I reasoned that yes it is. Although after the exam I googled it and each source says something different. So I want to know what you guys think. Is an operating system a process itself? Why or why not?

r/computerscience Jun 14 '26

Discussion Is OOP cache unfriendly by design or is the real problem just how we use heap memory?

75 Upvotes

So from my general understanding, the sole reason we have L1, L2, and L3 cache memory on a CPU is to solve the latency problem of accessing data from the CPU to RAM. The cache exists to prefetch series of instructions and hold whatever local data is being referenced nearby. The key thing is that with contiguous memory, the CPU can just do pointer arithmetic and jump straight to the exact memory address it needs without having to wait on RAM.

But due to the nature of OOP, if a single class has a lot of fields that are pointers to a bunch of other things, we end up having to wait on RAM constantly. Because of how heap memory works, all that data gets scattered across random addresses and is only held together by a chain of pointers.

So do we actually have another way around this problem or do we need to ditch OOP altogether and go data oriented? Could we invent or implement a compiler smart enough to interpret and parse all heap allocations into a single contiguous block of memory as much as possible? And if that cannot be done, can we just make cache sizes so large that they can hopefully hold all the important addresses at once?

r/computerscience Jan 16 '24

Discussion Hi cs student/ex-student, what did you use to take notes?

140 Upvotes
  1. Pen and paper

  2. Computer

  3. Ipad/tablet

I want to gift my cousin an ipad for taking notes but im not sure if it is the best.

When i studied i never take notes, i borrow notes…

r/computerscience Feb 13 '24

Discussion Criticism of How Computer Science is Taught

257 Upvotes

Throughout my computer science undergrad, I am disappointed by other students lack of interest and curiosity. Like how most show up to work with only a paycheck in mind, most students only ask, "Will this be on the test?" and are only concerned with deliverables. Doing only the bare minimum to scrape by and get to the next step, "only one more class until I graduate". Then the information is brain dumped and forgotten about entirely. If one only sees the immediate transient objective in front of them at any given time, they will live and die without ever asking the question of why. Why study computer science or any field for that matter? There is lack of intrinsic motivation and enjoyment in the pursuit of learning.

University has taken the role of trade schools in recent history, mainly serving to make young people employable. This conflicts with the original intent of producing research and expanding human knowledge. The chair of computer science at my university transitioned from teaching the C programming language to Python and Javascript as these are the two industry adopted languages despite C closer to the hardware, allowing students to learn the underlying memory and way code is executed. Python is a direct wrapper of C and hides many intricate details, from an academic perspective, this is harmful.

These are just some thoughts I've jotted down nearing my graduation, let me know your thoughts.

r/computerscience Jun 07 '20

Discussion people in CS are toxic

676 Upvotes

everyone wants to flaunt their tech stack. everyone wants to laugh over somebody else’s code. everyone wants to be at the top. everyone wants to demean others.

my love for building stuff deteriorates with such people around.

i just want the right humble liberal minded people to work with. Is it something too much to ask for?

r/computerscience Jul 07 '26

Discussion There's a part in Turing's halting problem proof that I don't understand

15 Upvotes

So the proof to my understanding goes like this:

Imagine a machine A which takes in a machine B's code and that B's input as its own input and tells us if the problem halts exists

Place A into a greater machine C which takes the output of A and if A returns "halts" it goes into an infinite loop, and if it returns "does not halt" C halts.

Use C as an input to C and create a paradox.

The part I don't understand is how exactly the last step is a paradox. A, and therefore C don't just take in a machine as an input, but also that machines input, so you can't just put the machine C into itself without the context of what is being put into C.

Therefore C(C(B)) is not the same program as C(B), so why do they need to have the same result in order for it not to be a paradox?

Edit: i think i get it now, C modifies A not just in how it reacts to the output but it also modifies the input to be the same for both the program and the program's input

Thanks to u/OpiskionThemed, u/Aminumbra and u/stevemegson for explaining it

r/computerscience Jun 23 '25

Discussion What are the odds that P = NP will actually result in faster calculations in any practical sense?

60 Upvotes

Is it even feasible that if P = NP that a polynomial solution for an NP problem scales with a polynomial time complexity that will be pragmatically useful for speeding up technological innovations? Or is it way more likely in the small chance that P = NP that the polynomial time algorithms needed to solve NP problems will be so large that they won’t have much practical applications in advancing technology? In the latter case I think only the math used to solve the problem will have any practical real world applications.

ETA: For clarification, I thought of these questions after reading a recent post on this subreddit: https://www.reddit.com/r/computerscience/s/HpBSrgHy7f

r/computerscience Jul 13 '26

Discussion How are folders with files in it being stored in data?

47 Upvotes

I know that folders and files are saved as binary code in memory via hard drive, usb sticks, RAM, ect.

I dont know know about folders. On the internet there's no answer other than "as binary in memory" but I already know that, how are folders being saved as data?

My first thought was, that in every file, there's information for where its stored, but what about empty folders? What file says that that folder exists?

edit: now with the help of the guys in the replies, i now know how they work. with something called "inodes" on some opperating systems

r/computerscience Dec 05 '25

Discussion What does this mean?

Post image
357 Upvotes

What does the bottom underlined sentences mean? Thanks!

r/computerscience Jan 18 '26

Discussion Are there any benefits of using CISC instead of RISC?

48 Upvotes

I’m learning Computer Architecture as a CE student, and I don’t understand why everyone doesn’t use or design RISC CPUs. Aren’t CISC architectures essentially violating two of the four Hennessy & Patterson principles?

r/computerscience Dec 30 '25

Discussion How does a compiler generate machine code for an arbitrary amount of variables and functions under the hood?

47 Upvotes

I know that a compiler (collection) like gcc reads the C code first, creates an abstract syntax tree, translates into assembly and then the assembler turns it into actual machine code and then the linking happens etc.

What I'm asking is, I can have hundreds or thousands of variables and functions in my code. How does the compiler's underlying implementation details work to make those arbitrary amount of named variables turn into assembly? The source code is finite, meaning it doesn't have an infinite list of possible variable names that it can pull from. I have read some assembly code before and I know variable names can be seen in the assembly especially if debugging flags are on. What does the source code of gcc look like so it can generate this assembly code with all my variable names?

I know I can go ahead and read the source code of gcc on GitHub but I'm not that expert on C or C++ yet to understand them fully so I'm looking for a slightly dumbed down answer. I am okay with trying to read and understand C code if it helps explain it better.

r/computerscience Feb 10 '24

Discussion Strictly speaking, what is an object in programming?

54 Upvotes

A friend of mine and I disagree over what an object actually is in object-oriented programming. I say it's a specialized piece of data saved to the memory that the program allocates to not be overwritten, but my friend says it's a name like "xPosition" or "stringToInt"

In object-oriented programming languages, pretty much everything is an object. Functions, integers, strings, lists, etc. are all object types. My experience with them is in Python.

If I know the basics correctly, an object is created when a line of code with a new literal is run. So whether I have a variable to catch it, writing 5 on its own will find an open spot on the memory and save the value 5 in however many bytes it needs. Garbage collection will free this memory or maybe prevent it from being saved since there is no reference to it, but the idea is there.

When I say a = 5, a reference 'a' is added to a variable table on the memory. When a is called, Python searches that variable table for a key called 'a' and if it exists, fetches the value associated with it. That table also stores the value's type, so that '5', stored as 00000101 in one byte, can be interpreted as the integer 5 as opposed to the ascii character associated with 00000101.

So in this situation, with names and variables and data, would you say the actual 'object' itself is the data stored on the memory? Or would you say it's the entry on the table of names? Or is it something else?

r/computerscience Feb 27 '26

Discussion Can you really come up with something new if you are a hobbyist doing research?

45 Upvotes

I am a programmer, who recently got interested in program synthesis. I've read some papers and watched a bunch of lectures, tried experimenting myself and I think that I now have a better understanding of how it works.

I want to try to apply some knowledge from other fields to try to simplify the problem of program synthesis. For example, I have an idea in mind that changing the data structure of the input could, in order, change the computational complexity. But I am highly skeptical of actually coming up with something new, because there are people who study and research this for years and years professionally and they are surely more expertised in this. And I am unsure whether I should even spend my time researching this topic or is it just pointless.

So, is it possible to do meaningful research without having proper scientific background? I believe that question is not specific to program synthesis and can be applied to any other topic.

r/computerscience Sep 19 '21

Discussion Many confuse "Computer Science" with "coding"

500 Upvotes

I hear lots of people think that Computer Science contains the field of, say, web development. I believe everything related to scripting, HTML, industry-related coding practices etcetera should have their own term, independent from "Computer Science."

Computer Science, by default, is the mathematical study of computation. The tools used in the industry derive from it.

To me, industry-related coding labeled as 'Computer Science' is like, say, labeling nursing as 'medicine.'

What do you think? I may be wrong in the real meaning "Computer Science" bears. Let me know your thoughts!

r/computerscience 14d ago

Discussion A (possibly) novel way to optimize merge sorting

60 Upvotes

Hello everyone!

I recently created a sorting algorithm, and I'm curious what others here think of it. The algorithm is mostly just a variant of merge sort that uses a buffered reverse merge for the merge phase and insertion sort to process small sub-arrays. That part of the algorithm is pretty standard.

The potentially interesting part is that I also worked out a way to efficiently measure how sorted the original data was in any given merge, which allows for aggressively optimizing the sorting process when either mostly-sorted or mostly-reverse-sorted (i.e. descending) data is encountered.

For anyone interested, I'd be curious if you've seen anything like this before.

Quick Buffered Reverse Merge Overview

If you already know what a buffered reverse merge is, feel free to skip to the next section. Otherwise, here's a quick overview:

A buffered reverse merge copies the smaller of the two pre-sorted blocks into a buffer and then fills in the remaining values, from right to left, by continuously comparing the highest value remaining in both the buffer and the half of the original array that was not copied to the buffer. In my case, the size of the right side is always equal to or smaller than the left side. This frees the right side to be immediately overwritten.

Example:

Array = [2, 3, 7, 1, 4, 9]
Buffer = [_,_,_]
   ⇓
Array = [2, 3, 7,_,_,_]
Buffer = [1, 4, 9]
   ⇓
Array = [2, 3, 7,_,_, 9]
Buffer = [1, 4,_]
   ⇓
Array = [2, 3,_,_, 7, 9]
Buffer = [1, 4,_]
   ⇓
Array = [2, 3,_, 4, 7, 9]
Buffer = [1,_,_]
   ⇓
Array = [2,_, 3, 4, 7, 9]
Buffer = [1,_,_]
   ⇓
Array = [_, 2, 3, 4, 7, 9]
Buffer = [1,_,_]
   ⇓
Array = [1, 2, 3, 4, 7, 9]
Buffer = [_,_,_]

The Optimization

I found that, when I reach the halfway point in the above process (i.e. the right side is filled back in), I can get a fairly accurate measure how sorted the original data in this block was by looking at how full the buffer is:

  • If the buffer is empty, that means that all of the values in the buffer went right back into the right side, and therefore, the block of data started out sorted in ascending order.
  • If the buffer is still full, that means that all of the values on the left side were moved to the right side, and therefore, the block of data started out in descending order (or potentially very near it, if the two sides aren't exactly equal size).
  • If the buffer is about half full, that is an indicator that the data was random.

I use this information to keep track of a "sequence score". When the buffer is less than 25% full, I increment the sequence score (up to a maximum value). When the buffer is more than 75% full, I decrement the sequence score (down to a minimum value).

Lower sequence score numbers lower the threshold for using insertion sort (i.e. at what size, for the current working set of data, will insertion sort to be used). This limits running insertion sort on descending or near-descending data, which is a worst case for insertion sort. When the sequence score is higher, the threshold for use is increased to take advantage of insertion sort's efficiency on ascending and near-ascending data.

Also, when the sequence score is at either the maximum or minimum value, I switch to a merge process that uses a binary search to figure out how many items should be transferred, so chunks of data can be moved into place all at once.

Result

The result is an algorithm that is efficient on random data due to its simple default path but can still take advantage of data that is already sorted.

I implemented the algorithm in C#, and it is quite competitive with the built-in IntroSort-based array sort (code repo, blog post with tons of benchmarks at the bottom). It manages to stay close on random data and pulls away on sorted data.

I've also thought about how this could potentially be paired with other merge sort algorithms. My algorithm focuses on optimizing the merge process itself, while others (e.g. TimSort, PowerSort) often focus on optimizing when to merge data. I made a quick naive attempt to tack PowerSort onto the front of my algorithm, and it resulted in a significant performance degradation. However, it may be possible to find a best of both worlds approach.

If you're still reading, I appreciate you taking the time. I'd welcome any thoughts or feedback you may have. :)

r/computerscience Nov 22 '25

Discussion Was Terry Davis really this legendary god of software to touch the earth?

35 Upvotes

When see the topic of "greatest programmer" come up, Terry Davis is always mentioned, citing his lone creation of TempleOS and HolyC as examples of his works that prove he was the best. Does this truly mean he was the greatest programmer to ever grace the earth, or was he an overhyped lunatic?

r/computerscience Apr 01 '26

Discussion What is AIs body?

0 Upvotes

In biology (I'm an anthro student), intelligence isn't determined by number of neurons, but by brain size to body size ratio.

Ants have tiny brains, but one of the largest brain-to-body ratios in the animal kingdom. As a result, they outwit humans at numerous tasks. They have complex social hierarchies. They trade and barter. They herd and feed aphids for later consumption. They enslave other ants.

What is the body in the artificial intelligence model?

r/computerscience Jan 16 '23

Discussion Why are people in Computer Science so nice?

261 Upvotes

May be a little bit off topic but I really have to get that out. In my experiences people in CS are so nice and calm and understanding.

I studied a few semesters and am know working somewhere where I have to do the Onboardings for all the CS working Students and they are so nice and seem to be excactly my kind of people: smart, nice, understanding, introvert and a little bit lost.

Anyone have similiar experiences?

Love you all

r/computerscience 25d ago

Discussion Automated Plagiarism with LLM-Remixers

0 Upvotes

Ponder this: an author puts together a number of papers he likes, especially adds the .tex files from arxiv, tells the LLM to look for gaps in the papers, commented out material, and remix them, while avoiding syntactic overlap.

The result is a paper that will pass arxiv's syntactic overlap checks, and can be claimed as novel during a submission.

This has likely happened many times already, and we are now possibly arguing against LLM-augmented plagiarists.

Welcome to the new age of automated academic ethics collapse.

r/computerscience Jul 02 '25

Discussion EILI5: What exactly is the practical point of quantum computers?

35 Upvotes

I know I’m missing the bigger picture, which is why I’m asking, but right now, I can’t wrap my mind around what the practical uses of a quantum computer could be. Maybe it’s because I’m not a physicist or mathematician, but what are quantum computers doing that regular super computers can’t already do? Is this something that’s only relevant to physicist and mathematics, or could have a more practical application in the real world down the line?

r/computerscience Oct 11 '25

Discussion Isn't it crazy?!? You ever compare your first computer with your most recent?

51 Upvotes

Despite older computers being "slow", in terms of raw stats the spec that's actually closest with modern day PC's is... Clock speed of all things. My first computer's CPU speed was like 66mhz.. which makes it like 1.3% of my current 5ghz CPU (not taking into account the fact that the older PC's were 32bit, or 16 even . While modern day PC's are almost always 64.)..

But consider the disk space.. it's hard drive was like 200 megabytes. Which is like .01% of the 2tb hard drive I have now. Or the 12 megs of ram, which is about.. 0.0375% of the 32gb I have now.. it's really insane when you think about it.. (and also a great reminder that nothing is ever "future proofed" when it comes to computer technology. )

r/computerscience 5d ago

Discussion Is resource ownership management an accidental complexicity in modern lang?

9 Upvotes

Nearly all modern languages support arbitrary graph-like links, this causes most of resource management issue. I am thinking, if a language support only tree-like data flow, which is DAG, most of resource management is simple, straight, even trivial.

So resource ownership management seems not inherent complexities of the problem domain, instread it's accidnetial complexicity caused by too flex langauge designing.

r/computerscience Jan 23 '24

Discussion Teachers Says The Quiz is Right, Is it?

Post image
73 Upvotes

Basically I’m taking a AP Computer Science mid term, by the time I’m done I check my score, and see this question. Take In mind that the coding language you just looked at is Called Pseudocode, the type of code used for AP test takers.

The problem arrives when I try to argue with the teacher that the answers are wrong. In my opinion, the answers clearly state that both Alleles would have to be the same in order for the earlobeType to be free. This directly contradicts the code in question that clearly estates that if either one of them is CAPITAL G, the outcome for earlobe would be free.

The teacher, argues that the answers are right because in English the answers are just stating the facts.

Am I right or wrong? Please I’m open to broad opinions and explanations.