<?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>Forem: Saifur Rehman Khan</title>
    <description>The latest articles on Forem by Saifur Rehman Khan (@saifu0).</description>
    <link>https://forem.com/saifu0</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%2F580318%2F00b24557-c4b0-4bf3-bd34-b081678e87e8.jpeg</url>
      <title>Forem: Saifur Rehman Khan</title>
      <link>https://forem.com/saifu0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/saifu0"/>
    <language>en</language>
    <item>
      <title>Clean Code - Part 1</title>
      <dc:creator>Saifur Rehman Khan</dc:creator>
      <pubDate>Sun, 24 Nov 2024 04:36:36 +0000</pubDate>
      <link>https://forem.com/saifu0/clean-code-part-1-npi</link>
      <guid>https://forem.com/saifu0/clean-code-part-1-npi</guid>
      <description>&lt;p&gt;This is a 6-part series article on Clean Code. I used (&lt;a href="https://www.youtube.com/watch?v=7EmboKQH8lM&amp;amp;list=PLmmYSbUCWJ4x1GO839azG_BBw8rkh-zOj" rel="noopener noreferrer"&gt;YT&lt;/a&gt;) video from Robert C. Martin aka Uncle Bob as a reference. If you want to deep dive in each topic discussed here, please refer to the video and/or the book 'Clean Code by Robert C. Martin'. &lt;/p&gt;

&lt;p&gt;Now let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should you care about Clean Code?
&lt;/h2&gt;

&lt;p&gt;Clean code acts like a well-defined communication protocol when you are working on a project along with your teammates or on an open source project. You want to write code which is not just understandable by a machine but also by your fellow programmers. A computer can understand 10k lines of code(if written syntactically correct) even if you put it in a single line with no spaces but I bet your peers will have a hard time understanding it. Clean code makes debugging, reading codes(which you will be doing more than writing in Software Engineering), perhaps teaching?, etc a lot easier and more efficient. &lt;/p&gt;

&lt;h2&gt;
  
  
  What is Clean Code anyway?
&lt;/h2&gt;

&lt;p&gt;Programs which is simple, direct, elegant and efficient. Clean code does only one thing and does it well. No surprises i.e when you are reading it, it should only do what you are expecting. It should look like well-written prose and by someone who cares.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules of function
&lt;/h2&gt;

&lt;p&gt;A function should be small typically from 4 to 20 lines. It must do only one thing. How do you know if a function is doing more than one thing? If you see a function and you can extract another one from it, the original function is doing more than one thing. You should keep extracting functions from one another until it stops making sense to extract any further. Each function should have a proper name and it should be a part of appropriate classes(functional programming?) and modules.&lt;/p&gt;

&lt;p&gt;However having a hard requirement of a function of line between 4 to 20 can be difficult because sometimes a function which is doing only one thing could grow more than 20lines. Additionally, if you are on a line of code which is result of call of 10 different small functions, it will be hard to backtrack when you are debugging or trying to understand it. so, keep it balanced and try to follow the "One function - One job rule" more strictly rather than "length of code rule". &lt;/p&gt;

&lt;h2&gt;
  
  
  Function arguments/parameters
&lt;/h2&gt;

&lt;p&gt;How many arguments function should take? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function should not take more than 3 arguments(Soft rule). Anything more than three should be an object.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Passing a Boolean to functions should be avoided if possible. Why?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Because when you are passing a boolean to function, most likely there will be a &lt;code&gt;if&lt;/code&gt;/&lt;code&gt;else&lt;/code&gt; statement in that function and code in the &lt;code&gt;if/else&lt;/code&gt; block could be extracted out as two different functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Avoid &lt;code&gt;switch&lt;/code&gt; statements
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;switch&lt;/code&gt; statements are great for small, finite and well-defined sets cases eg parsing commands or options but they can become a painful dependency management problem if you are calling different modules in your switch statements. &lt;/p&gt;

