r/AskComputerScience • u/cracklescousin1234 • Oct 01 '21
What do computer science students learn that electrical/computer engineering students don't?
I have worked for several years as an electrical engineer, dealing with circuits and hardware as well as performing a fair amount of software design (embedded system firmware, Python scripting, LabVIEW, etc). But I'm considering possibilities for finding more software-oriented jobs in the future, and I'm wondering what it is that CS students learned that I never touched.
My EE curriculum included a hefty dose of mathematics (calculus, linear algebra, statistical analysis and the like), plus a decent chunk of programming coursework. I learned how to program in C and C++, and between my study of digital hardware design, embedded system design, and computer architecture, I think I have a pretty comprehensive grasp of how computers work and what they can do.
My counterparts on the computer engineering side would have swapped out a couple of niche EE courses for some software-focused classes, but are otherwise not too much more exposed to software design than I am.
So what did CS students learn that I didn't? Does that consist of a deep study of algorithms? Particular fields of mathematics? Advanced software design practices and paradigms? If I want to be a competitive applicant for a software job (at, for the sake of argument, Microsoft or Google), what topics might I want to specifically target for self-study?
4
u/ghjm MSCS, CS Pro (20+) Oct 01 '21 edited Oct 02 '21
If your concern is getting a software job, then having an EE degree is fine. To get hired by Microsoft or Google, you just need to hit up leetcode and get good at reciting algorithms on demand. (Plus of course pass all the other HR filters, impress the interviewer with the quality of your character, be of sound mind and body, etc.)
1
u/cracklescousin1234 Oct 02 '21
Being a good candidate for software jobs is one of my concerns. And I actually am working on brushing up on my software-design knowledge and finding some exercises and projects to do.
But I'm also interested in learning what CS is about. I'm told that it really isn't the same as programming or software design, and I wonder what else it entails.
1
u/ghjm MSCS, CS Pro (20+) Oct 02 '21 edited Oct 02 '21
The most central aspect, as others have said, is the mathematical analysis of algorithms. The analogy here is that if software development like bricklaying, and software engineering is like architecture - i.e. deciding how best to arrange the bricks so they form a nice solid wall, then computer science is like materials science of the bricks themselves. Just like you don't have to know chemistry to use bricks, you don't really have to know theoretical computer science to write software. (Right up until you do, but that's another story.)
If you took any kind of intro to CS course, you probably had some exposure to big-O notation, and you probably know that you should use an O(n log n) sorting algorithm in preference to an O(n2) one, and the reasons why. But it turns out that this is just scratching the surface.
Computational complexity theory has been a rich area of study for the past half century or so, and computer science researchers have made some pretty startling discoveries. For example, there are categories of algorithms whose difficulty, very surprisingly, turns out to be asymptotically equal to each other. All of the following problems are, in a sense, the same problem:
Given a set of items each with a weight and price, find the most valuable set that can fit into a knapsack with a given weight limit.
Given a list of cities and the distance between all of them, find the shortest route that visits each city exactly once and then returns home.
Given a list of integers, find out if there is any subset of them whose sum equals a given value.
Given a wiring diagram consisting of arbitrarily but acyclically interconnected batteries, SPDT switches and light bulbs, determine whether any arrangement of switches will turn on all the lights.
Given two graphs G and H, determine whether G contains any subgraph that is isomorphic (ie, whose edges and vertices can be put into 1-to-1 correspondence) to H.
Given a graph, choose largest set of nodes such that none of them are adjacent to each other.
And many more.
These problems are called NP-complete, and if you solve any of them, you solve all of them. There's a whole taxonomy of complexity classes, which turn out to be a very fruitful and interesting object of academic study.
Along the way to learning this, you also learn to prove surprising things about individual algorithms, like solving recurrence relations in divide-and-conquer and dynamic programming algorithms. You can also develop a taste for interesting algorithms themselves - for example, one of my favorite algorithms is the Blum-Floyd-Pratt-Rivest-Tarjan "PICK" algorithm for finding the k-th element of an unsorted list in O(n) time, described in this paper. I would probably always use rselect or quickselect in real-world applications, but I still carry a torch for PICK because it is just so cool.
There are a lot of other interesting sub-fields of computer science - Shannon's information theory, distributed systems theory, quantum computing, AI/ML, automata theory, type theory - but computational complexity and the study of algorithms is the nearest and dearest to a computer scientist's heart.
2
u/cracklescousin1234 Oct 02 '21 edited Oct 02 '21
If you took any kind of intro to CS course, you probably had some exposure to big-O notation, and you probably know that you should use an O(n log n) sorting algorithm in preference to an O(n2) one, and the reasons why.
I didn't take such a course, unfortunately. If I had had the presence of mind to take up a CS minor instead of business, then I might have learned this stuff.
The point being that I don't know what big-O notation is. Of course, I can look that up, but I was wondering if you could maybe give me a TLDR? When you mention "an O(n log n) sorting algorithm in preference to an O(n2) one", does that mean that you want an algorithm whose time is proportionate to (n log n) as opposed to (n2)?
Regarding that point that you make about computational complexity and those NP-complete problems, is that more of an area of academic research or is it a practical problem that is being worked at in the industry? And as a possible corollary question, is that stuff covered in a typical undergrad course of study, or is it more of an advanced niche thing that is relegated to grad school?
By the way, I took a look at https://teachyourselfcs.com/ and I have found a nice list of resources for various topics. Would all of this stuff that you mentioned be elaborated in one of the textbooks or video series in the "Algorithms and Data Structures" section, such as Skiena's book or CLRS?
2
u/ghjm MSCS, CS Pro (20+) Oct 02 '21 edited Oct 02 '21
Harvard has an online intro to CS course called CS50 that people seem to like. It gives an overview of what the topics of computer science are, and then simple programming assignments in multiple languages.
In terms of algorithms textbooks, I like Algorithms by Dasgupta, Papadimitriou & Vazirani, because it's more math-oriented than CLRS, but still a pretty easy read.
Big O notation is a way of classifying algorithms by their asymptotic time complexity. Suppose you have some algorithm and you can describe its execution time in terms of the size of its inputs with t=f(n). The function f will likely be pretty complicated, and it's not obvious how to compare two algorithms f and f' and decide which one is better. So we have this notation, first introduced by Bachmann & Landau in 1894, that allows us to associate f(x) with a new, simpler function g(x). The definition is that f(x) = O(g(x)) if there exist two positive numbers m and x0 such that f(x) <= mg(x) for all x>x0. (The notation abuses the equals sign; it's not a real algebraic equality.)
Many of the complexity classes are defined by asymptotic time complexity. For example, the class P is all algorithms which are O(g(x)) where g(x) is a polynomial. The class NP is all algorithms where, given a correct solution, the algorithm for verifying (not finding) the solution is of polynomial time complexity. As I mentioned earlier, a lot of interesting things can be said about these complexity classes. The greatest unsolved problem in computer science is proving either P=NP or P!=NP. A proof that P=NP would revolutionize computing by making previously intractable problems easy, but it's much more likely that P!=NP turns out to be correct.
An algorithms course will introduce you to big O notation and show you how to analyze a given algorithm in these terms, but advanced study of complexity classes is usually a different course, called something like Computability and Complexity if offered standalone, but more often combined with automata theory (the study of formal grammars) as something like Automata and Computability. The better undergrad programs will include this, but in some schools it's not taught until the graduate program.
2
u/1544756405 Oct 02 '21
Go to the university website of your choice and compare the curriculum of a CS major with an EE major.
2
u/Poddster Oct 02 '21
I started CS but switched to CE. I did this to take more digital logic and embedded courses, and to do that I basically had to give up courses themed around AI, databases. I was happy to give them up because the database stuff was easily self learnable and at the time, 15 years ago, the AI courses were pretty dull and pointless.
I did all of the other CS stuff, such as:
compilers / programming language theory
Data structures and algorithms
computational theory (automata, p=np etc)
Logic
Computer graphics
Computer system architecture and operating systems
Distributed systems / networking
Information theory
Cryptography
Software Engineering
The only thing my EE chums too that overlapped this was software engineering! I did way more digital logic than they did, which I thought was odd
2
u/cracklescousin1234 Oct 02 '21
That last part is weird! How did that end up happening? Did the bulk of your digital logic stuff come after you made the switch to CE?
1
u/Poddster Oct 02 '21
I guess it depends on what we mean by digital logic!
Did the bulk of your digital logic stuff come after you made the switch to CE?
Pretty much. The CS student only did digital logic first year, as an introduction to logic gates and some other stuff I can't remember. Whereas CE took that onwards to do everything involved in microprocessor design, including making crappy CPUs in HDLs and instantiating them on an FPGA and doing full custom CMOS layouts for adders and things.
The EE students I knew did none of that.
However they messed about with 555 timers and TTL circuits and things like that. I'm just referring to the other stuff.
But this was 15 years ago and not long after they made some ECE course that was between EE and CE that I think was basically EE plus a lot more embedded and digital logic.
2
u/cracklescousin1234 Oct 02 '21
Whereas CE took that onwards to do everything involved in microprocessor design, including making crappy CPUs in HDLs and instantiating them on an FPGA and doing full custom CMOS layouts for adders and things.
The EE students I knew did none of that.
You lucky bastard. I only ran my crappy SystemVerilog CPU in ModelSim, and I never got to touch any kind of EDA flow from HDL to a CMOS layout. Though I did hand-build an adder in Cadence Virtuoso for a separate VLSI class. This was all only seven years ago.
2
u/Poddster Oct 02 '21
You lucky bastard.
It's the primary reason I switched, thinking about it, as even though you could still do most of the digital logic stuff whilst on CS, I wanted it ALL. I realised that I had access here to multi-million pound/dollar equipment/software that I couldn't just torrent myself or read about later. I think I asked and was told a cadence licence for all the stuff they had was like a million quid a person or something. So I made sure to seize the opportunity!
(I think that's why the EE department tried to muscle in with the ECE course. They wanted that sweet Cadence setup + small admin team the CS department had dedicated to cadence)
We did the CMOS stuff in Cadence, but I can't can't recall which subsystem it was -- it might have been Virtuoso -- because Cadence is a byzantine mismash of random crap. And that was 15 years ago. I've seen what the CEs and EEs use at various places I work and although it's had a UI upgrade it still appears to be a complete random mixup of buggy programs you lot have to suffer through.
4
u/TheKazianDusk Oct 01 '21
Speaking from what I observed between my curriculum and my roommate's curriculum, CS and EE respectively, and also keeping in mind we both graduated ~15 years ago. EE I think had a bit more math. Multivariable calc was not required in CS. EE had EMag physics classes, whereas CS only had the Kinematics and even statics was optional. CS wise, I know EE didn't take anything past Data Structures and Algorithms. So Finite State Automata, SDLC, Machine Learning, Compilers, Language Fundamentals, Networking, and of course whatever CS research projects were required for Senior year.
That being said, I know many people who have transitioned into a CS related field successfully without too much extra study. I have a friend who graduated with a degree in Industrial Engineering, and is now an SDET Lead for a pretty well known company in our home state. My advice would be to learn a programming language you want to work in, and learn it well enough to pass a programming interview exam with it. If you're and SDET, build some automation, if you're a programmer, build a project and have it hosted on github. As a manager, I would be more interested in hiring you if you have the right attitude and the willingness to learn. I can spend time and money to teach someone how to code and how to do it within company guidelines. I can't teach or give anyone the willingness to learn or the willingness to do their best at their job.
4
u/OddInstitute Oct 02 '21
This is a bit over the top on what I'd expect someone with a bachelor's in computer science to know, but it is very comprehensive if you want to know what is out there. If you haven't yet given it a deep dive, I think the biggest thing that complements low-level skills is digging into the theory and practice of building operating systems. This also goes well with learning how folks in computer science think about concurrency.
Learning a language like Scheme or Haskell might help with developing the language-focused view of computing rather than the more machine-focused view that is useful when thinking about low-level systems.
Finally, the commercial software systems at places like Microsoft or Google are much, much bigger than what shows up in most EE context, so the programming can be fairly different in order to deal with systems where it is not possible for one person to understand the entirety of one subsystem. If you want to get a taste, Chrome is largely open source. For something related, but a bit different, Facebook has open-sourced their core set of C++ components as well as a library for template metaprogramming in C++.
2
Oct 02 '21
Theoretical cs, algorithms, ai, databases, software engineering, analysis of information systems, maybe discrete mathematics.
2
2
u/ReachFit9960 Oct 04 '21 edited Oct 04 '21
I'm not sure whether you learned these things or not but it hopefully serves as a good checklist since you already did the hard part (learning how to code). I've seperated them into "data" and "meta code."
data has to do with the choosing different methods for good solutions and being aware of different algorithms to solve common problems.
"meta code" has to do with how we decide to organize our code on different levels.
Data
Algorithms (How we operate on data): binary search, BFS/DFS, A*, bubble sort, etc
Data Structures (How we store data): Stack/queue, heap, hashmap, etc
Big O, etc notation
Meta Code
Patterns (Not always taught but its always useful).
Object Oriented / Functional Paradigms (Object oriented is generally more commonly taught, but you should have an awareness of both and a working knowledge of OOP).
Clean/maintainable/readable code (Not often taught at uni, but very important on the job).
Extra
Databases/distributed systems
Computation, compilers and interpreters
If aiming for FANG, knowledge of js, css, html are gonna be required, probably also a framework (react, angular, etc). And asynchronous programming, http, and other web stuff :)
And Git is always useful
I'm not sure how well this compares to what uni students learn as courses differ, but I believe learning these thing will make you a very competitive candidate, especially if you can offer many solutions to leet code problems and decide between them.
For google the HR screenings are the hardest part, just do an ass load of leetcode problems and you good.
-5
Oct 01 '21
Writing very large programs should not be confused with small programs.
In industry, projects routinely contain over a million lines of code. Managing that so the program is reliable and stable is computer science.
2
u/cracklescousin1234 Oct 02 '21
Really? That seems like more of a software management thing. I figured that computer science is more about language- and platform-agnostic theory, kind of like a particular type of math.
10
u/S-S-R Oct 01 '21
That's software development. Not computer science.
5
u/ghjm MSCS, CS Pro (20+) Oct 01 '21
The management of very large software systems is studied academically, and this research usually takes place in computer science departments, although it may be interdisciplinary with operations research, management, etc. So this topic is within academic computer science, at least if broadly construed.
2
u/cracklescousin1234 Oct 02 '21
In that case, you might make the case that software project management is a facet of computer science. But I think it's fair to say that it isn't really at the core of the subject like how algorithms and data structures are.
3
u/ghjm MSCS, CS Pro (20+) Oct 02 '21
Sure, I agree that it's interdisciplinary rather than being "pure" computer science - in fact, I agree so much that I went back in time and said it four hours ago. But if you're talking a class in software engineering at a degree-granting institution, it's very likely to have a CSC code and be taught by the computer science department. So if you construe "computer science" to mean "what the computer science department teaches" then it seems that software engineering is part of it.
Software project management seems to me to be a branch of project management, partly because I've just never heard of it being taught by a computer science department. The few examples I could find of a university course with this title were all taught by the business school, except for Johns Hopkins, which does appear to teach it as computer science - though I couldn't quite figure out if this was an accredited, counts-towards-a-degree kind of course. (Though to be fair, I didn't try very hard to find out.)
1
u/cracklescousin1234 Oct 02 '21
Sure, I agree that it's interdisciplinary rather than being "pure" computer science - in fact, I agree so much that I went back in time and said it four hours ago.
Yeah, I don't know why I felt the need to re-iterate that point. But in my defense, I ate a copious amount of fried chicken and I was feeling the 'itis, which was screwing a bit with my cognitive functions.
1
0
Oct 01 '21
[deleted]
3
u/juju515 Oct 02 '21
human-computer interaction
ugh.... yuck...
why did you have to remind me of that shit...?0
27
u/Cybyss Oct 02 '21 edited Oct 02 '21
The fundamental core of CS, which I don't think either CE or EE would cover, is data structures & algorithms and the courses related to those.
You'll have at least two, and sometimes three, courses where you learn all about:
Sorting algorithms (at minimum bubble sort, quicksort, merge sort, and heap sort).
Search algorithms (linear search, binary search, depth-first-search, breadth-first-search, and perhaps A* search, as well as variations on these targeting different kinds of data structures).
Shortest path, minimum spanning tree, and network flow algorithms (e.g. Dijkstra's algorithm & the Bellman Ford algorithm for shortest paths, Primm's algorithm & Kruskal's algorithm for minimum spanning trees, and Ford Fulkerson's algorithm for network flow - as well as several others).
String matching algorithms (e.g,. largest common subsequence & largest common substring, perhaps the Knuth Morris Pratt string matching algorithm).
You may have a unit on Huffman encoding (has to do with text compression).
You'll also learn an enormous variety of data structures. Stacks, queues, linked lists, binary trees, AVL trees, Red Black trees, directed & undirected graphs, the Union Find data structure, heaps, hashtables & hashsets, priority queues, and perhaps several others.
You'll also learn a lot about algorithm analysis. That is, how to mathematically prove their correctness and determine their asymptotic time & space complexity. This is all the Big-O, Big-Omega, and Big-Theta you may have heard about (e.g, why bubble sort is said to take O( n2 ) time). You'll apply this analysis to every data structure & algorithm that is taught.
That all is just the data structures & algorithms courses. Then you have the courses which build on them:
Programming language design. This includes not only a survey of programming paradigms (procedural (C), functional (Lisp/Haskell), object oriented (Java), and logic (Prolog)), but also covering how interpreters & compilers are made. This includes things like parsing algorithms, abstract syntax trees, how to maintain a symbol table, lexical vs. dynamic scoping, call by reference vs. call by value vs. call by need and how to implement those in your own programming language. Such courses will also cover memory management and garbage collection algorithms.
Theoretical computer science, where you explore different models for computation and their associated languages (finite automata & regular expressions, pushdown automata & context free grammars, Turing machines & lambda calculus). You'll also learn about what it means for a problem to be NP-Hard or NP-Complete and review what problems cannot be computed at all (the Halting Problem being the main one).
Artificial intelligence. The field changed quite a bit since I took it (2006), but at that time it covered mostly propositional & first order logic and algorithms for deducing information given a knowledge base in this format.
You'll also take courses in how operating systems work - mostly covering how file systems work, how operating systems manage memory & protect processes, and how they handle concurrency & parallelism (e.g, how to implement monitors, locks & condition variables, and semaphores for controlling access to data, the causes & dangers of race conditions and deadlocks, and the algorithms behind how threads & processes get scheduled).
In addition to that, you'll also take software engineering courses. Some people will say these bits aren't real computer science, but a proper 4-year CS degree program will cover these nonetheless. These bits include:
The software development lifecycle. How to gather requirements, how to model use cases, how to architect large software systems via an object oriented approach (lots of UML class diagrams), studying the different kinds of dependencies you can have between classes, functional & non-functional testing techniques, and working in a team.
I'm sure I'm leaving out a lot, but if you've done computer engineering you're probably pretty familiar with the rest (e.g., assembly language programming).
There's a lot more that's covered, but the vast majority of it really is rooted in data structures & algorithms.