Programming Archives - AYALR https://ayalr.com/category/programming/ Tue, 30 Apr 2024 05:40:49 +0000 en-US hourly 1 https://wordpress.org/?v=6.0.3 https://ayalr.com/wp-content/uploads/2024/02/cropped-android-chrome-512x512-1-32x32.png Programming Archives - AYALR https://ayalr.com/category/programming/ 32 32 How to Backup a WordPress Site for free! https://ayalr.com/how-to-backup-wordpress-site-without-plugin/ Sun, 26 Dec 2021 12:36:39 +0000 https://ayalr.com/?p=315 1. Overview How to backup a WordPress Site free? The task is not trivial but I make it easier to keep your WordPress site safely backed up on your computer? I’m assuming that WordPress is installed on a Linux machine. However, this can be easily adapted to do it on other operating systems as well! …

How to Backup a WordPress Site for free! Read More »

The post How to Backup a WordPress Site for free! appeared first on AYALR.

]]>
1. Overview

How to backup a WordPress Site free? The task is not trivial but I make it easier to keep your WordPress site safely backed up on your computer? I’m assuming that WordPress is installed on a Linux machine. However, this can be easily adapted to do it on other operating systems as well!

2. Is there a plugin?

Why don’t you use an off the shelf plugin which has already been tried and tested?

This is a very legitimate question. There are many popular plugins out there such as UpdraftPlus WordPress Backup Plugin and Jetpack by WordPress.com just to name a few.

Don’t get me wrong, plugins are useful for a variety of reasons, but they have to be treated for what they are, third-party software, over which you have little or no control. From a security point of view, the fewer plugins you install, the better it is.

Furthermore, the more plugins you install, the slower the site will run. You might also be tempted to install a long list of plugins, causing incompatibilities over time.

2.1 How to backup wordpress site without plugin

If you have good knowledge of how WordPress works under the hood, you have good SQL and MySQL knowledge, and you can find your way around an operating system easily, then you will soon know how to backup a wordpress site without plugin.

3. What items are we backing up?

The best way to backup a wordpress site without plugin is to copy the:

  1. file system
  2. database schema

3.1 How to backup the File System

The first step is backing up the WordPress files from the file system, including scripts, themes, plugins, and uploaded content. You need to know the directory which holds all of your WordPress. In this case, the directory is:

/var/www/html

The following command will compress all contents from that location into one single file.

tar -cjf blogFiles_28-04-2019.tar /var/www/html

Let’s tackle that command piece by piece. “tar -cfj” is a Linux command with which we instruct the operating system to compress files it finds in the location “/var/www/html”, and name the result blogFiles_28-04-2019.tar”. Note that the data was inserted in a way to indicate when the backup was taken.

So, just go to a directory of your choice and execute that command. Once it finishes, you will be able to see a new file called “blogFiles_28-04-2019.tar“. The amount of time required by the command, and the file size of its result, depend on how large your WordPress site is. 

3.2 How to Backup WordPress Database Schema

It’s now time to get a copy of the database.

For this step, you will need:

  1. the username,
  2. the password,
  3. the database name,
  4. the hostname of your WordPress database.

If you don’t know this information but have access to your host, you can retrieve them by reading the contents of the wp-config.php file. In our setup, this file is found in /var/www/html/wp-config.php.

With all the information at hand, you can execute the following command, replacing the placeholders with your information:

mysqldump --user=[YOUR_USER] --password=[YOUR_PASSWORD] --databases [YOR_DB_NAME] --host=<YOUR_HOSTNAME> > blogData_28-04-2019.sql

By executing this command, we are instructing the database engine to take a copy of all WordPress database contents into the file blogData_28-04-2019.sql

4. Storing the backups

At this point, we have our WordPress site backed up into two files “blogFiles_28-04-2019.tar” and “blogData_28-04-2019.sql”.

For obvious reasons, keeping the backup files on the same and single server is not a bright idea. Should something happen to the server, the site will be lost, together with the backup files. We don’t want this to happen, hence there are a few more steps to complete. We need to store a copy of these files in a reliable and secure place.

In this article, I will describe two ways which are both reliable and secure. Apart from these mentioned, there are other solutions.

4.1 FTP

