The difference “” vs null vs 0

Recently as I was conversing with my young friend, he looked at some of my code and wondered why I was using a zero or null or empty string (“” or ‘ ‘ ) instead of using one wherever I wanted.

Programming is an interesting though weird or confusing discipline, especially to the novice things don’t mean a lot because most novices concentrate on the output than the efficiency and effectiveness of the output. For the mature programmers optimization is key, after all at the end of the day a user wants something working but requires less attention than something erroneous and slow.

So let’s get to it. How does null, empty string and zero differ?


First of all the similarity is of the three is that they are all values to variables and mostly used as the initial value of a variable.

Second the empty string and null will usually output nothing if printed on the screen.


Differences might be defined differently per programming language.

For example in Python there is no null but there is None which means the same as null in other programming languages.

To find out the datatype of None and other values in python use the type( ) function e.g type( None ), will return NoneType data type in python. While in JavaScript we use typeof value to find out the Data type of a value stored in a variable. i.e. console.log( typeof null ) will return object as the data type of null.

PHP 4+ we use gettype( ) function to find out the datatype of the value stored in the variable. For example gettype( null ) will return for NULL.

If you are a JavaScript novice it’s good to pay much attention to null values since they are of data type object. For example find out how object data types are treated in JavaScript before you hit a nail in your foot.


Almost all programming languages “” or ” is treated as a string and it occupies the space in memory of the size that is occupied by a string or char datatype. In fact in JavaScript if a value starts with ” even if it’s proceeded by a number or decimal it will be type cast to a string so that the resulting value will of data type string.

So be careful initializing variables with ” especially if they will be used in mathematical expressions.

In Java, Python and PHP 0 is treated as an integer whereas it’s treated as a number in JavaScript because in JavaScript integers and floats are number data types. I know most people might be wondering why not a Boolean?

Though 0 or 1 might represent false/true they are not treated boolean data types.

Why care?

It’s always good to code what a programmer and fellow programmers understand to avoid spending time in refactoring than improving functionality and optimization.

It’s also important to ship a software which will give more predictable results than not to avoid the users plucking hair out of their heads, assuming they’re wrong yet it’s the programmer is the calprit.

DataTypes determine how big your program will be and how it nay handle memory, avoid confusing by planing to code rightfully from the beginning.


This tutorial assumes you have some programming knowledge and some level of practice with the one or more of the programming languages cited in the tutorial.

The tutorial is dedicated to Were Calvin a Ugandan African motion graphics designer and emerging front-end developer practicing at Gagawala Graphics limited.

Muss man programmieren können?

Seit meiner Schulzeit in den Siebziger Jahren höre ich Leute darüber diskutieren, ob jeder programmieren können sollte weil es ja nun Computer gäbe. Das ist nun immerhin mehr als 40 Jahre her. Damals hielten Grossrechner in Firmen Einzug. Personal Computer waren noch nicht erfunden. Taschenrechner, Quartzuhren mit Digitalanzeige und Funkgeräte waren der „heisseste Scheiss“, den …

The post Muss man programmieren können? appeared first on Hagen Graf.

Learn to develop web applications the modern way – Part 3

In the programming industry like others, you will find many terms(vocabulary) which are not usual in  common speech. In this article of the series about “learning how to develop web applications in the modern way”, allow me introduce to some of those terms. In case you missed reading some parts,  click here to read part one or click an item in the table of contents below.

  1. Prerequisite
  2. Web design vs Web applications development
  3. Extending is smart!
  4. Components of a Web application.
  5. Powering web applications with WordPress
  6. The do list application

What is extending in programming? 

In simple terms it’s the opposite of developing applications from scratch. In detail it means a coder will write his/her own application from the start to finish without using and relying on other programmers code. Therefore to extend is when a coder starts with someone’s code to develop an application or feature.

In Object Oriented Programming paradigm, to extend means to derive/instantiate objects which inherit features in terms of method and properties from existing class(es).

