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?

Similarities

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

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.

Note: 

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.

You will most certainly love this reading about coding

If you want to be a relevant developer 5, 10 or 15 years to come, don’t make no mistake and ditch JavaScript.
 
Avoid the hype of emerging frameworks if you don’t trust your JavaScript vanilla knowledge and skills. Of course many smart developers in your network will put up a strong challenge which will most certainly make you feel irrelevant but man up and stick to what’s fundamentally right.
 
Don’t take it for granted, if you have strong vanilla skills you would be able to learn and grasp almost any JavaScript framework or library or plugin in less than 72 hours or so.
 
Have an understanding that competent developers, don’t work solo, they have an ecosystem consisting of teams. You’d rather code a process in vanilla that you understand than copying and pasting some library code in the app but you can’t answer why, what, when and how. Efficient software is developed by patient and efficient coders.
 
On top of that learn C++ or Java which languages have been around for forever on top of having top notch OOP maturity level. Which any JS library is embracing but sometimes it’s harder to grasp in JavaScript if you don’t compare it to how it’s done in another language.
 
Since most processes in JS are asynchronous it’s the not the same in JAVA and C++ perhaps giving you a big opportunity to understand both entirely.
 
Last but not least, relevancy is subjective though the more efficient solutions you put out in production is relative to the large number of human problems you are helping to solve but you can’t achieve that if you don’t learn and practice breaking down complex tasks into simple modules on paper before getting your hands dirty.

The difference! Website designing and Web application development.

Are these just industry terms to confuse the novice and the customer? Is the difference really worth knowing and understanding or is it a wastage of time? As we continue on the journey to learn how to do develop web applications, I thought it would be good someone clear the question before us.

What is web design?

In my opinion is the process of using a set of tools to create and put together a navigable elements and content accessible through a web browser. The set of tools are majorly the graphics design applications such Adobe illustrator, Adobe Photoshop, GIMP, Sketch and content management systems such as WordPress etc. Though web designing could involve use of coding with HTML, CSS and JavaScript mainly, it is not mandatory. That side someone who never touched code can put things together and produce a highly performance website.

What is Web application development?

In my opinion is the art and science of using coding to develop software that is accessible through a web browser. Though they are tools like script-case that help I.T professionals come up with web applications, web application developer requires someone to have some good coding skill to come with such a tool.

Why even care?

You may wonder, why of all things must I know about the differences between website designing and web application development. Many people’s reasons could differ from mine. I think if you want to become something, there is something that competes with what you have in mind, therefore you must ultimately pay attention because it’s very vital in helping one choose the right path sooner than later in life. Since developing a career involves investment of valuable resources… it’s always good to look at the right direction and avoid destruction.

Let’s meet next week for the next item on the agenda of How to develop web applications utilizing modern ways.

How to develop web applications. Prerequisites

Allow me start by apologizing for missing to post in the previous week. Without further a do, let me start from where we stopped in part one of the series about learning the modern way of developing web applications.

But who am I and why do I fit to be your tutor this festive season?

I’m an African Ugandan internet student, businessman and trainer. Besides technology, I purposely encourage and guide people through the process of becoming self-aware for mindfulness and peace.

Over the years I have studied and learned about PHP, JavaScript, HTML, CSS, SQL and Content Management Systems which has helped build a skill, career and establish Gagawala Graphics Limited a business offering web hosting, web management and web design in addition to printing and graphics design to people of Uganda both within and in diaspora.

I tut at Hostalite Cyber Academy and part of the core volunteer team at You Inspire You.

What do I need to know before following the series?

  • I wouldn’t say you need much if you’re passionate besides being able to code in HTML, CSS, JavaScript(jQuery) and VueJs, and PHP(OOP).
  • You should also be able to find a web host to practice or alternatively install Lamp(linux) or MAMP(iOS) or WAMP or XAMPP(windows).
  • Ability to install and setup WordPress.
  • Lastly but not least you should be able to read and understand English.

What next?

For now get ready for next part of the series which is Web design vs Web applications development.

In that article I will share my opinion backed by 5 year experience about the differences between web design and web application development. I find this necessary because many people confuse the two.

See you next week.

DIY Joomla! 3 One-Page site

I have always been fascinated by the fluidity one can find with one-page web themes. While common in Wordpress, one-page web templates were not the usual in Joomla!. I put the task of understanding them, and replicating such in Joomla, on my bucketlist last year, but I did not have cause to actually do either until recently when a client asked for it.
I turned to my good friend, Google, for help, and I found an answer on Joomla Stack Exchange channel that helped a lot (Thanks Sir Rene Korss!).

BREAKING DOWN THE WONDER OF THE ONE-PAGE SITE

