DEV Community

Lane Wagner for Boot.dev

Posted on • Originally published at qvault.io on

Learning Some Computer Science will Make You a Better (And More Expensive) Engineer

Alan Turing, the “Father of Computer Science”

Software Engineering != Computer Science

Software engineering is the process of analyzing user needs and designing, constructing, and testing end user applications that will satisfy these needs through the use of software programming languages

Techopedia

Computer Science is the science that deals with the theory and methods of processing information in digital computers, the design of computer hardware and software, and the applications of computers.

https://www.dictionary.com/browse/computer-science

Software Engineers -> Computer Scientists -> Mathematicians
https://xkcd.com/435/
xD

Computer scientists are not necessarily software engineers, and unfortunately many software engineers don’t necessarily know much about computer science. Software engineers are focused on building products, and writing maintainable code and architecture. Computer science is comprised of the fundamentals that software engineering is built upon, and by understanding more about CompSci, we can be much better engineers.

A Shift in Front End Development

Front-end development has really come into the limelight over the last decade, with frameworks like React, Angular, and Vue.js championing that movement. A lot of functionality that previously was provided by server-rendered template pages (PHP, Django, Rails) now exists as a decoupled front-end bundle.

This is fantastic news for a couple reasons. First, I’m of the mindset that this decoupling is a good architectural decision. Second, it means that front-end developers take on more responsibility, which allows them to become better engineers and earn more monies.

Years ago, when front-end work was more HTML and CSS and less Javascript, front-end development was less development and more design. For that reason, to work on the front-end developers didn’t need as much of a background in computing as they did in design.

Nowadays, front end developers need to have strong logic and programming skills not only because they will be required to handle more logic in the browser, but because there is a high chance they will be asked to do server work in Node.

Learning the Fundamentals – What to Start With

There are millions of topics in the computer science field, and no one understands them all, but below I’ve listed some good starting points.

Big-O Notation

https://xkcd.com/399/

Big-O deals with time complexity. In other words, how to keep programs fast. By learning about algorithm speed, we understand how to sort data for display, utilize databases for better performance, make applications more responsive, and so much more!

We also learn how cryptography and security work on the internet, because they deal with keeping encryption fast and brute-force decryption slow.

https://rob-bell.net/2009/06/a-beginners-guide-to-big-o-notation/

Memory Management

What are the stack and the heap? Pointers? Memory leaks? If you have never worked in a compiled language like C++ or Go, I would recommend doing a pet project or two.

For those who work primarily in memory managed languages like JavaScript or Python, it is important to understand how memory works under the hood. Even though the interpreter (which was likely written in C++) handles memory management, we can still run into problems by not understanding the fundamentals.

Pointers: http://www.cplusplus.com/doc/tutorial/pointers/

Stack vs Heap: https://medium.com/fhinkel/confused-about-stack-and-heap-2cf3e6adb771

Memory Leaks: https://www.geeksforgeeks.org/memory-leak-in-c-and-how-to-avoid-it/

Processor Architecture

How does a processor know to take the expression:

5 + 3;
Enter fullscreen mode Exit fullscreen mode

and add the numbers 5 and 3?

Who taught the processor to understand the Arabic numerals? The answer of course is that it doesn’t, processors only work bitwise, on binary numbers.

Javascript is ran by an interpreter (Node.js or the browser) which is a compiled program. The interpreter was written in a compiled language, like C++ or Go, but then compiled into raw byte code that the CPU understands. To get a better handle on how computers actually, you know, compute things, writing assembly code can be very helpful.

Assembly is the native language of the processor, and writing a bit of it can really help us understand how the CPU processes stuff. Because assembly is so tightly coupled to CPU architecture, the language changes depending on the processor type. I recommend starting in ARM, it has a more elegant syntax than x86 in my opinion.

Writing ARM Assembly (Part 1)

INTRODUCTION TO ARM ASSEMBLY BASICS

Threading