FTP stands for File Transfer Protocol and is used to move files from one server to another. There are applications like FileZilla, or the linux command line tool lftp. In this article, we’ll use the latter. Just in case the lftp is not installed by default on your server, you can install it using the following command:

sudo apt-get install lftp

Once lftp is present, you can execute the following to copy the two files created in the steps before.

lftp [YOUR_FTP_USERNAME]@[YOUR_FTP_HOSTNAME]:~> put blogData_28-04-2019.sql
lftp [YOUR_FTP_USERNAME]@[YOUR_FTP_HOSTNAME]:~> put blogFiles_28-04-2019.tar

In both cases, lftp will ask for the password

4.2 The Cloud

Another alternative to using FTP servers is to use a cloud-based file storage solution like Google Drive, or DropBox. One solution would be more ideal than others depending on price plans and operating system support. There are other options too, like using a cloud-based source control solution like http://www.bitbucket.org, or http://www.github.com

5. Automation

In a real-world scenario, backups are automated. One approach that will be explained in this article is the following. In this part of the article, we will assume that you are hosting your blog on a Linux machine and that you are familiar with GIT.

We can achieve this by creating a shell script combining all the above steps and use a scheduler to execute our script at particular intervals. One such scheduler is the Linux Crontab. In this example, we will have the WordPress site backed up every day.

First, we need a shell script to create and upload the backup files. For simplicity’s sake, we will use bitbucket to store our backups on the cloud. We will also assume that the ssh keys of the client are already set in bitbucket. Create a new repository on bitbucket and clone it on the WordPress server. Update the script with your paths:

#!/bin/bash

echo "Finding config details..."
BLOG_DIR=/var/www/html
DEST_DIR=~/dbdumps/wellbeingbaristabackups/
DB_NAME=`echo "<?php require_once(\"${BLOG_DIR}/wp-config.php\"); echo DB_NAME;" | php`
DB_USER=`echo "<?php require_once(\"${BLOG_DIR}/wp-config.php\"); echo DB_USER;" | php`
DB_PASS=`echo "<?php require_once(\"${BLOG_DIR}/wp-config.php\"); echo DB_PASSWORD;" | php`
DB_HOST=`echo "<?php require_once(\"${BLOG_DIR}/wp-config.php\"); echo DB_HOST;" | php`
 
#Compress the WordPress files
echo "Compressing WordPress files..."
FILES_TAR_FILE_NAME=${DEST_DIR}blogFiles-$(date +%Y%m%d).tar
tar -cjf $FILES_TAR_FILE_NAME $BLOG_DIR

#Dump the database contencts
echo "Taking a database dump..."
DB_TAR_FILE_NAME=${DEST_DIR}blogFiles-$(date +%Y%m%d).sql
mysqldump --user=$DB_USER --password=$DB_PASS --databases $DB_NAME --host=$DB_HOST > $DB_TAR_FILE_NAME

#Push to git
echo "Sending files to remote"
cd $DEST_DIR
git add .
git commit -m "Another daily backup"
git push origin master

The final step is to configure the scheduling. The above script assumes that the backups will be taken not more than once daily. If you need more frequent backups, the date timestamp of the files needs to include hours or possibly minutes. Next is the scheduling for the script. To enable this we need to create a Linux cron job. Open your terminal and type in the following command:

sudo crontab -e

This will open the cron editor. You might need to change the script name and/or location, but if you named the script “wordPressBackup.sh” and saved it in location “/home/user/dbdumps/”, then add the following line in the crontab editor.

0 1 * * * /home/user/dbdumps/wordPressBackup.sh

This instruction will perform the backup, every day at 1 am.

6. Conclusion

In this article, we have seen how to make sure your WordPress site is backed up properly.

We have also used tools such as FTP and GIT to store our backups safely.

The post How to Backup a WordPress Site for free! appeared first on AYALR.

]]>
The Best 10 Powerful Computer Programming Skills Needed https://ayalr.com/10-powerful-computer-programming-skills-needed/ Sat, 05 Jun 2021 11:46:12 +0000 https://ayalr.com/?p=275 Overview Let’s have a look at the best 10 powerful computer programming skills needed today! I don’t want to suggest an infinite number of courses because, in the end, this might get you more confused. My big advice is to never give up. If you start on Python, continue on it, try it out, and …

