<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Voider</title>
    <description>The latest articles on DEV Community by Voider (@voider).</description>
    <link>https://dev.to/voider</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F678543%2F2ee7b788-067a-4f1e-adda-1577a4f1cbfc.png</url>
      <title>DEV Community: Voider</title>
      <link>https://dev.to/voider</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/voider"/>
    <language>en</language>
    <item>
      <title>Why Every Software Engineer Should Learn Computer Architecture. </title>
      <dc:creator>Voider</dc:creator>
      <pubDate>Tue, 03 Aug 2021 20:47:56 +0000</pubDate>
      <link>https://dev.to/voider/why-everyone-software-engineer-should-learn-computer-architecture-2nb2</link>
      <guid>https://dev.to/voider/why-everyone-software-engineer-should-learn-computer-architecture-2nb2</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Computer Architecture?
&lt;/h2&gt;

&lt;p&gt;According to Wikipedia:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Computer architecture is a set of rules and methods that describe the functionality, organization, and implementation of computer systems.&lt;br&gt;
Some definitions of architecture define it as describing the capabilities and programming model of a computer but not a particular implementation. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In a nutshell, CA is basically the set of rules that control how hardware and software interact together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Study Computer Architecture?
&lt;/h2&gt;

&lt;p&gt;Computer Architecture can help you more than you think. &lt;br&gt;
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!&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Why you should learn Computer Architecture:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You will likely use it for the rest of your life.&lt;/li&gt;
&lt;li&gt;Computer Architecture is one of the most fundamental subjects in Computer Science. As without computers, the field of Computer Science would not exist.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example On How Computer Architecture Can Affect The Way You Code:
&lt;/h2&gt;

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

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.ca.emap.com%2Fwp-content%2Fuploads%2Fsites%2F9%2F2014%2F01%2Fbigstock_railway_6220241-1024x685.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.ca.emap.com%2Fwp-content%2Fuploads%2Fsites%2F9%2F2014%2F01%2Fbigstock_railway_6220241-1024x685.jpg" title="Railway junction" alt="Railway"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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,&lt;br&gt;
makes sense?&lt;/p&gt;

&lt;p&gt;Consider an if-statement: At the processor level, it is a branch instruction:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.stack.imgur.com%2FpyfwC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.stack.imgur.com%2FpyfwC.png" title="Railway junction" alt="code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you are a processor and you see a branch, you have no idea which path to go, so you will have to enter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you guess right the execution will never have to stop.&lt;/li&gt;
&lt;li&gt;If you guess wrong, you spend more time going back and restarting the execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So how do we make the better choice each time?&lt;br&gt;
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&lt;/p&gt;

&lt;h3&gt;
  
  
  This is, more or less, how Branch Prediction works.
&lt;/h3&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Learn Computer Architecture, become a better software engineer.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;Special thanks to the reviewer, Rawan Attia.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>computerscience</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Why I shifted from C++ to JavaScript.</title>
      <dc:creator>Voider</dc:creator>
      <pubDate>Mon, 02 Aug 2021 09:17:26 +0000</pubDate>
      <link>https://dev.to/voider/why-i-shifted-from-c-to-javascript-2gll</link>
      <guid>https://dev.to/voider/why-i-shifted-from-c-to-javascript-2gll</guid>
      <description>&lt;p&gt;In this article I will talk about shifting from a compiled language (CPP) to an interpreted language (JS).&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I have been coding for almost 3 years now and my native language has been C++ for most of that time, but recently I have been preferring JavaScript and I will cover why in this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which is better?
&lt;/h2&gt;

&lt;p&gt;Answering this question depends on what do you want to achieve, for example if you want speed then you should definitely choose C++, you can look up tons of comparisons online between the two languages.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why am I preferring JS recently.
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;I am a very lazy person and I try to use my brain capacity to the very bare minimum, so using a tool that handles my frontend and backend at the same time saves me the hassle of integrating things together if they are of a different language.&lt;/li&gt;
&lt;li&gt;It takes a whole lot less time (and brain capacity) to learn, I didn't even realize how hard C++ was until like a year later, but this will significantly help you as a software engineer.&lt;/li&gt;
&lt;li&gt;You can do so much with so little code, for example let's say you have an array of animals that has a name and species:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var animals = [
  { name: 'Fluffykins', species: 'rabbit' },
  { name: 'Caro',       species: 'dog' },
  { name: 'Hamilton',   species: 'dog' },
  { name: 'Harold',     species: 'fish' },
  { name: 'Ursula',     species: 'cat' },
  { name: 'Jimmy',      species: 'fish' }
]

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and you want to copy the names of all the animals to another array, the normal way to do this is by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
var names = []
for (var i = 0; i &amp;lt; animals.length; i++) {
  names.push(animals[i].name)
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  taking up 87 characters
&lt;/h3&gt;

&lt;p&gt;but thanks to JavaScript's ES6 arrow functions we can do this in literally one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var names = animals.map((x) =&amp;gt; x.name)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  taking up 38 characters
&lt;/h3&gt;

&lt;p&gt;you literally just saved up writing 49 characters for yourself, if you can't see beauty in this I don't know when will you ever do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Last word
&lt;/h2&gt;

&lt;p&gt;Again this is not a comparison at all, I am just stating my personal experience, you should use what's best for what you are working on and what you feel most comfortable with. Thanks for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>cpp</category>
    </item>
  </channel>
</rss>