The concept is to
  • place several modules on the home page, with different displays,
  • then create hyperlinks that, when enhanced with a sprinkling of java script, scroll to those modules smoothly.
Joomla! already has functionality for modules, and each template has varied types and position names. The twist here is to be able to call the module IDs within the designated hyperlink.
By carrying out the following steps, we can make any Joomla template, behave like a one-page theme:

1. Create a module chrome

A module chrome is the shell (usually with div, span or paragraph tags), surrounding each module. While there are default module chromes within the system folder inside templates, your new template probably has its own, that make the modules display how the template creator wants them to. It's quite easy to make your own custom module chrome, but the point here is to use a referable value in the initial tag's id, that you can call up later.

See an example below:
  1. Create a file called modules.php in the folder
    yoursitedirectory/templates/yourchosentemplate/html
  2. Add the following code to the file:
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?php
    /**
    Additional template module chrome(s)
    **/
    defined('_JEXEC') or die;

    /*
    * one page layout (output module content in one page layout)
    */
    function modChrome_onepager($module, &$params, &$attribs)
    { ?>
    <div id="slot-<?php echo $module->id; ?>">
    <!-- Module content here -->
    <?php echo $module->content; ?>
    <span style="margin-bottom: 5px;">&nbsp;</span>
    </div>
    <?php } ?>
As illustrated above, the chrome is named modChrome_onepager, the div tag is the first tag within it, and its id uses a referable value, in this case, it calls the current module's id (module->id). I added the word, 'slot-' to the name, but you can use any value or format. Add any other optional frills to the module chrome.

2. Create your modules

Set up all the modules that will act as sections for the one-page theme. For example, let's assume that your proposed links are Home, About us, Our Services, and Contact us. Home section is the part of that the site visitor sees upon opening the site for the first time, so that's taken care of. You need to create modules for the other links, namely, About us, Our Services, and Contact us. Set them to show on the Home page, under your menu assignments.
Very important: Ensure that in each module, the module chrome you created in step 1 is selected. You can select a module chrome type under 'Advanced' tab, from the list tagged, Module Style.

3. Create the hyperlink menus

Go to Menus, and create external links, with the URL specified as the module names e.g. slot-22. 

Add the Javascript magic

 The script to use is from Paulund.co.uk and it allows a smooth scroll between the hyperlinks.

 ADDING A LITTLE EXTRA

  •  its preferable that you create your module chrome inside the systems folder, instead of inside the particular template folder. This is for occasions in which you have to change the template - the code should still work regardless of the change.
  • If its not in the template already, consider adding an arrow that leads back to the top of the page, at the right hand side corner of the screen. 

Want to check already-made one page Joomla! templates? Check out this collection at Evohosting.co.uk

DIY Joomla! 3 One-Page site

I have always been fascinated by the fluidity one can find with one-page web themes. While common in Wordpress, one-page web templates were not the usual in Joomla!. I put the task of understanding them, and replicating such in Joomla, on my bucketlist last year, but I did not have cause to actually do either until recently when a client asked for it.
I turned to my good friend, Google, for help, and I found an answer on Joomla Stack Exchange channel that helped a lot (Thanks Sir Rene Korss!).

BREAKING DOWN THE WONDER OF THE ONE-PAGE SITE

The concept is to
  • place several modules on the home page, with different displays,
  • then create hyperlinks that, when enhanced with a sprinkling of java script, scroll to those modules smoothly.
Joomla! already has functionality for modules, and each template has varied types and position names. The twist here is to be able to call the module IDs within the designated hyperlink.
By carrying out the following steps, we can make any Joomla template, behave like a one-page theme:

1. Create a module chrome

A module chrome is the shell (usually with div, span or paragraph tags), surrounding each module. While there are default module chromes within the system folder inside templates, your new template probably has its own, that make the modules display how the template creator wants them to. It's quite easy to make your own custom module chrome, but the point here is to use a referable value in the initial tag's id, that you can call up later.

See an example below:
  1. Create a file called modules.php in the folder
    yoursitedirectory/templates/yourchosentemplate/html
  2. Add the following code to the file:
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?php
    /**
    Additional template module chrome(s)
    **/
    defined('_JEXEC') or die;

    /*
    * one page layout (output module content in one page layout)
    */
    function modChrome_onepager($module, &$params, &$attribs)
    { ?>
    <div id="slot-<?php echo $module->id; ?>">
    <!-- Module content here -->
    <?php echo $module->content; ?>
    <span style="margin-bottom: 5px;">&nbsp;</span>
    </div>
    <?php } ?>