The Best 10 Powerful Computer Programming Skills Needed Read More »

The post The Best 10 Powerful Computer Programming Skills Needed appeared first on AYALR.

]]>
Overview

Let’s have a look at the best 10 powerful computer programming skills needed today!

I don’t want to suggest an infinite number of courses because, in the end, this might get you more confused. My big advice is to never give up. If you start on Python, continue on it, try it out, and by that, I don’t mean just reading and learning by heart. The learning curve for programming might be a little bit flat at the start. You may not have immediate results but the slow start should not hinder you. After all, you’ll be learning some of the biggest necessary skills for coding. Unleash your powers! Achieve self-reliance, patience, attention to detail, and stronger memory.

Computer Programming Skills Needed

1. Self-Reliance

Man walking towards his aim

A programmer should be responsible and work towards his aim without leaving anything to chance.

2. Language

books to learn the computer programming skills needed

A programmer should at least learn one programming or scripting language. There is a vast selection, you just need to look at some tutorials or you want to achieve and try some hands-on examples. However, I suggest you think about what kind of things you would like to achieve. For example, if you want to build web pages I would suggest looking at JavaScript, AngularJS, or ReactJS. If you own a blog or you wish to start blogging, I would take a look at PHP (programming language), JavaScript (scripting language), or HTML (a markup language).

3. Logic

programming logic on a whiteboard

Studying logic thinking will prove to be one of the most important tools for a software developer learning to build applications that cater to all kinds of scenarios.

4. Attention to detail

Skills for coding by showing a hammer and various nails not fixed correctly on a wooden board.
Attention to details – skill for coding
on Pexels.com

Concentration and focus are vital characteristics of a programmer.

5. Understanding computers

chef kitchen cooking baby
Baby chef cooking on Pexels.com

Effectively, computers are not smart. Actually, in another article, we compared computers to inexperienced chefs. Therefore, when you’re coding you have to make sure to specify exactly the behavior you need to achieve without leaving anything to chance.

6. Abstract Thinking

Abstract Thinking
Abstract Thinking

Software developers need to be able to abstract objects, hiding their complexity when building an application.

7. Patience

A programmer has to overcome the frustration of repeating some steps every time before any release. This might include compiling libraries, updating versions, committing code to the repository, updating the test server, testing on different environments, and then revert everything if any problem arises.

8. Strong Memory

Don't forget post it vs strong memory
Don’t forget post it helping a developer remember his tasks

Keeping in mind tasks and issues you have already experienced may help you solve newer problems similar to ones you’ve already encountered.

9. Agile Methodology

Showing a scrum board (an agile methodology)
A Scrum Board

An agile approach in contrast with waterfall methodologies, ensures adaptive, collaborative teams that release products quickly keeping the relative stakeholders up to date.

10. High Emotional Quotient

Emotional Quotient

Empathy is also one of the computer programming skills needed while communicating with clients, coworkers, and other stakeholders. Nowadays, EQ is deemed even more important than IQ especially if you aspire to work in a managerial position.

Conclusion

We have looked at the various computer programming skills needed. Effectively, the skills listed here are the building blocks of any good programmer independent of the language, tools, frameworks, and technologies used.

However, the list of skills mentioned here is not exhaustive. My intent is to show you that to be a good programmer you cannot just learn the language’s syntax and details by heart the same way that you cannot study Mathematics by heart. In general, you won’t find the exact solutions on books or online. First and foremost you need to understand well the problem you’re trying to solve and then trying to use what you’ve learned and apply it to find a solution.

The post The Best 10 Powerful Computer Programming Skills Needed appeared first on AYALR.

]]>
How To Make Custom WordPress Rest API Endpoints https://ayalr.com/how-to-make-custom-wordpress-rest-api-endpoints/ Mon, 31 May 2021 20:03:57 +0000 https://ayalr.com/?p=241 Do you want to request data through an APO from WordPress? Follow this article, to learn how to make easy and quick custom WordPress Rest API endpoints using PHP.

The post How To Make Custom WordPress Rest API Endpoints appeared first on AYALR.

]]>
More and more web services are nowadays consuming information and processing data directly from blogs. A JSON WordPress Rest API endpoint and text scraping are two common methods of linking blogs and web services. In this article, I am going to describe how I have created a JSON endpoint for the Cooked WordPress plugin to query recipes that will be used by a mobile app.

