DEV Community

loading...
Cover image for Why Every Software Engineer Should Learn Computer Architecture.

Why Every Software Engineer Should Learn Computer Architecture.

Voider
A CS student, I like coding, cycling, photography and coffee brewing.
・3 min read

Introduction

I believe that success greatly correlates to two things, how you see the world and how much you truly understand it. We can say the same about software engineering; where computer architecture is the very essence of software engineering, if you understand it well enough, software engineering will be a piece of cake.

What is Computer Architecture?

According to Wikipedia:

Computer architecture is a set of rules and methods that describe the functionality, organization, and implementation of computer systems.
Some definitions of architecture define it as describing the capabilities and programming model of a computer but not a particular implementation.

In a nutshell, CA is basically the set of rules that control how hardware and software interact together.

Why Study Computer Architecture?

Computer Architecture can help you more than you think.
For example, most F1 drivers know a lot about their car's engine, to the point they can determine any problem with their engine, even before their engineers can!

They also know about Physics and Aerodynamics, hence this helps them give precise instructions to their mechanics in the Pitstop, like adjusting the nose or the wheels leading them to win more races.

Well, what does all this have to do with CA? It’s the same concept! When you understand and know more about the cornerstone of Software Engineering, you know how to handle problems and achieve what you need, more efficiently.

Why you should learn Computer Architecture:

  • You will likely use it for the rest of your life.
  • Computer Architecture is one of the most fundamental subjects in Computer Science. As without computers, the field of Computer Science would not exist.
  • You need to understand how the instructions and operations actually work and interact together, to make your software better; because whatever you do, no matter what, it is on top of CA.
  • Computer Architecture will help you design, develop, and implement applications that are better, faster, cheaper, more efficient, and easier to use because you will be able to make informed decisions instead of guessing estimating and assuming.

Example On How Computer Architecture Can Affect The Way You Code:

Branch Prediction: Let's say you are on a train, your job is to observe the way and you are at a railway junction:

Railway

You have to choose a side and you don't know which side to go on; so you either choose the right path or the wrong path, if you do choose the right path you will keep going, if you choose the wrong path however, you will go back and choose the other path. So if you keep choosing the right path you won't have to go back again and if you choose the wrong path you will keep having to go back and forth,
makes sense?

Consider an if-statement: At the processor level, it is a branch instruction:
code

Now you are a processor and you see a branch, you have no idea which path to go, so you will have to enter.

  • If you guess right the execution will never have to stop.
  • If you guess wrong, you spend more time going back and restarting the execution.

So how do we make the better choice each time?
We observe. If the process, usually takes left then we guess left. If it takes right most of the time, we guess right. If it alternates, then we alternate our choice as well

This is, more or less, how Branch Prediction works.

Conclusion

Learn Computer Architecture, become a better software engineer.


Special thanks to the reviewer, Rawan Attia.

Discussion (52)

Collapse
sharpninja profile image
The Sharp Ninja

I think every developer should have to take a standardized test and be licensed to write code for a living. Would probably put a stake in the heart of Ruby and Python.

Collapse
jeffabailey profile image
Jeff Bailey • Edited

That kind of dogmatic behavior is what is wrong with the tech industry and humanity as a whole.

Seriously, try expanding your mindset.

Collapse
leob profile image
leob • Edited

Spot on, yes this is a fine example of some narrow minded elitist thinking, probably with the idea to keep "outsiders" out of "our" industry, and to protect the privileges of the 'incumbents' lol. Yes let's raise the barriers by subjecting all newcomers to some arbitrary and useless algorithm tests, artificial gatekeeping with a nice hidden agenda if you ask me, terrible idea if I ever heard one.

Thread Thread
sharpninja profile image
The Sharp Ninja

No, it only keeps out people incapable of passing the test, which there should be no controversy about.

Thread Thread
leob profile image
leob

And who's going to decide what will be in that test? And you're seriously thinking that you can come up with one standard test that makes sense for people doing vastly different work, all of which we conveniently lump together under "software engineering" or "development" or whatever you want to call it? The industry is just too broad, this could work for specific segments but in no way indiscriminately across the board.

Thread Thread
sharpninja profile image
The Sharp Ninja