As illustrated above, the chrome is named modChrome_onepager, the div tag is the first tag within it, and its id uses a referable value, in this case, it calls the current module's id (module->id). I added the word, 'slot-' to the name, but you can use any value or format. Add any other optional frills to the module chrome.

2. Create your modules

Set up all the modules that will act as sections for the one-page theme. For example, let's assume that your proposed links are Home, About us, Our Services, and Contact us. Home section is the part of that the site visitor sees upon opening the site for the first time, so that's taken care of. You need to create modules for the other links, namely, About us, Our Services, and Contact us. Set them to show on the Home page, under your menu assignments.
Very important: Ensure that in each module, the module chrome you created in step 1 is selected. You can select a module chrome type under 'Advanced' tab, from the list tagged, Module Style.

3. Create the hyperlink menus

Go to Menus, and create external links, with the URL specified as the module names e.g. slot-22. 

Add the Javascript magic

 The script to use is from Paulund.co.uk and it allows a smooth scroll between the hyperlinks.

 ADDING A LITTLE EXTRA

  •  its preferable that you create your module chrome inside the systems folder, instead of inside the particular template folder. This is for occasions in which you have to change the template - the code should still work regardless of the change.
  • If its not in the template already, consider adding an arrow that leads back to the top of the page, at the right hand side corner of the screen. 

Want to check already-made one page Joomla! templates? Check out this collection at Evohosting.co.uk

DIY Joomla! 3 One-Page site

I have always been fascinated by the fluidity one can find with one-page web themes. While common in Wordpress, one-page web templates were not the usual in Joomla!. I put the task of understanding them, and replicating such in Joomla, on my bucketlist last year, but I did not have cause to actually do either until recently when a client asked for it.
I turned to my good friend, Google, for help, and I found an answer on Joomla Stack Exchange channel that helped a lot (Thanks Sir Rene Korss!).

BREAKING DOWN THE WONDER OF THE ONE-PAGE SITE

The concept is to
  • place several modules on the home page, with different displays,
  • then create hyperlinks that, when enhanced with a sprinkling of java script, scroll to those modules smoothly.
Joomla! already has functionality for modules, and each template has varied types and position names. The twist here is to be able to call the module IDs within the designated hyperlink.
By carrying out the following steps, we can make any Joomla template, behave like a one-page theme:

1. Create a module chrome

A module chrome is the shell (usually with div, span or paragraph tags), surrounding each module. While there are default module chromes within the system folder inside templates, your new template probably has its own, that make the modules display how the template creator wants them to. It's quite easy to make your own custom module chrome, but the point here is to use a referable value in the initial tag's id, that you can call up later.

See an example below:
  1. Create a file called modules.php in the folder
    yoursitedirectory/templates/yourchosentemplate/html
  2. Add the following code to the file:
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?php
    /**
    Additional template module chrome(s)
    **/
    defined('_JEXEC') or die;

    /*
    * one page layout (output module content in one page layout)
    */
    function modChrome_onepager($module, &$params, &$attribs)
    { ?>
    <div id="slot-<?php echo $module->id; ?>">
    <!-- Module content here -->
    <?php echo $module->content; ?>
    <span style="margin-bottom: 5px;">&nbsp;</span>
    </div>
    <?php } ?>
As illustrated above, the chrome is named modChrome_onepager, the div tag is the first tag within it, and its id uses a referable value, in this case, it calls the current module's id (module->id). I added the word, 'slot-' to the name, but you can use any value or format. Add any other optional frills to the module chrome.

2. Create your modules

Set up all the modules that will act as sections for the one-page theme. For example, let's assume that your proposed links are Home, About us, Our Services, and Contact us. Home section is the part of that the site visitor sees upon opening the site for the first time, so that's taken care of. You need to create modules for the other links, namely, About us, Our Services, and Contact us. Set them to show on the Home page, under your menu assignments.
Very important: Ensure that in each module, the module chrome you created in step 1 is selected. You can select a module chrome type under 'Advanced' tab, from the list tagged, Module Style.

3. Create the hyperlink menus

Go to Menus, and create external links, with the URL specified as the module names e.g. slot-22. 

Add the Javascript magic

 The script to use is from Paulund.co.uk and it allows a smooth scroll between the hyperlinks.

 ADDING A LITTLE EXTRA

  •  its preferable that you create your module chrome inside the systems folder, instead of inside the particular template folder. This is for occasions in which you have to change the template - the code should still work regardless of the change.
  • If its not in the template already, consider adding an arrow that leads back to the top of the page, at the right hand side corner of the screen. 

Want to check already-made one page Joomla! templates? Check out this collection at Evohosting.co.uk

DIY Joomla! 3 One-Page site