Ever wondered how computers do multiple things at once? In most programs we write, there is a simple flow of logic, everything happens sequentially. If we are writing code that runs in the browser, then most code is fired based on events, but the fact remains that two instructions are never ran at the exact same time.

Threading is the practice of utilizing multiple processors, or processor cores, to do computations at the same time. Threading is a powerful but dangerous art. Threading allows us to speed up our programs by using the computer’s architecture to our advantage, but can introduce bugs like deadlocks or race conditions.

Writing a toy program in Go and making use of virtual threads, called goroutines, is a great way to get your feet wet with threading.

Goroutines: https://tour.golang.org/concurrency/1

Thanks

Thanks for reading! I hope that learning more about some of the concepts I’ve outlined will be useful to you in your career!

By Lane Wagner @wagslane

Download Qvault: https://qvault.io

Star our Github: https://github.com/q-vault/qvault

The post Learning Some Computer Science will Make You a Better (And More Expensive) Engineer appeared first on Qvault.

Top comments (8)

Collapse
 
mburszley profile image
Maximilian Burszley
  1. Bytecode is still run by an interpreter (such as V8)
  2. Python is written in C for the standard implementation (it's a bit ironic you use this example and then say it's probably written in C++)
  3. Threading does not mean multi-core
Collapse
 
wagslane profile image
Lane Wagner
  1. True, but out of scope for the article.
  2. True. I used probably because I wasn't referring to anything specific
  3. Good point, although the take advantage of the some of the biggest differences between threading and async operations, you will need multiple instructions running at the same time.
Collapse
 
mburszley profile image
Maximilian Burszley

multiple instructions running at the same time

That would be multi-processing. Multi-threading isn't necessarily concurrent and does not necessarily take advantage of multiple cores or processors (i.e. implementation-specific detail)

Collapse
 
byrro profile image
Renato Byrro • Edited

I would also suggest maybe an edit to clarify your thoughts on the Threading part, Lane.

Might confuse people. Instead of threading, maybe use "concurrency". Instead of "multiple cores", maybe use "handling multiple jobs/tasks". This would make it more generalistic (if that word even exists).

Threading will handle jobs concurrently (quickly switching between one and another, when it makes sense - e.g. IO-bound tasks).

But threads won't help with parallelization (performing multiple tasks simultaneously). In this case, we really need multiple processors, as you mentioned.

Collapse
 
byrro profile image
Renato Byrro

Hey Lane, thanks for instigating for more CS knowledge pursuit. I definitely agree every software engineer should have this in the roadmap.

"Processor Architecture" is the only topic I might not agree entirely.

I've learned this when was playing with Texas Instruments CIs and Arduino and RaspberryPi.

It was really fun to learn how transistors work, MOS gates and all this stuff.

I don't think it makes me a better software engineer though.

Can't relate to how it's helpful in my developer day-to-day work. I would still go ahead and learn again if I had to, but more to satisfy an intellectual interest.

What's your view and experience?

Collapse
 
wagslane profile image
Lane Wagner • Edited

I had a job where I worked with really low level programming, writing firmware and implementing an SPI protocol from scratch. I agree that the amount of jobs are fewer, but by understanding those fundamentals, I now am able to more easily work in an entire growing industry: IOT.

Collapse
 
ravergod profile image
ravergod • Edited

Nice article! For real! I only want to add some thoughts about Threading:

As far as I know, threading is when a process is divided in smaller processes so they can run parallel to each other, but, they still are part of the parent-process. In that way they can use different resources and that single thread can perform better. Which means, if the parent-process is killed, then their child or children would be either.

BUT, you don't necessarily need a multi-core processor to do multi-threading. If a single-core processor has multi-threading technology, it will do with only a single-core anyway.

core != thread

Anyways, it's a very interesting subject. I didn't know how hard is to code in assembly xD

Collapse
 
wagslane profile image
Lane Wagner

Totally right! I hope people see this comment, I didn't realize until now that I worded it poorly.