There is no doubt that the Cooked WordPress Plugin is one of the best alternatives for a food blog. It has amazing easy-to-use features that help you manage and add new recipes to your food blog efficiently like our sister blog WellbeingBarista food and lifestyle blog. Additionally, we thought that we could use the same recipes for a Recipes/Food app but felt that exporting and importing the data manually would be a little messy and inefficient.

So why not adding a JSON endpoint for the Cooked plugin?

Retrieving Recipes Stored by the Cooked WordPress Plugin

It seems that as administrators of the blog, we might be a little bit picky and managed to find out a missing feature! Currently, at the time of writing, there is no JSON endpoint API that allows you to dynamically export recipes albeit this is a very important feature if you need to hook up any web services with the blog.

Nevertheless, after investigating how the recipes are stored in the main WordPress database, it was trivial to come up with a spartan functional way to create this JSON endpoint. This simple solution offers a Rest API with two JSON endpoints:

  1. An endpoint to get a list of available recipes – https://your_domain.com/wp-content/plugins/your_plugin_name/api_name.php
  2. Another endpoint to return the detailed recipe object – https://your_domain.com/wp-content/plugins/your_plugin_name/api_name.php?recipeId=261 where 261 is an id retrieved from the response of the first endpoint.

Unfortunately, there was no database field to indicate the last modification date of the recipe, hence an SHA-based hash function was used to generate the version. A version is a very important piece of information for any web service consuming the JSON endpoint API. Otherwise, it would not be efficient to react to distinct recipe changes or updates.

WordPress Rest API – the PHP Source Code

Now let’s look at the PHP code that creates the JSON WordPress Rest API with two endpoints.. It should be noted that in order not to replicate config items, it makes use of the existing WordPress configuration.

<?php require "../../../wp-config.php"; ?> 
<?php 

$servername = DB_HOST; 
$username = DB_USER; 
$password = DB_PASSWORD; 
$dbname = DB_NAME; 

// Create connection 
$conn = new mysqli($servername, $username, $password, $dbname); 
// Check connection 
if ($conn->connect_error) { 
     die("Connection failed: " . $conn->connect_error); 
} 
if (!isset($_GET['recipeId'])) { 
     // No recipe id is set, hence return all the available ones. 
     $sql = "SELECT postId as recipeId, SHA(metaValue) as version from (select post_id as postId, meta_value as metaValue from wordpress.wp_postmeta where meta_key = '_recipe_settings') AS innerTable"; 
     $result = $conn->query($sql); $resultArray = array(); 
if ($result->num_rows > 0) { 
     // output data of each row 
     while ($row = $result->fetch_assoc()) {  
          $resultArray[] = $row; 
     } 
     echo json_encode($resultArray); } else { 
     echo "{}"; 
     } 
} else { 
     //Load the meta for specified recipe, avoiding SQL injection 
     $stmt = $conn->prepare("SELECT meta_value FROM wordpress.wp_postmeta WHERE meta_key = '_recipe_settings' and post_id = ?"); 
     $stmt->bind_param('i', $_GET['recipeId']); 
     $stmt->execute(); $result = $stmt->get_result(); 
     if ($result->num_rows > 0) { 
           $row = $result->fetch_assoc(); 
           echo json_encode(unserialize($row["meta_value"])); 
     } else { 
           echo "{}"; 
     } 
} 
$conn->close(); 
?>
Code language: PHP (php)

The PHP file ‘api_name.php’ was copied into a directory under plugins. However, it can be created anywhere as long as the reference to wp-config.php (line 1) is updated accordingly.

Testing the API

Now, using an API Testing Tool such as Postman or SoapUI call the two endpoints with the required parameters and check the responses.

The result should be like the following sample responses.

Sample Responses

A Sample Response of the WordPress Rest API Endpoint that returns a recipe detail given an Id.
Sample endpoint’s response when requesting for recipe details

A Sample Response of the WordPress Rest API Endpoint that returns all recipe Ids
Sample endpoint’s response when requesting all recipes in database.

Conclusion

After setting up the PHP file, your Cooked WordPress Plugin installation will have a WordPress Rest API. Beware that this is only a proof of concept that happened to extract data saved by the Cooked Plugin but the concept can be used for any data found on WordPress.