&lt;p&gt;Lets understand this with an example, Shapes.&lt;br&gt;
We have shapes like triangle, rectangle, square, circle, etc. We want to perform some actions based on shapes like rotate, draw, stretch, get number of sides, etc. If we have bunch of &lt;code&gt;switch&lt;/code&gt; statements floating around for each actions, what will happen if we want to add new shape? Exactly, find all the &lt;code&gt;switch&lt;/code&gt; statements and add actions for this new shape. And what will happen if we want to add an action which can be only true if two or more conditions satisfy? Also what does rotate or number of sides means in case of Circle? You see the problem. For such cases, Polymorphism works best as it follows &lt;strong&gt;Open-Closed&lt;/strong&gt; rule.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Open-Closed Principle - Software entities (such as classes, modules, and functions) should be open for extension but closed for modification.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  No Side-effects
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;A side effect in programming is any change a function makes outside of returning a result, such as modifying a variable, updating a file, printing to the console, or interacting with the outside world.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Some example of side-effect functions can be &lt;code&gt;open()&lt;/code&gt; and &lt;code&gt;new&lt;/code&gt; in C++. These side-effect functions comes in pair like open/close, new/delete, acquire/release, etc. &lt;/p&gt;

&lt;p&gt;Does that mean we should not use these functions? Ofcourse you are going to use them if you write in C/C++ but the important point here is to make sure you handle them properly. That's why some programming languages comes with Garbage collection to avoid memory leaks but still you need to manage a lot of things by hand for most of the cases.&lt;/p&gt;

&lt;p&gt;But side-effects are not only limited to language's built-in methods/functions, we can very easily introduce them and suffer while debugging or when trying to understand someone else's code. For eg, our &lt;code&gt;int userId&lt;/code&gt; might very easily insert a user id in database and return it. How to avoid it? &lt;strong&gt;Ans: Command and Query Separation&lt;/strong&gt;.   &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Command and Query Separation (CQS) is a software design principle which states that a method (or function) should either perform an action (a command) or return data (a query), but not both.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay that's that but what can you do to enforce proper resource/transaction management like reading from a file and closing it, connecting to a database and closing the connection, serving a request which can change two or more states, etc? &lt;strong&gt;Ans: Exception handling&lt;/strong&gt;&lt;br&gt;
You can have a &lt;code&gt;finally&lt;/code&gt; block which will release the resouce or can do cleanup for you if you don't want a partial completion of the request and so on. But avoid having bunch of code before the try block and code after except/finally block. The function/method which has this exception handling logic should only call functions/methods which can throw. Also, Never ever use nested try/catch blocks.&lt;/p&gt;

&lt;h2&gt;
  
  
  DRY
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Don't Repeat Yourself&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pretty self-explanatory ig? Just try to avoid having repeated code all over the place. Move repeated codes in functions(pass arguments if needed) and modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Test your code
&lt;/h2&gt;

&lt;p&gt;How would you know if the code you wrote is not going to break? &lt;em&gt;Well, I tested the the feature and it works.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But what if it breaks or behave differently on different sets of arguments/situations? What if a simple arithmetic operation can overflow if correct datatype is not choosen or you got more strings in your fixed sized string array? The small or big changes/additions to the software can break the system or can be a bottleneck in the pipeline and you might have to wake up at 3am to fix it or backout and can impact clients.&lt;/p&gt;

&lt;p&gt;To avoid these kind of situations, we write tests to test our code before shipping it to clients. There are many types of tests such as unit, integration, system, A/B, etc. Although more coverage means more confidence in your code, having unittests and integration is more common you will see in most of the codebases. So, try to write good, robust and good coverage tests.&lt;/p&gt;

&lt;p&gt;--&lt;br&gt;
That's it for this article. Lmk if something is incorrect or missing. Thank you.&lt;/p&gt;

</description>
      <category>cleancode</category>
      <category>softwareengineering</category>
      <category>computerscience</category>
      <category>designpatterns</category>
    </item>
    <item>
      <title>Representing and Manipulating Information in modern computer - Part 2</title>
      <dc:creator>Saifur Rehman Khan</dc:creator>
      <pubDate>Thu, 21 Nov 2024 01:16:00 +0000</pubDate>
      <link>https://forem.com/saifu0/representing-and-manipulating-information-in-modern-computer-part-2-5125</link>
      <guid>https://forem.com/saifu0/representing-and-manipulating-information-in-modern-computer-part-2-5125</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/saifu0/representing-andmanipulating-information-in-modern-computer-part-1-594h"&gt;Link&lt;/a&gt; to Part 1&lt;/p&gt;

&lt;h2&gt;
  
  
  Addressing and Byte ordering
&lt;/h2&gt;

