Posts

Fundamentally, What is programming?

Image
Fundamentally, it’s arranging patterns so that, when fed to a machine, certain desirable patterns come out. This is a  Jacquard loom : This is the device that inspired  Charles Babbage  to invent the computer. As you can see, it’s weaving a carpet. This is not a computer (there are certain important things that are missing, like internal state and the ability to also  change  the patterns on the paper), so this loom didn’t involve  computer  programming, but I think it’s still programming - just look at the tape; that’s  obviously  code, and I don’t think it’s unreasonable to call the person that wrote it a programmer. Guest Author Vladislav Zorov programming enthusiast. Lives in Bulgaria Love my answers? Donate to my gaming budget:  paypal.me/vladizorov

What is the most beautiful computer program?

Image
The null program (i.e. empty program): In many languages it’s a  quine  (a program that prints its own source code). Full test coverage by default. Has a  cyclomatic complexity  of 1, the smallest possible value. Runs in  O ( 1 ) O ( 1 ) . People think their first program is “hello world”, but actually the first valid program they have written is most likely the null program. Is very portable, not just across operating systems and compilers but also across programming languages. Is at the base of every other program ever written. Sometimes, it  is  the program being written ( The /bin/true Command ). It literally breaks the charts on all metrics that are “per line of code”. Everything else is downhill from there :) Guest Author Vladislav Zorov programming enthusiast. Lives in Bulgaria Love my answers? Donate to my gaming budget:  paypal.me/vladizorov

Some Basic Python Optimisations

Image
WARNING! For CPython, if you want performance you should prefer algorithmic optimizations (i.e. find better algorithms for what you're doing) or, if that's not possible, rewrite parts of your code in Cython. You should generally aim for readability, and avoid micro-optimizations - except in cases where it's the same, like comprehension expressions: they are both more readable  and  faster (special-cased, emit less instructions than loops because there's no possibility of  break ,  continue  or  return  -  compile.c , Ctrl+F, "List and set comprehensions"). You should always profile your application before optimizing, and you should profile with real (or realistic) data and in an as complete state as possible - concentrate on optimizing stuff that  actually  matters, not stuff you  think  matters. You have been warned. On to the fun part. >>> from dis import dis >>> def fn ( a ): b = a >>> dis ( fn ) 2

Journey of a Techie - From being fired to become the most viewed Automation Writer on Quora

Image
“Congratulations, Jatin!! You are promoted!!”   my manager said to me!! Well,2017 and 2018 were not my years. I was going through tough times in my personal life dealing with breakup and other family issues. When you’re going through tough times, you tend to look for signs that can actually give you and your family a little bit of happiness. This promotion was a sign for me and my family! I came out of the meeting room and called my mom to share this “good” news. There is this one thing with all Mom’s. No matter how much you try to hide your sadness and worry, they can easily sense it! She was sad because I was sad, and she knew that she couldn’t do anything about it. I wanted to give this good news to her so that she could actually divert her thoughts from the tough times I was going through. Feb 5th, 2018: I was back from a mini vacation and was feeling really good! I thought, from now on, to start a new chapter of my life, filled with positivity and happiness.