The post How To Make Custom WordPress Rest API Endpoints appeared first on AYALR.

]]>
How To Make WordPress Hosting Migration To Bluehost Now https://ayalr.com/wordpress-hosting-migration-to-bluehost/ Sat, 29 May 2021 18:14:48 +0000 https://ayalr.com/?p=222 5 Minute read. This is a proven use case of WordPress hosting migration from my previous host to Bluehost. I have smoothly transferred a lifestyle blog that I manage in an hour with no downtime. Let me quickly guide you through the steps needed to ensure a guaranteed smooth migration for free. Why choose Bluehost …

How To Make WordPress Hosting Migration To Bluehost Now Read More »

The post How To Make WordPress Hosting Migration To Bluehost Now appeared first on AYALR.

]]>
5 Minute read. This is a proven use case of WordPress hosting migration from my previous host to Bluehost. I have smoothly transferred a lifestyle blog that I manage in an hour with no downtime. Let me quickly guide you through the steps needed to ensure a guaranteed smooth migration for free.

Why choose Bluehost for your WordPress hosting migration?

My blog started its life on a very humble IT infrastructure. For about two years I hosted the blog in my own apartment running on salvaged hardware. Being an IT geek this is all too possible, and it can initially save you important funds that can be used elsewhere.  This implied putting in more time and effort to keep up with uptime, stability, security, and of course scalability in face of constantly increasing traffic. 

However, there comes a time when a blog owner needs to upgrade and outsource to a trusted supplier. In my case, the blog grew beyond a certain stage and it made sense financially and infrastructural point of view to upgrading my hosting. Alternatively, you might want to migrate, to host it in a place that ensures quick access to your main traffic source, uptime, scalability, security, and support. If you made your choice, now it’s time to migrate!

There are WordPress hosting companies around every corner. You can also create your own setup on some cloud like Azure, AWS, or Google Cloud. It took me considerable effort to compare and decide on my WordPress host. After investigating different pricing models and applying performance tests using tools like GTMetrix, I chose Bluehost. Apart from my research, Bluehost has been a recommended host by WordPress itself since 2005. There are various plans to choose from, but for the price of 2 cappuccinos a month, I purchased a plan that gives me unlimited storage, websites, databases, and bandwidth. They also throw in a free domain for a year, and a very good tried and tested customer support. 

The WordPress Hosting Migration steps

From this first step till the last one, make sure you don’t change any blog content, as such changes will likely be lost. Viewers will still be viewing content from the original WordPress until the last step is completed.

Backing Up Your WordPress Site

  1. Using FTP, or SSH download a copy of the wp-content directory of your original blog. 
  2. Login to your Bluehost admin and create a new WordPress site. Take note of the chosen directory name. Take note of the temporary website URL. Also, take note of the name of the newly created database. We will be using them in future steps.
  3. Using a MySQL client tool, or phpMyAdmin, take a database dump of the original blog. This creates a file with a .sql extension. Open it in a good text editor and remove the highlighted create database command. Also, replace the existing database name (‘wordpress’ in this example) with the name discovered in step 2.
WordPress Hosting Migration - Replacing the database name
WordPress hosting migration SQL file

Uploading your WordPress Site to BlueHost

  1. Using the Bluehost admin, create an FTP account so that it will allow you to upload the wp-content folder downloaded in step 1. You can also ask Bluehost customer support to enable SSH access to your server and do this step via SSH.
  2. Open the phpMyAdmin from Bluehost admin. Select the database identified in step 2. Select all tables, and drop them. After dropping the original tables, use the import function using the .sql file from step 3. Take note of the prefix for the imported table names. Usually, the prefix is ‘wp_’, but this might differ.
  3. With the database imported, always using phpMyAdmin, open the contents of the wp_options table. Replace the values for keys ‘siteUrl’, and ‘home’ with the temporary URL discovered in step 2.
  4. Go to the website management in Bluehost, and log in to the WordPress admin. Go to Settings > Permalinks, and just press save without making any changes.
  5. Using the FTP file access, open the wp-config.php file. Search for the key ‘$table_prefix’, and set the value discovered in step 5.
  6. At this point, you should be able to open your browser, point it to the URL value used in step 6, and the site should appear.You have now just finished your WordPress Hosting Migration!