&lt;p&gt;A 4-byte &lt;code&gt;int&lt;/code&gt; in a 32-bit machine stores all its 4 bytes in contigous sequence of bytes. It can be store in two way namely &lt;code&gt;Little endian&lt;/code&gt; and &lt;code&gt;Big endian&lt;/code&gt; depending on machine. Not going much into details a &lt;code&gt;Little endian&lt;/code&gt; stores an &lt;code&gt;int&lt;/code&gt;(4bytes on 32-bit) of hexadeciaml value &lt;code&gt;0x01234567&lt;/code&gt; something like following(assuming starting address is &lt;code&gt;0x100&lt;/code&gt;):&lt;br&gt;
  Addresses/Values&lt;br&gt;
   &lt;code&gt;0x100&lt;/code&gt;         67&lt;br&gt;
   &lt;code&gt;0x101&lt;/code&gt;         45&lt;br&gt;
   &lt;code&gt;0x102&lt;/code&gt;         23&lt;br&gt;
   &lt;code&gt;0x103&lt;/code&gt;         01&lt;br&gt;
and similary a &lt;code&gt;Big endian&lt;/code&gt; will look like following:&lt;br&gt;
  Addresses/Values&lt;br&gt;
   &lt;code&gt;0x100&lt;/code&gt;         01&lt;br&gt;
   &lt;code&gt;0x101&lt;/code&gt;         23&lt;br&gt;
   &lt;code&gt;0x102&lt;/code&gt;         45&lt;br&gt;
   &lt;code&gt;0x103&lt;/code&gt;         67&lt;br&gt;
I hope you can see the difference in the ordering. Linux 32bit, Windows, Linux 64bit follows &lt;code&gt;Little endian&lt;/code&gt; whereas SunOS/SPARC follows &lt;code&gt;Big endian&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is important because when sending a message over a network from &lt;code&gt;Little endian&lt;/code&gt; byte ordering machine to &lt;code&gt;Big endian&lt;/code&gt; byte ordering machines and vice-versa could be an issue. Most of the programmers don't find it is an issue because networking applications are written in a way which does this convertions for us but if you are writting an network application, you might need to consider this.&lt;/p&gt;

&lt;h1&gt;
  
  
  Integer Arithmetic
&lt;/h1&gt;

&lt;p&gt;You might be surpised to know, adding two positive number can result in a negative number and x &amp;lt; y can give you different result then x - y &amp;lt; 0. &lt;/p&gt;

&lt;p&gt;Let me give you an example, lets say we have a computer which stores an &lt;code&gt;int&lt;/code&gt; as 4-bit and we have two &lt;strong&gt;unsigned int&lt;/strong&gt; x and y.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;unsigned int x = 10; // binary rep: 1010&lt;/code&gt;&lt;br&gt;
&lt;code&gt;unsigned int y = 15; // binary rep: 1111&lt;/code&gt;&lt;br&gt;
&lt;code&gt;unsigned int z = x + y;&lt;/code&gt; // ??? &lt;/p&gt;

&lt;p&gt;The value of z is 25. right? right?&lt;/p&gt;

&lt;p&gt;Well no. If you convert 25 into its binary representation, it comes out to be 11001 but as I mentioned our computer can only store 4-bit integers(values from 0-15 incase of unsigned). So, what will our computer do with the extra 1-bit? You are right, it will drop the higher-order bit(first bit from left) and we will get 1001 which converts to 9. This is same as doing module with 16 ie &lt;code&gt;25 mod 16=9&lt;/code&gt;. This behavior of computer not limited to arthmetic is also called &lt;code&gt;Overflow&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But why I'm using &lt;code&gt;unsigned int&lt;/code&gt; here? Will this addition behave differently with &lt;code&gt;signed&lt;/code&gt; integers? &lt;/p&gt;

&lt;p&gt;Answer: Yes but before explaining what will the result and how our computer ended up with that, lets first understand how signed and unsigned is different with our 4-bit size integer.&lt;/p&gt;

&lt;h4&gt;
  
  
  signed integers
&lt;/h4&gt;

&lt;p&gt;They can store positive and negative both numbers values from -8(bin rep: 1000) to 7(bin rep: 0111). The higher-order bit(first bit from left) is the one which gives signed integer negative values and rest of the bits yields in positive. So, to get smallest number we need to flip higher-order to 1 and other bits 0 and to get largest number we need to flip higher-order bit to 0 and other bits to 1.&lt;/p&gt;

&lt;h4&gt;
  
  
  unsigned integers
&lt;/h4&gt;

&lt;p&gt;They can only store positive numbers values from 0(binary rep: 0000) to 15(bin rep: 1111).&lt;/p&gt;

