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

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

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.

dictionary.com/browse/computer-science

xkcd.com/435

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

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;

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)

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!

Hit me up on Twitter @wagslane if you have any questions or comments.

Follow me on Dev: @wagslane

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