Testing your WordPress Site on BlueHost

  1. You can now test the temporary site being hosted by Bluehost. Test navigation, make sure all your images and articles load correctly. Once you’re happy with the testing, you need to revert the change in step 6. This time use your proper site address as value.
  2. It is time to make your domain point to Bluehost. This final set of steps might take a number of days, as it all depends on DNS propagation which is out of everyone’s control.
  3. Using your domain provider settings, change the DNS values to:
ns1.bluehost.com
ns2.bluehost.com
DNS Values for your existing domain
  1. Using the ‘Assign’ functionality on Bluehost, type in your domain name. Bluehost will verify that you own the domain by checking its DNS configuration. Once verified, continue to assign it to the directory discovered in step 2.
  1. From now onwards you need to wait for DNS propagation to be over. Until this is complete, some viewers will still be getting content from your original host. In our case we stopped seeing traffic on the old host after 2 days. 

The above guide allows you to move your WordPress from an old hosting provider to bluehost. With some minor modifications, it can be used to transfer WordPress to any other hosting provider. From my personal experience with my blogs, I strongly recommend bluehost.com. This post contains affiliate links.

The post How To Make WordPress Hosting Migration To Bluehost Now appeared first on AYALR.

]]>
Why Programming is the New Must-Have Life Skill in 2021? https://ayalr.com/programming-is-the-new-must-have-life-skill/ Sat, 31 Oct 2020 12:08:28 +0000 https://ayalr.com/?p=117 Overview Programming offers essential skills such as problem-solving, attention to detail, focusing on a problem, and logical thinking. Additionally, it offers you a myriad of job opportunities, higher wages, more job flexibility, and enjoy a sense of self-reliance. In short, that’s why programming is the new must-have life skill! What is programming? We all have …

Why Programming is the New Must-Have Life Skill in 2021? Read More »

The post Why Programming is the New Must-Have Life Skill in 2021? appeared first on AYALR.

]]>
Overview

Programming offers essential skills such as problem-solving, attention to detail, focusing on a problem, and logical thinking. Additionally, it offers you a myriad of job opportunities, higher wages, more job flexibility, and enjoy a sense of self-reliance. In short, that’s why programming is the new must-have life skill!

What is programming?

We all have computers, tablets, or mobiles at home that want to do things for us. We built them to expect our next instructions. Take as an example your phone. Your phone does nothing until you give him the next instruction whether it’s playing a video, taking a photo, or saving a file. All our devices are waiting to do things for us. When we program we are taking advantage of our hardware and devices to do useful things for us.

Daily we use many applications that entertain us, assist us, and to a certain extent control our lives. Furthermore, these applications may not only guide us as a car navigation system. Automated systems will eventually take control of most of our lives. Did you hear about self-driving cars? I’m sure that sooner or later we’ll have them on the road and we’ll be surrounded by automated systems. Do you ever feel the need to understand better their internal mechanism? Nowadays programming is an essential tool to learn about the world around us. It is as important as learning maths, physics, history, or science.

What do you learn from programming?

Programming will teach you something about the world that will help you in all aspects of life. I’m talking about essential skills that can improve your life and that’s why programming is the new must-have life skill!

When we start developing our own code automatically we learn to:

  1. become more aware of scenarios why and where applications are more likely to fail,
  2. come with solutions to all problems in every sector of life,
  3. carry out tasks more efficiently increasing productivity due to enhanced focus.

Who can program?

A software developer programming

Everyone can learn to program. More and more people are learning some technology every day ranging from a simple script in Excel, writing a blog, or working with Canva. So why should you limit yourself in this world of new opportunities?

Essentially, programming is not only for math or computer whizz. Many TV series like Silicon Valley on Netflix, depict programmers as people with little social life who spend their entire day programming or playing computer games. On the contrary, I would say that no matter how old you are and whatever your background you can learn how to program. In fact, it’s almost certain that the young generation will start coding as part of their school curriculum, and in a decade all the new graduates will be knowledgeable more than you in this area. Basically, now it’s time to roll up your sleeves and get started!

Why do you want to start programming?

There are lots of reasons why you may want to start programming.

Programming as a career choice