&lt;p&gt;Now, because x=10 and y=15 will overflow before addition, we will use something smaller:&lt;br&gt;
&lt;code&gt;int x = 5; // 0101&lt;/code&gt;&lt;br&gt;
&lt;code&gt;int y = 6; // 0110&lt;/code&gt;&lt;br&gt;
&lt;code&gt;int z = x + y // ???&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The binary representation should be 1011 if we ignore signed consideration. As you can see, the higher-order bit is flipped to 1 and from above, the value of z will be -5(= -1*2ˆ3 + 2ˆ1 + 2ˆ0)  instead of 11.&lt;/p&gt;

&lt;p&gt;and also, adding two negative can result in postivie. eg,&lt;br&gt;
&lt;code&gt;int x = -8 // 1000&lt;/code&gt;&lt;br&gt;
&lt;code&gt;int y = -5 // 0101&lt;/code&gt;&lt;br&gt;
&lt;code&gt;int z = x + y // ???&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now z will be -13 which is 10011 in binary(the higher-order bit is for negatives ie -1*2ˆ4 = -16) but our computer can only store 4-bits so it will drop higher-order bit and become 0011 which is 3 in decimal. Again, overflow.&lt;/p&gt;

&lt;p&gt;This is why &lt;code&gt;x &amp;lt; y&lt;/code&gt; could result differently from &lt;code&gt;x - y &amp;lt; 0&lt;/code&gt; if we does not handle arthmetic overflows properly. As a programmer, we should always pay attention while choosing datatypes by considering their capacties and behavior in different situations as they might become result of hours of debugging.&lt;/p&gt;

&lt;p&gt;That's all for today. Please comment out if some information here is wrong or is missing. Thank you.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>softwareengineering</category>
      <category>c</category>
      <category>systems</category>
    </item>
    <item>
      <title>Representing and Manipulating Information in modern computer - Part 1</title>
      <dc:creator>Saifur Rehman Khan</dc:creator>
      <pubDate>Mon, 28 Oct 2024 00:37:56 +0000</pubDate>
      <link>https://forem.com/saifu0/representing-andmanipulating-information-in-modern-computer-part-1-594h</link>
      <guid>https://forem.com/saifu0/representing-andmanipulating-information-in-modern-computer-part-1-594h</guid>
      <description>&lt;p&gt;As most of you might already know computer can only understand, store and process on a bit(0 and 1). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But why?&lt;/strong&gt;&lt;br&gt;
Well it turns out, two-valued signals can readily be represented, stored, and transmitted easily and more reliably than traditional base 10 number representation — for example, as the presence or absence of a hole in a punched card, as a high or low voltage on a wire, or as a magnetic domain oriented clockwise or counterclockwise, etc.&lt;/p&gt;

&lt;p&gt;Morever, a single bit is usually not very helpful in representing anything meaningful in computer but once we combine a sequence of bits, we can represent any finite set. for example, we can encode bits into negative/nonnegative and floating numbers and also can encode the letters and symbols in a document. This is why(or maybe not) we use 8bits or a byte as the smallest addressable unit of memory. In binary notation, its value ranges from 00000000 to 11111111. When viewed as a decimal integer, its value ranges from 0 to 255 and in hexadecimal it ranges from 00 to FF. We usually write bit patterns as hexadecimals(0 - 9, A - F) because it is easy for us to convert to/from binary notations. &lt;/p&gt;