I belive that various industries would be responsible for providing questions and answers relevant to their industry. I think Universities or other experts can be hired to create the core test. When you take the test, you pick the industries you want to be certified in and when you get licensed those industries are listed on your license.

Thread Thread
leob profile image
leob

Yeah nice, let's all create a boatload of unnecessary bureaucracy and busywork to solve, well, what exactly? An imaginary problem ... I'm glad you're not in charge of running the government or a major company

Collapse
sharpninja profile image
The Sharp Ninja

No, I won't reconsider my position. Programming is fundamentally about algorithms and applying them reaponsibly. Too many devs act like they are Picasso on a keyboard but in reality they cause chaos and waste time and money.

Thread Thread
jeffabailey profile image
Jeff Bailey

You just described most of humanity. Do you think that taking a hardline point of view will change everyone?

Thread Thread
sharpninja profile image
The Sharp Ninja

Yes, a licensure program would create accountability. It's crazy that a CEO can go ti jail for the idiocy of a programmer but the worst that would happen to the programmer is having to post an updated Resume on Dice without any way to discover their incompetence.

Thread Thread
leob profile image
leob

Total nonsense, you're trying to provide a solution in search of a problem. Does your idea guarantee that the industry will attract the best and most talented people? i don't think so, it just reeks of artificial gatekeeping. Fortunately the principles of free market economy won't ever let this happen.

Thread Thread
sharpninja profile image
The Sharp Ninja

That's funny. The principles if federal regulations after things like Solar Winds make it inevitable.

Thread Thread
leob profile image
leob

Not really, because comparing SolarWinds to a mom & pop shop doing WordPress sites would clearly be comparing apples and oranges, yes? Both are doing "software development", however one is arguably a little bit more mission critical than the other. But both should undergo the same sort of licensing and certification? I think that's a total waste of time and resources, instead require this where it makes sense, not across the board.

Thread Thread
drumstix42 profile image
Mark

Have a new user handle for you:
The Not-So-Sharp, Close Minded Ninja.

And no, I won't reconsider my position.

Thread Thread
leob profile image
leob

The whole idea is nuts but once someone is obsessed with their own "brilliant" idea then it's generally extremely hard to convince them they're wrong, I'm absolutely about to give up and say "yes fine, whatever".

Collapse
dienand profile image
DieNand

Admittedly nowadays it's way too easy to get into programming, the thing is though the truly gifted programmers would probably just laugh in the face of your test and just keep writing code anyway.
As for your comment about Ruby and Python, both these languages are great and they both have their place. Not every piece of software needs to be written in C/C++.

Collapse
dienand profile image
DieNand

Also at the end of the day it is the responsibility of the company to weed out the good candidates from the bad ones. It's called an interview.

Thread Thread
leob profile image
leob

Exactly, this is not the government's responsibility, and forcing "every" developer (regardless of what he/she actually does) to take an standard exam sounds like the worst idea ever. So who all would be included, also the person in the accounting office writing Excel macros? He/she is also undeniably a "coder".

Collapse
leob profile image
leob • Edited

"Every developer", how do we even define that? An accountant writing Excel macros is also writing code, hence is a coder or 'developer'! This idea is only feasible and remotely realistic if you apply it to specific well-defined segments of the industry, like SCADA programmers building mission critical stuff, industrial control applications, and that's an example where it would have added value.

P.S. "putting a stake in the heart of Ruby and Python", that's just toxic, and painful/denigrating for people who love these tools and get stuff done with it ... I'd say spare us your negativity and your elitist mindset, and don't pollute dev.to with it!

Collapse
sharpninja profile image
The Sharp Ninja

I think it applies to anybody performing development work, including training AI modules, that has a material impact on financial statements or other regulated areas of operations.

So, an accountant writing macros on a worksheet is already licensed as an accountant and that is a skill expected in that field. A mechanical engineer coding on a sensor is possibly licensed and thus covered. A front end dev pulling ing 1200 NPM packages for a site collecting PII of customers for a promotion should be licensed and educated to understand the risks of failing to protect that PII from 1200 3rd party vendors. A DevOps engineer writing CI/CD pipelines for apps that are supply chain components should be licensed and educated on proper testing and bundling of build artifacts.