I have always been fascinated by the fluidity one can find with one-page web themes. While common in Wordpress, one-page web templates were not the usual in Joomla!. I put the task of understanding them, and replicating such in Joomla, on my bucketlist last year, but I did not have cause to actually do either until recently when a client asked for it.
I turned to my good friend, Google, for help, and I found an answer on Joomla Stack Exchange channel that helped a lot (Thanks Sir Rene Korss!).

BREAKING DOWN THE WONDER OF THE ONE-PAGE SITE

The concept is to
  • place several modules on the home page, with different displays,
  • then create hyperlinks that, when enhanced with a sprinkling of java script, scroll to those modules smoothly.
Joomla! already has functionality for modules, and each template has varied types and position names. The twist here is to be able to call the module IDs within the designated hyperlink.
By carrying out the following steps, we can make any Joomla template, behave like a one-page theme:

1. Create a module chrome

A module chrome is the shell (usually with div, span or paragraph tags), surrounding each module. While there are default module chromes within the system folder inside templates, your new template probably has its own, that make the modules display how the template creator wants them to. It's quite easy to make your own custom module chrome, but the point here is to use a referable value in the initial tag's id, that you can call up later.

See an example below:
  1. Create a file called modules.php in the folder
    yoursitedirectory/templates/yourchosentemplate/html
  2. Add the following code to the file:
     1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    <?php
    /**
    Additional template module chrome(s)
    **/
    defined('_JEXEC') or die;

    /*
    * one page layout (output module content in one page layout)
    */
    function modChrome_onepager($module, &$params, &$attribs)
    { ?>
    <div id="slot-<?php echo $module->id; ?>">
    <!-- Module content here -->
    <?php echo $module->content; ?>
    <span style="margin-bottom: 5px;">&nbsp;</span>
    </div>
    <?php } ?>
As illustrated above, the chrome is named modChrome_onepager, the div tag is the first tag within it, and its id uses a referable value, in this case, it calls the current module's id (module->id). I added the word, 'slot-' to the name, but you can use any value or format. Add any other optional frills to the module chrome.

2. Create your modules

Set up all the modules that will act as sections for the one-page theme. For example, let's assume that your proposed links are Home, About us, Our Services, and Contact us. Home section is the part of that the site visitor sees upon opening the site for the first time, so that's taken care of. You need to create modules for the other links, namely, About us, Our Services, and Contact us. Set them to show on the Home page, under your menu assignments.
Very important: Ensure that in each module, the module chrome you created in step 1 is selected. You can select a module chrome type under 'Advanced' tab, from the list tagged, Module Style.

3. Create the hyperlink menus

Go to Menus, and create external links, with the URL specified as the module names e.g. slot-22. 

Add the Javascript magic

 The script to use is from Paulund.co.uk and it allows a smooth scroll between the hyperlinks.

 ADDING A LITTLE EXTRA

  •  its preferable that you create your module chrome inside the systems folder, instead of inside the particular template folder. This is for occasions in which you have to change the template - the code should still work regardless of the change.
  • If its not in the template already, consider adding an arrow that leads back to the top of the page, at the right hand side corner of the screen. 

Want to check already-made one page Joomla! templates? Check out this collection at Evohosting.co.uk

Why haven’t you developed a single Mobile App yet?

Are you interested but have never gotten the courage to take the chance or have tried but upbeat by the long learning curve?

First of all, Rome wasn’t built in a day, so you are not to blame. I personally love to create solutions for myself and the other people around me.

I utilize the skills I have to create the solutions. Take for example, by having a HTML, CSS and PHP skills, I’m able to run a web agency which also gives printing and graphics design services. At this agency, I work as the operations manager and leader of the digital department.

Due to business dynamics, there is need to learn a new skill to strengthen my personal portfolio as well as that of the company.

What comes to my mind is developing mobile apps which can solve real life problems. For this I will concentrate on developing Android apps not Windows and iOS, due to my target consumers. Since am not a fan of Java, I chose to go Hybrid way because at least I wouldn’t have to learn a lot, I will port my HTML, CSS, PHP and SQL knowledge to reach my target. Additionally, I would have a chance of compiling my mobile app code, for other platforms as well we grow without investing money for another developer yet the client’s budget is too low.

Recently I posted about setting up the Android Hybrid App development environment article, to let you know how practically it’s easy to get started.

Right now, am creating my own App, which will be used for personal finance book keeping, with features such as automatic notification  a few days towards loan date expiry, loan amortization and so much more as time may allow. I hope to an api and remote storage in the cloud, in future to be able to attract more people to use it.

I think by now, I would have completed developing the app but looking at available resources, couldn’t manage learning one.

Listen I have set 10 days, of researching and studying about JQM. In a few days, I have been able to develop the login and logout screens.