&lt;p&gt;In C programming language, numeric constants starting with &lt;code&gt;0x&lt;/code&gt; or &lt;code&gt;0X&lt;/code&gt; are interpreted as being in hexadecimal. The characters ‘A’ through ‘F’ may be written in either upper - or lowercase. For example, we could write the number FA1D37B as &lt;code&gt;0xFA1D37B&lt;/code&gt;, as &lt;code&gt;0xfa1d37b&lt;/code&gt;, or even mixing upper - and lower case (e.g., &lt;code&gt;0xFa1D37b&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Okay lets cover one more thing,&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Data sizes&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Some CS terms ahead!!!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Virtual memory - A conceptual large array of bytes in memory(there is more to it but it will come later in the series)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Memory Address - A unique number used to identify a byte of memory.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual memory space - The set of all possible memory addresses(more will come later).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Word size - The nominal size of pointer data or maximum size of virtual memory address.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today's computers are of either 32-bit or 64-bit word size which means programs can have access a range from 0 to 2^32 - 1(incase of 32-bit) and 0 to 2^64 - 1(incase of 64-bit) of virtual addresses. Most of the programs compiled in 32-bit machines can be run on 64-bit machines as well but vice-versa is not true.&lt;/p&gt;

&lt;p&gt;Computers and compilers support multiple data formats using different ways to encode data, such as integers and floating point, as well as different lengths. For example, many machines have instructions for manipulating single bytes, as well as integers represented as 2-, 4-, and 8-byte quantities. They also support floating-point numbers represented as 4- and 8-byte quantities. The exact numbers of bytes for some data types depends on how the program is compiled. I showed sizes for typical 32-bit and 64-bit programs below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcym717eguv2pqoxvq3gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcym717eguv2pqoxvq3gn.png" alt="Image description" width="800" height="703"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To avoid confusion between bitness of the machine and compiler settings, ISO C99 introduced some datatypes where datasizes are fixed regardless of compiler or machine settings. As you can see in the above screenshot, &lt;code&gt;int32_t&lt;/code&gt; and &lt;code&gt;int64_t&lt;/code&gt; are among thems. Using fixed-size integer types is the best way for programmers to have close control over data representations.&lt;/p&gt;

&lt;p&gt;Before signing off - We should try to write code which can be portable to different machines and compilers. One aspect of portability is to make the program insensitive to the exact sizes of the different data types. With the transition to 64-bit machines, many hidden word size dependencies have arisen as bugs in migrating 32-bit programs to new machines. For example, many programmers historically assumed that an object declared as type int could be used to store a pointer. This works fine for most 32-bit programs, but it leads to problems for 64-bit programs because as discussed above the word size or pointer size of 32-bit and 64-bit machine will be different.&lt;/p&gt;

&lt;p&gt;Okay. that's all for today. Thank you.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ref: Computer Systems: A Programmer's perspective.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>computerscience</category>
      <category>c</category>
      <category>programming</category>
      <category>machinelevel</category>
    </item>
    <item>
      <title>someone told me to write as I learn</title>
      <dc:creator>Saifur Rehman Khan</dc:creator>
      <pubDate>Sat, 26 Oct 2024 00:30:02 +0000</pubDate>
      <link>https://forem.com/saifu0/someone-told-me-to-write-as-i-learn-153m</link>
      <guid>https://forem.com/saifu0/someone-told-me-to-write-as-i-learn-153m</guid>
      <description>&lt;p&gt;Hello world!&lt;/p&gt;

&lt;p&gt;so this is my first attempt to write a technical blog as recently I started two very interesting book and someone who I know who definitely has more technical knowledge told me to write about whatever you learn even no one reads it. It makes sense to me as well. Maybe I will be more consistent in my learning and maybe I will trying to understand better because I will have to explain it to the world. &lt;/p&gt;

&lt;p&gt;Okay now let me mention few things regarding this series of blogs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;I'm starting two books: "Computer Systems: A Programmer's persective"(A book discuss different aspect of a computer from software to hardware to networking) and "Composing Programs"(focuses on methods for abstraction, programming paradigms, and techniques for managing the complexity of large programs)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I will try to write atleast one blog each week but i cannot promise if it will be consistent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I might stop reading a book for some time(if i get bored) and start reading some other(and write about it) and comeback to above two again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before siging off, here is one interesting thing I learned today in "Computer Systems: A Programmer's persective" book about improving performance of a system:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amdahl's law&lt;/strong&gt;&lt;br&gt;
is a formula used to find the maximum improvement of a system when only a part of it is improved.&lt;/p&gt;

&lt;p&gt;The law is expressed as: S = 1 /((1 - P) + P / N)&lt;br&gt;
Where:&lt;br&gt;
S is the speedup of the system.&lt;br&gt;
P is the proportion of the program that can be improved.&lt;br&gt;
N is the number of processors.&lt;/p&gt;

&lt;p&gt;If you throw some number to above formula, you would notice that even though we made a substantial improvement to a major part of the system, our net speedup was significantly less than the speedup for the one part.&lt;br&gt;
This is the major insight of Amdahl's law — to significantly speed up the entire system, we must improve the speed of a very large fraction of the overall system.&lt;/p&gt;

&lt;p&gt;Okay. That's all for today. Thank you&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>programming</category>
      <category>backend</category>
      <category>systems</category>
    </item>
  </channel>
</rss>