Thread Thread
leob profile image
leob

Okay, nice try with the accountant writing Excel macros already being licensed - how about a junior intern writing those Excel macros? ... not licensed in anyway, but he/she does write code.

So my argument remains - how do you define which devs or coders or whatever are required to get that official license, and which don't ... software development is just way too broad an activity and an industry to be regulated centrally, it's going to cause a ridiculous amount of cost, hassle and bureaucracy with hardly any tangible benefits.

The only thing I can imagine is that you could require this for very narrowly defined areas of expertise within the software development industry, for instance SCADA programmers working on mission critical systems, like I said before. In no way is it practically possible to require this across the board, it isn't even possible to clearly define who is a developer or software engineer and who isn't (too many grey areas and edge cases).

Thread Thread
leob profile image
leob

Okay, now you're talking:

"anybody performing development work, including training AI modules, that has a material impact on financial statements or other regulated areas of operations"

So, that does not sound like a blanket across-the-board entry exam or license for every developer (if 'developer' can even be clearly defined) - it sounds like specific requirements or certifications for specific industries or roles, so for situations where it matters.

That's different from what you said before, and now we're getting pretty close to agreeing on this, because under those circumstances I could see the merits of licensing or certifications. But, we're then talking about a much more narrowly defined segment of "hard core devs working on mission critical stuff".

Thread Thread
sharpninja profile image
The Sharp Ninja

It's a lot broader than you think. Any dev working on or with access to code that effects financials and/or PII or other regulated data (HIPAA comes to mind) would be included. That means writing a login form at a non profit. That means writing devops scripts at a local bank. The cases where someone wouldn't fall into the realm of needing licensure are slim. Licensed pros coding their field of expertise get covered, but general programming help has to either be narrowly scoped or go take the test.

Thread Thread
leob profile image
leob

No the cases aren't slim, they're the majority ... you're serious that most people now working in development are unqualified to do so and should preferably be ousted and only let back in after passing your "exam"? I think the cure here is much, much worse than the ailment ... unless you happen to be in the business of developing all of these certifications and making big money off of that ...

The issues you're trying to solve are minor and mostly theoretical, the tool to solve them are well, a very big and blunt sledgehammer ... if ever the powers to be would mandate this kind of thing (lord forbid), it would just be a total and utter disaster.

Thread Thread
leob profile image
leob

Yes, everyone should go take the test, because, well ... because you say so. This gets weirder by the minute, I'm so glad that you're not in charge, and that this idea has zero chance of becoming a reality. Get a life, let everyone just do their job without assuming they're incompetent, give us all a break LOL

Collapse
sharpninja profile image
The Sharp Ninja

Anyone selling solutions based on Ruby is a charlatan. There are no advantages to Ruby from a business perspective. The devs are really expensive, the performance is horrible, and gets exponentially more costly as a startup approaches unicorn status, and then they get to rewrite in a real platform at the last minute as the rails collapse around you.

Thread Thread
leob profile image
leob

Okay, nice how you discredit yourself with this comment, because every single argument you're putting forward here can be refuted with the simple counter argument "it depends". It all depends on the business and technical requirements - it's 100% clear that there are plenty of use cases where Rails is perfectly fine as a solution, and plenty other cases where it isn't. It's never black and white, as always, it depends ... I rest my case.

Thread Thread
sharpninja profile image
The Sharp Ninja

For any publicly traded company, using Ruby should be grounds for a share-holder suit for intentionally wasting money.

Thread Thread
leob profile image
leob

Give me a break, get real, you clearly have a totally irrational bias or hatred towards ... a tool? What has Ruby done to you to deserve this? LOL

Collapse
shivenigma profile image
Vignesh M

Trust me, software and tech industry improved a lot only because we didn't have any stupid form of gatekeeping like this.

The hacker mindset and permissionless nature of code is the fundamental of the innovation.

Collapse
sharpninja profile image
The Sharp Ninja

I don't see any lack of innovation in electronics or mechanical engineering, yet they have strong professional licensing programs.

Collapse
leob profile image
leob

Lol you want to put up artificial barriers (keep salaries high?), and what does it have to do with Ruby and Python? Weird thought, but fortunately it ain't gonna happen.

