Posts with the tag why:

Why built-in functions in python are faster ?

Because Python is sitting of the shoulders of giants. Built-in functions are written in C and C++ under the hood. C and C++ languages are efficient and fast, so their functions will be faster than the functions you write in Python. So it is recommended to use built-in functions instead of creating new ones.

Why Do People Use Go ?

People use Go programming language For various reasons. Here is all reasons in brief: Go is open-source but backed up by a large corporation (Google) It’s fast: to learn to build up to compile to arrange and install to scamper Go is a modern language Go is Simple It is Concurrent Static code analysis Garbage collected language Testing Support And now, let’s dive in each reason. Performance Most people come to Go from dynamic languages like Ruby, Python, JavaScript, PHP and similar.

Why is n++ faster than n=n+1?

The answer is related to the old CISC cpu instructions and the way how C (or any programming language) is compiled to binary code. In almost every CISC CPU there is a special “add” instruction that is named INC (or DEC) and that instruction increments (or decrements) by 1 the value of a register (or memory). If you use another instruction for addition you have to add both operands you want to sum. That makes INC/DEC more efficient: They take less space (no space for operands). In CISC they execute faster (because you save time to load operands). The initial C compiler has been technically a simple 3 step macro processor on top of assembly so it was leaving this choice to the programmer.

Why Did Google Develop Go ?

Google has two tremendous problems. One of them is compile time. Back in the 1980’s, reasonable sized projects took hours to do a clean build. There were whole server farms dedicated to recompiling. You got a new “nightly build” and made modifications to that. Google builds things that are so ridiculously huge that it’s still like that in 2017. It takes 5 hours to rebuild chrome from scratch even on a big fat i7 system. The pain of compile time on these builds hurts so much that Google has invented build tools that separate the dependency analysis and compiling, just to gain a few percent in build time using conventional languages.