What are the advantages of extending?

  1. It makes programming a lot easier because you don’t have to write every line of code by yourself.
  2. It is cheaper than starting from scratch which will require a bigger team and tools for the team besides investing in the team to learn how to work together.
  3. Availability of help from all corners though this depends on the choice of framework. Most programmers choose a framework which has a large number of contributors, the profile of the founder, the number of tools in place and how old it is.
  4. Easier learning curve due to availability and supply of learning material on top of a comprehensive documentation.
  5. Ask me how people become better than others at coding and I will tell you that the secrete is hidden in reading code written by others whether good or bad coders.

My personal recommendation is to spend more time creating solutions than learning how to create solutions. In the upcoming part, share about the basic and major components of a Web application.

Merry Christmas and a marvelous New year.

Learn the modern way of developing Web applications this festive season for free.

If there is anything I’m passionate about nothing beats the passion to use technology to benefit fellow humans.

Since I got the opportunity to live in the generation where the world is a global community because of internet, it gifts me the privilege to learn and share. This festival season, I would like teach you about developing functional web applications using modern tools and approaches.

Take a look at the table of contents.

  1. Prerequisite
  2. Web design vs Web applications development
  3. Extending is smart!
  4. Components of a Web application.
  5. Powering web applications with WordPress
  6. The do list application

At the end of the tutorial I expect the reader to:-

  • To differentiate web design from web development.
  • To learn the different components together with their functionality in web applications.
  • To develop web applications using WordPress as an underlying framework.

Stay tuned for the next post, in which I will reveal my experiences and the requirements you need to benefit from this short but practical tutorial.




Why entrepreneurship is not freedom?

Building myself as an entrepreneur I juggled between freelance and employment. During the time until mid 2015 the market pulled me into and I virtually identified myself as an Information Technology expert than what I truly desired to be since 2003.

You see I wanted to code and develop solutions which could help me especially. I never owned a PlayStation yet kids next door did, my playing time was boring most of the time. Such incited the desire to be creative. Later spent every penny in the internet cafes for years to learn this thing called software development.

All the way, developed desire to make money, so I instead of going at it through coding looked for the simplest way possible. I went into troubleshooting computers and setting up internet cafes. As this brought in some money, it positioned me more into the I.T arena than giving than coding. Much as had lots of ideas flowing in my blood, couldn’t find the courage to start or pick up where I left off.

When you want to be something, it’s good to discover the way you want to do it and fall that. If you don’t you are most likely to do it just like anyone else. Will this bring you happiness?

As for me solving problems through coding will be my first method, even if I run away it will always haunt me.

If anyone wants freedom or is pursuing happiness my recommendation is to try and spare sometime to discover yourself. Try so much to become as much self aware as possible so that if anyone has to tell you something they know or are observing about you, you don’t feel offended and surprised. Because you entirely know where it begins and ends.

For many coders, there is pain on start and during debugging phase but that pain has never compared to the happiness that comes at launch of our system.

If you’ve never gone through any self-awareness program, start now. Don’t let fears and thoughts like discovering the opposite that you want something or you who someone else than you’ve known. The magic here is that you will know yourself more than anyone knows you and you can now continue on your journey taking the right direction. I got a chance to attend Unleash dreams in 2016 co-found by David Reeve. One of the sessions Christine taught us about the life ecosystem, it’s my center of reflection since then.

How to remove Woocommerce sidebar from front-page using hooks

Woocommerce is one of the most popular plugins for WordPress because it’s used by anyone wants to setup online shop without the need writing a single line of code.

Themes are one of the notable features that come with Woocommerce out of box. It comes with a default theme as well as you can download many out from theme repository and many theme stores online. In fact most of those themes on the WordPress repository and theme stores are fully compatible with WordPress.

Therefore this post is targeting people with custom themes made by themselves or got from somewhere but haven’t come with Woocommerce support.

Let’s start right away!

Go to Appearance -> Edit after logging in to the WordPress Dashboard where Woocommerce is installed.

Look for the functions.php file. For experienced WordPress coders you can create your own site specific plugin. This is where you can add custom code.

Let’s remove a Woocommerce sidebar action.

Use the code below in your themes functions.php or site specific plugin.


remove_action( ‘woocommerce_sidebar’, ‘woocommerce_get_sidebar’, 10 );

Save and reload the front-end of your shop page.

As simple as that.