Collapse
sharpninja profile image
The Sharp Ninja

Education includes learning about ROI, scale, supply of hardware to run said Ruby or Python in produxtion.

Collapse
voider profile image
Voider Author

I agree

Collapse
incrementis profile image
Akin C.

Hello Voider,

thanks for your article.
I agree with your conclusion that learning computer architecture will help you become a better software engineer :)!
And a question comes to my mind, "How do you train to become a Computer Architect?".

Collapse
voider profile image
Voider Author

Hello Akin,
I recommend reading computer organization and design by David A. Patterson and John L., that's where I knew about CA during my last semester, but I also recommend learning the basics of assembly so that you can 'link' the concepts you will know about from the book from a closer level of abstraction.

Collapse
adelfelf profile image
adelf-elf

I wish we could not assume questions like this, i see it everywhere, not exact question but such computer questions, definately its a "newbe" asking but if they took time to read ur article, please answer them to ur best.....you dont know how much you do to that person

Thank u

Collapse
amine1996 profile image
amine1996 • Edited

I agree that knowing CA is useful. However, the optimization you make on a if statement will only really be useful in high performance context. Adding lot of checks like this in an environment where performance is not the highest requirement will only make your code harder to read.

Collapse
voider profile image
Voider Author

I agree with you, the range of knowledge you need to know will vary depends on what you need to do.
I will be covering the levels of abstractions for most of the software requirements hopefully.

Collapse
rezahussain profile image
Syed Ali Reza Hussain

My semester exams are going on and I'll be writing my Computer Architecture exam in the coming 10 hours. I've hated every moment of preparing for this subject. But after reading this article, I guess I'll give it a try. Thanks man

Collapse
voider profile image
Voider Author

I am happy to hear that man, and good luck with your exam I hope you do great!

Collapse
srchip15 profile image
SriNath

Liked reading your article. IMHO book recommendations or links to other types of resources would enhance your piece. I do see that as part of the discussions section however embedding the same in the article itself would be better.

Collapse
sopulumax profile image
Sopulu-max

For those who read this. You've probably heard of the 80/20 rule. You're looking at one. Learning computer architecture is the 20% of the work that'll get you 80% of the result.
Great post and Great advice

Collapse
jaiko86 profile image
jaiko86

I'm sure developers would benefit a lot from a lot of things. As a frontend engineer at a big cloud networking company, I think a lot of people will benefit from knowing about encryption, cryptography, networking, frontend engineering, and UI/UX concepts.

So this is to say that computer architecture is not really for everyone. I won't benefit at all from knowing this information. There are far more pressing things I have to learn in this field than computer architecture.

For instance:

  • How do I improve accessibility of the website for people with disabilities?
  • How do I load faster? What sort of chunking strategy should I use?
  • Should I start to transition to Web Components?
  • How do I better optimize for search engines?
  • WebGL, web workers, etc.
  • At least have a working knowledge of all the major frameworks: React, Vue, Angular, Svelte, etc.
  • Learn webpack and other bundlers in depth
  • Get caught up in the latest JavaScript standards and syntax
  • Better use of CSS to improve site performance.

You see, NONE of these will even come close to anything related to the systems. For frontend developers, everything happens through the browser, so inconsistencies across browsers, etc. are the thing to worry about. Not computer architecture.

Collapse
abanoub7asaad profile image
Abanoub Asaad

Good Job, Badawy
Keep going πŸ’ͺ

Collapse
voider profile image
Voider Author

Thanks Abanoub!

Collapse
rawanattia profile image
rawanattia

Great article!! Keep it up!

Collapse
voider profile image
Voider Author

Thank you so much.

Collapse
zyabxwcd profile image
zyabxwcd

I would love to read some more example translating into real scenarios when you program. The branch prediction one translated into if condition was really interesting.

Collapse
voider profile image
Voider Author

check out caching, it will help you really well on how to use your data structures better, you can also check how function calls really work, also instruction-level parallelism and out of order instruction scheduling

Collapse
tardisgallifrey profile image
Dave

Precisely why every dev, programmer, coder or whatever should learn some assembler, even if they don't use it regularly.

Collapse
mimahmed profile image
Mim Ahmed

You are right. CA is most important for Software Engineers