You might be tempted to change position or work. Everyone knows that software engineers have a good salary, a myriad of opportunities, more flexible job opportunities, and a chance to develop your personal projects in your free time for personal pleasure and also revenue. Objectively, software development is a very good job if you can stick using sitting on a desk and focusing on one or multiple problems for at least 8 hours a day.

Alternatively, you may be looking for a job that allows you more flexibility to work from wherever you want possibly improving your lifestyle. Thus, especially in this pandemic programming is the New Must-Have Life Skill allowing you a greater choice of remote job opportunities.

However, starting to program for a career choice should not be your first goal unless you’re really passionate about it.

Programming for personal growth

Your main goal is to start writing programs that solve problems. Whether you’re an accountant, lawyer, or researcher, you might come across some data that you might need to process before being able to use it. You’ll be able to use computers to serve your own ends.

Actually, it is much easier to write a program for yourself because you don’t have to worry about a million users using your software. In the beginning, if it works for you then you’re happy. It takes a little more training to write software for thousands of other people.

How do you program computers?

Computers are like inexperienced cooks!

Programming can be easy! Have you ever created a new recipe from scratch using your cooking experience and knowledge? Programming is like creating a new recipe which the computer has to cook following blindly your instructions.

An inexperienced cook
An inexperienced cook on Pexels.com

Computers aren’t very smart on their own. It’s entirely up to us to make them behave as we like by providing them with a detailed set of instructions. Since humans are the ones that feed these devices with knowledge, we need to learn to speak their language. It’s much easier for us to learn to speak their language than it is for them to speak ours. Ultimately our goal is to translate what we need to achieve in their language and get them to work for us.

Think of the computer as a person (inexperienced cook) who never stepped his feet in a kitchen. Let’s give this cook a set of detailed and thorough instructions. He will follow these instructions using the tools and ingredients provided. If need be he might also have to get fresh ingredients from a given location.

In truth, a person will be bored with all the details a computer requires making it more likely to skip some important detail. In contrast, a computer won’t execute a program if any detail is missing.

Scenario: Inexperienced Cook vs Computer

Inexperienced cook vs computer
Inexperienced cook vs computer

How does a programmer think?

How does a programmer think?
How does a programmer think? on Pexels.com

In order to develop programs for end-users, you should imagine yourselves as being inside the computer. As a computer, you will be able to access the hardware components and peripherals. This includes the central processing, memory, network connection, disk drive, permanent storage mediating to accomplish what the user needs.

The major difficulty for beginners is getting used to the idea that a computer takes every word literally. Computers can’t compensate for small mistakes or assumptions that we as humans take for granted. For example, computers do not accept typographical errors. In fact, you need to make sure that every line is unambiguous naming and defining everything properly.

Another characteristic a programmer should have is some kind of problem-solving skills. Actually, you might be terrific at a certain computer language but fail in some basic important skills. It’s important that a programmer is diligent in breaking down a problem, recognizing patterns, and thinking of the most simple yet effective solution. Many people around us are not programmers but would excel in it! Nevertheless, some skills will improve in time. However, you have to accept that some people are just born to be programmers while others would excel more in other jobs.

What is the best language to start programming?

Python: Best language to start programming
Python: One of the best languages to start programming on Pexels.com

There is no simple answer to this question. As a developer with years of experience in coding Java EE applications, I am always tempted to direct people towards Java. Java has been around for more than 2 decades and if you are going to find a job in a big company you will probably need to learn Java.

On the other hand, I don’t think that Java is an easy language to start with. In fact, the strictness of its code that makes it popular with most developers might hinder beginners. Unfortunately, the use of boilerplate code makes programs longer making them appear more complex even to print a simple message on the screen.

That’s why I think that Python is probably the best option for beginners. You can start your first program writing a single line of code. Additionally, since the language is interpreted you have fewer restrictions than you’ll encounter in Java.

Whatever your decision, you’ll be a part of a larger community that knows Java and/or Python!

Conclusion

Still not convinced why programming is the new must-have life skill in 2021? Just try it out. Programming is much more fun than playing most games on your mobile. Start slowly and reach your goals a step at a time!

FAQ

The post Why Programming is the New Must-Have Life Skill in 2021? appeared first on AYALR.

]]>