blog

SOLID – Software Design Principles

Hi..

Been a long while since I have posted on my blog, hope you are all well. Thought i’d share some knowledge and in particular design principles to make your code more usable, extensible and test-ible!

Btw, if you feel that you need certain aspects of programming explaining then give me a shout via the contact page. Also, stay tuned as I will post a series of blogs where I will show you, step by step, how to build an application with the fundamentals of object-oriented programming.

[ S ] Single Responsibility Principle

Do one thing and Do it well!

The single responsibility principle is a computer programming principle that states that every module/component/class should have responsibility over a single part of the functionality provided by the software.

[ O ] Open Closed Principle

Be Open for extension, Closed for modification!

In OOP, the Open/Closed Principle states that ‘software entities’ (classes, modules, functions, etc) should be open for extension, but closed for modification; an entity can allow its behaviour to be extended without modifying its source code. If it is open for modification, you run the risk of unattended side affects – bugs in your code.

[ L ] Liskov Substitution Principle

Derived Classes Can Stand In for Base Classes

Programming to an interface provides the correct structural trait for the Liskov Substitution Principle. The Liskov Substitution principle was introduced by Barbara Liskov in her conference keynote “Data abstraction” in 1987. A few years later, she published a paper with Jeanette Wing in which they defined the principle as:

Let Φ(x) be a property provable about objects x of type T. Then Φ(y) should be true for objects y of type S where S is a subtype of T.

But let’s be honest such a mathematical representation of a principle might be necessary but it wouldn’t be entirely helpful for our daily work as software engineers.

The principle basically defines that objects of a base class shall be replaceable with objects of its subclasses without breaking the application.This means the objects of your derived classes will need to behave in the same way as the objects of your base class.

 

[ I ] Interface Segregation

The interface segregation principle states that no client code object should be forced to depend on methods it does not use. This basically means that each client code object should only implement what it needs & not be required to implement anything else.

Interface segregation principle is all about having lots of small, focused interfaces that define only what is needed.

Note: Put your interfaces on a diet, don’t feed them burgers!!

 

[ D ] Dependency Inversion

Dependency Inversion is based upon [ O ] and [ L ] and the general idea of this principle is as simple as it is important: high level modules, which contain complex logic, should be easily reusable and unaffected by changes in low-level modules, which contain utility features.

To achieve this you will need to introduce an abstraction that decouples the high-level and low-level modules from each other. Robert C.Martin’s definition of the Dependency Inversion principle consists of two parts:

High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions.

High-level and low-level modules depend on the abstraction. The design principle does not just change the direction of the dependency, as you might have expected when you read its name; but, it splits the dependency between the high-level and low-level modules by introducing an abstraction between them.

SO we end up with two dependencies:

  1. The high-level module depends on abstraction
  2. The low-level module depends on the same abstraction

 

That is all for now… I could go on forever showing code examples but I’m not sure if that is something you guys want. Please let me know if code examples help you more to understand design principles and I will remember for future to include them.

A ReactJS Overview

./.

In this post, I have covered what ReactJS is and the benefits of implementing it. I have not covered anything in depth here in terms of the basic concepts; Google will provide your answers.

ReactJS is an amazing library for creating highly reactive and super fast JavaScript-driven applications. Since JS runs in the browser, it allows you to create superfast applications which feel like mobile apps; users don’t need to wait for page reloads.

I understand the controversy of Angular and React; although the learning curve is different, it does not mean it is harder/easier; I think this is a matter of how good of a problem solver you are.

Currently, at my workplace, I’m developing an Angular based web-application and in my personal time, I am developing a dashboard using ReactJS. Experimenting with both technologies, I think the latter is better. The use of components makes it easier to develop the front-end and easier to manage. It is also scalable as the same component can be re-used over and over again.

Material UI is Google design. This is fantastic as you can explore many components which are ready to be used (open source ofc!) for your web-app. Many of these components you’ll be able to recognise on Google’s website. (Click here to go to Material UI Design)

With ReactJS you also have the option to create your own elements in HTML and render them as a component; this provides a lot of flexibility for when developing a tailored web-application.

There are many benefits of using and learning the basic concepts of ReactJS. ReactJS will allow you to increase your developer skills and code structure. This is vital for programming because when code is duplicated it becomes a really messy one.

What is React?

Simply put, “A JavaScript library for building User Interfaces”. React applications are not server-driven; by this, I mean that the application runs directly in the browser; you don’t have to wait for a server response to get a new page or render something new.

React is all about components; components on a web-page could be the “navigation bar”, “side-menu bar” or a “photo gallery” (etc). A component is an entity which exists by itself, and this component can be rendered by multiple different web pages. This means you can create a component, and re-use it over and over again.

If you take a look at any web-application, a lot of components are being re-used. Copy n pasting code is done to achieve this without React. However, with React, you can simply create and import a component wherever you would like it. As you can imagine, this makes life a lot easier.

 

Why React?

React makes it a lot easier when managing UI State. UI State becomes difficult to handle with Vanilla (normal) JavaScript. In bigger JavaScript applications, you have to manually target elements in your DOM and if you change the structure in your HTML code, chances are you’ll have to change the way you target your elements.

React allows you to focus more on the business logic and prevents your application from exploding. The UI and UX are seamless when using ReactJS framework; the speed at which the components are rendered is phenomenal and this should be something to think about as it will increase average time spent and conversion rates.

PILOT : A software developer’s journey and the amount of coffees consumed?

it can be bliss…

Although, blogging, has become something of the past and vlogging is something of the present, but we can all conclude that quality software content will always exceed; no matter which way it is presented..

To answer the question we must both look at each side and what they offer..

Blogging is text formatted mostly and is presented only on text..  they say if you can captivate someones attention for around 30 seconds on a web page that they will stay longer?…. is this true? comment below and tell me if you read up to this bit with a hashtag of #attentionSpan30Seconds. The lucky winner gets £5 to their PayPal account no question about it!

Vlogging is more video based and provides a transition of moving pictures. Visual form is more interesting, as it can lead to more creative paths and you can really see the flare of an individual. I think this is the reason that vlogging is a true winner. 

About me:

about me

Software software software…

My art of blogging may be different from what you normally consume. But that is okay, I guess the style of writing could be stemmed from consuming content that I naturally find interesting. Some of those is reading the biographies of billionaires, architectural design patterns for software,  SEO-related books (it’s awesome). Also, I’m a Casey Neistat fan too!

ASP.Net Core 2.0 Cross Platform Web Application Framework

Swiftly moving into the reason for writing this blog…

Intention

I’ve made an intention, which is to populate my personal blog which could be about anything to do with software; what I learn through reading; any architectural design pattern I come across (worth understanding and implementing): I’ll put it all up here maybe with examples (if you are lucky). From now on the goal is to just blog…

It is difficult to step foot into software developing, to be honest. Some of you computer science majors are finding it tough (the ones that usually skip class) and some are quite fluent. Programming is an art form and the more you program, the more you craft your art. 

Few reasons why I found software programming hard…

  • I came from a pure science background, Biology, Chemistry and Physics. 
  • I started university completely baffled at the idea of programming and its concepts
  • and just a lack of knowledge of computing in general as compared to those who took IT or Software classes in College – or ” in school “ for those of you living outside of England.

I thought I’d blog about software

After deciding whether to vlog or blog, I thought it’s easier with code related content to be on a blog layout. I can attach things directly to the topic I’ll be talking about, I can show code examples, and the list goes on…

There are 10 people in the world, those who can read BINARY and those who cannot.

Anonymous

I think the quote above, is important. You either understand computer science or you don’t. I like the idea of that because not everyone will be able to strive at it and that gives the people that do have the ability, to shine with their talent.

Here’s a book I’ve got a copy of (currently reading):

linkhttps://www.amazon.co.uk/Adaptive-Code-principles-Developer-Practices/dp/1509302581/ref=pd_lpo_sbs_14_t_0?_encoding=UTF8&psc=1&refRID=1XPWMC4WTS9Y6HN9YX4F

Definitely get this book, it is a must read. Gary Hall does a wonderful job.

Current software stack

I am currently using Microsoft’s tech stack. It’s pretty awesome. You can do some dynamic stuff when it comes to cross-platform, web-application development.

What do you code with? (comment your code stack)


Angular is a must when it comes to the front end framework, I guess most of you would argue that React is… to be honest, I don’t care. You pick a framework and you work with it.. don’t overcomplicate the small details, you’ll forever find yourself in a loop!

Code is Poetry


Catch you later!

Why MARKETING is IMPORTANT

Intro

Everyone who has an idea must acknowledge that marketing plays a huge role in creating a revenue stream. In this blog, I will uncover the truths of marketing and plans to increase revenue streams. The epicentre of your business’s success lies in its marketing. Most if not all aspects of business depend on marketing. The overall marketing umbrella covers advertisements, public relations, promotions and sales. It is a process of introducing a product and increasing revenue, by promoting it to potential customers.

 

Product vs Marketing

This is quite an interesting topic to talk about. What if the product that is being sold holds no real value, doesn’t scream the *wow* factor out loud but the marketing was merely perfect? So, for example, in this situation, a lot of negativity will come down to the branding side-of-things. Branding does matter! And from this catastrophe, public relations would decrease and any future promotions, advertisements and sales would be sceptically thought of, by past customers or potential buyers.

So, what I’ve basically said is that although marketing is itself (at the very core of things) is extremely vital, you have to ensure that your product boasts the wow factor. Even if you’re already sure that people love your product, you’ve got to get a grasp on your customers’ experiences and opinions by reaching out to them. Only then will you truly know if your product is a must-have.

The must-have survey is a straightforward and succinct method to reach a very clear understanding of what your customers think about your product. And all it really takes is to ask a  simple multiple-choice question such as:

  • “How disappointed would you be if this product no longer existed tomorrow?”
    • (A) Very disappointed
    • (B) Somewhat disappointed
    • (C) Not disappointed

You can be confident if the statistics come back as: 40% of your customers choose “Very disappointed”. This is a clear indication that you must continue to improve and develop your product. If this is the case, don’t fret – there are quick, efficient and inexpensive ways to experiment with how you can communicate your product’s value.

One method is A/B testing. This is a method of testing the effectiveness of two different messages or product variations. A super advantage about A/B testing, whether it’s being done face-to-face or online, is that it doesn’t have to be expensive. Crucial insights can be gained by implementing new ideas. For example, like showing a video demonstration of a product highlighting potential new features (even if the tests prove unsuccessful, the feedback you’ll get is exceptionally vital!).

Data Metrics

Identifying key data metrics will enable growth-hacking progress for your business. In reality, one of the best ways to drive traffic to your site is to figure out which metrics matter most to generating growth. Standard metrics for online businesses include web traffic, user acquisition and returning users. But that is not to say your business will not have unique metrics that specifically fit your growth. It’s vital to identify these unique metrics as soon as possible otherwise you’ll be distracted from what really matters.

To find out these unique metrics, you need to ask yourself:

which customer actions can be measured to reveal how positive their experience with your product is?

North Star

It is essential to find one key metric to serve as your North Star. Your North Star is the one metric that, above all others, best measures the core values that your product is delivering. For example, at Facebook, the North Star is the ‘daily active users’.

 

Kick-ASS Growth Hacking Techniques!

Stage 1: Analyse

  • How do our customers typically behave?
  • What are the characteristics of our best customers?
  • What events lead customers to stop using our product?
  • What time of the day are customers most actively purchasing the product?

Surveys and other marketing means should be used to collect this valuable data. When this data is received, it should be analysed, trends and patterns should become apparent. These insights can be shared and discussed where brainstorming can happen: to then form new growth-hacking innovative ideas.

Stage 2: Ideate

The ideate stage is developing new ideas, and all proposals should go through the idea pipeline, which works by offering a structured format to log, track and evaluate all the incoming ideas. This would involve giving each idea a short name such as “Loyalty Rewards” and briefly describe the who, what, when, where, why and how. Also, make sure you note the action and the outcome: for example, “by rewarding customer loyalty, we’ll increase the number of returning customers by 40%”. Make sure you jot down the metrics that can be used to track the performance of proposed ideas.

The best way to have a good idea is to have lots of ideas

Marketing book reading gif image

ICE Scoring System

Impact

Impact is an evaluation of growth, the higher the growth, the greater the impact.

Confidence

Confidence is determined by the proposer, it is the conviction that the idea will succeed but backed by relevant data.

Ease

Ease is rated according to how much time and resources the idea will require.

FINAL SCORE

Each category (Impact, Confidence and Ease) should be scored out of 10 and then the mean average of all scores. This way you will find out which idea ranks highest and lowest; also, it would give insight to which idea should be proposed first. You could potentially group specific ideas together and this way you could get a lot more analytics to see if the idea performs better with another attached. Or, you could release an idea at a time to get more precise answers from the user’s behaviour. It is crucial that you take note of all observations as this will help in generating a new idea or improving a current one.

Marketing-Statistics

END

Thanks for reading today’s blog about marketing, it’s surely an interest of mine. I spend many, many hours reading and watching seminars online on this topic. I assure you that the knowledge being dropped here is of value and you should take note and most importantly, action. ACTION will generate results not reading.

Bye for now and on to the next one!😁

 

Super Intelligence (SI)

What is it?

Super Intelligence.. sounds very sophisticated but actually, it is really sophisticated. So let me start by giving a warm welcome to you all and potentially new visitors. I’ve been reading a lot and researching lately and Super Intelligence has been something of interest to myself. It has actually been quite an interesting topic to read about. So without further ado:

How many sci-fi series have you seen that showcase some type of SuperIntelligence? Probably quite a few (to those avid sci-fi lovers). In SOME films such as Terminator, they come to deplete the human race. Others come to give us a helping hand, like Wall-E (quite adorable little thing isn’t it?).

Of course, these robots are quite fictional characters but will the future bring SuperIntelligence? If it does what would they look like and when will they appear?

 

In SuperIntelligence, we learn about the topic of AI (Artifical Intelligence). But more so, we discover the moral, ethical & safety concerns that we need to address; and the best way to create an intelligent machine.

 

 

Some history

Did you know the pace of major revolutions in the tech-world has been increasing over time? For example, improving at a snails pace of a few hundred thousand years ago, human technology would have needed one million years to become economically productive enough to sustain the lives of an additional million people. This number dropped to two centuries during the Agricultural Revolution in 5,000 BC. And in our post-Industrial Revolution era, it shrunk to a mere 90 minutes.

A tech-advancement like the advent of SuperIntelligent machines would mean a radical change for the world as we know it. But where does technology stand at present?

We have already created machines that have the capacity of knowledge to learn and reason using information from humans. For example, consider the automated spam filters that keep our inboxes free from annoying mass emails and save the important ones.

When it comes to building a SuperIntelligent machine that can learn and act without the need of a human, it may still be many, many decades away. But advancements are happening quickly and we must not shy away from the fact that it could be upon us faster than we may think. Such a device would hold a certain value over our lives and its intelligence could be dangerous.

History of Machine Intelligence

Since the invention of computers in 1940, scientists have been working to build a device that can think. One major advance in Artifical Intelligence (AI) are man-made machines that mimic our own intelligence.

However, the story begins with the 1956 Dartmouth Summer Project, which endeavoured to build intelligent machines that could do what humans do. Some machines could solve calculus problems and others could write music and even drive cars. But there was a roadblock: inventors found that increasing the complexity of the task, would result in more information the AI needed to process. Hardware to take on such difficult calculations was unavailable.

By the mid-1970s, interest in AI had faded away. But in the early ’80s, Japan developed expert systems. Which were rule-based programs that helped decision-makers by generating inferences based on data. However, this tech introduced a problem as well: the huge banks of information required proved difficult to maintain, and again, the interest dropped.

The ’90s witnessed a new trend: machines that mimicked human biology by using tech to copy neural and genetic structures. This process brings us up to the present day. Today, AI is present in everything from robots that perform surgeries to smartphones to a simple Google search. AI tech has improved to the point where it can beat the best players at chess, Scrabble and Jeapoardy!

But even our modern tech has issues: such AIs can only be programmed for one game and there’s no AI capable of mastering any game.

However, our children may see something much more advanced – the advent of SuperIntelligence. In fact, according to a survey of international experts at The Second Conference on Artifical General Intelligence at the University of Memphis, in 2009, most experts think that machines as intelligent as humans will exist by 2075 and that Super Intelligence will exist after another 30 years.

SuperIntelligence likely to emerge in 2 ways

It’s clear that mimicking the human intelligence is an effective way to build intelligent tech. So, while some scientists are favouring in designing a synthetic machine that simulates humans (through AI..), others stand by an exact limitation of human biology, a strategy that could be accomplished with techniques like Whole Brain Emulation (WBE).

What are the differences between the two?

AI mimics the way humans learn and think by calculating the probability. Basically, AI uses logical reasoning to find simple ways of imitating the complex abilities of humans. For example, an AI to play chess chooses most optimal move by determining all possible moves and then picking the one with the highest probability of winning the game.

Therefore, an AI that does more than just play a game of chess would need access to vast data. The problem is that present computers can’t process this amount of data fast enough.

But are there ways around this?

One solution could be to build “the child machine” – Alan Turing quoted. A computer that has basic information is designed to learn from experience.

Another could be Whole Brain Emulation. WBE works by replicating the entire neural structure of the brain to imitate its function. One advantage this method has over AI is that it doesn’t require a  complete understanding of the processes involved, behind the human brain. For example, scientists could remove a stabilized brain, scan it and translate it into code. But I guess we’ll have to wait for that one. The tech necessary for this process (high precision brain scans) likely won’t be developed any time soon. But, one day, someday, it will 😁

The fact that there are many paths that lead to SuperIntelligence should increase our confidence that we will eventually get there.

BE CAREFUL what you wish for

You’ve probably heard it a million times over, but there is wisdom in being careful of what you wish for. While we may be striving to attain SuperIntelligence, how can we ensure that the technology doesn’t misunderstand its purpose and cause unspeakable devastation?

The key to this problem involves in programming the motivation for SI to accomplish various human-given goals. Say we designed a machine to produce an object, but what’s to prevent the machine from taking its task to an extreme and sucking up all the world’s resources to manufacture a mountain of objects.

This is quite tricky, in fact, while AI is only motivated to achieve the goal for which it has been programmed, an SI would likely go a bit overboard and crazy.

But there are solutions to this problem. For instance, SI, whether it be AI or WBE, can be programmed to learn the values of a human on its own. For example, a Super Intelligent machine could be taught to determine whether an action fits within a human’s moral and ethical values. And rightly so when it detects that it doesn’t fit within these values then it will abort the mission. However, the machine would calculate whether a proposed action is inlined with the goals of a human. With experience, the AI would develop a sense of which actions are considered to be normal and the actions that are considered to be crazy.

Power to the Superintelligent future!

It’s quite clear that an entirely robotic workforce would completely transform the economy, as well as our lifestyles and desires; as machine labour becomes the new, cheaper norm, the pay of workers will drop so low that no human will be able to live off a paycheck.

However, it depends where that money ends up. Also depends on whether SI is designed by a single exclusive group or is the result of a slow collaborative process. If the former turns out to be true, most people would be left with few options for income generation. It is likely that they’d be renting housing to other humans or relying on their life-savings and pensions.

Better safe than sorry

It’s clear that development of SuperIntelligence comes with a variety of safety issues and, in the worst case scenario, could lead to the destruction of humankind. While we can take some precautions by considering the motivation for the SI we build, that alone won’t suffice.

What will suffice?

Considering every single potential scenario before bringing a hyper-powerful force like SuperIntelligence into the world. For instance, imagine that some sparrows adopted a baby owl. Having a loyal owl around may be a nice one; the more powerful bird could guard the young, search for food and do any number of other tasks. But these great benefits come with a great risk: the owl might one day realise it’s an owl and eat all the sparrows. The end.

Therefore, an intelligent logical approach would be for the sparrows to design an excellent plan for how to teach the owl to love sparrows, while also considering all possible outcomes wherein the owl could become a demon.

Problematic scenarios

The problem is knowledge. As deep and hard that cut may be. Scientists would forgo safety to speed up their process and wouldn’t share their work with others. That would mean if an SI project went horribly wrong and threatened humanity with extinction, too few people would understand the machine well enough to stop it.

On the other hand, if governments and institutions and research groups join together: they could slowly build a safe and highly beneficial Super Intelligent machine. That’s because groups could share their ideas for safety measures and provide thorough oversight for each phase of the design.

 

WELL DONE!

You made it to the end! So I congratulate you. Hope you enjoyed it and stay tuned for more.

 

Peace

 

 

Welcome to a new BEGINNING

Bilaalsblog – Hello World!

It’s basically what mostly all computer scientists write to test a function or whatever piece of code they have doubts in. ANYWAY, back to the topic. Bilaalsblog is currently about 1-week old and it’s still a baby in the blogging-world. I don’t really know what I will pursue through blogging but here it goes.

QUOTE ALERT:

We keep moving forward, opening new doors, and doing new things, because we’re curious and curiosity keeps leading us down new paths –
Walt Disney
So yeah. On that basis I could end this blog post but guess what? I won’t.
I have a lot of things to express and need to put out to the world, for the people’s benefit. Firstly, if you haven’t already guessed by now, my name is Bilaal. And what a pleasure to type to you: knowing that you’ll be reading this. SO without further ado I will talk about Bilaalsblog.

SO…

Blogging is totally new to me, I don’t know where to start. But I’m going to take the general consensus of what blogging is percieved to be on the internet and apply it to Bilaalsblog. Learn and apply is the method. If you learn and keep learning you almost put the essence out of learning. So my plan is, for now, to keep blogging about general stuff and things I may learn on a day to day basis. So that YOU could benefit. It could be something that one could ponder over, or I may decide to go off on a slight tangent and write about philosophy (a great interest of mine). Like I said, I don’t really know; so why don’t you stick around and be in tune with me.
From time to time, I could upload my thoughts, travel quotes or even my status. I have quite a busy lifestyle, working 9-5 and working on personal projects consumes most of my time from monday-friday. I wouldn’t want to promise you a guarenteed upload time, i’ll upload whenever I have the time to do so. But, mark my words, the sort of style i’ll bring across will be of value. I would hate to waste your time in reading garbage, I don’t believe in that.

Wrapping things up

I’m glad you made it to the end, well done 😁. I hope you come back to Bilaalsblog one day and enjoy my weekly content  (i hope it’s weekly anyway). But for now, I will say my goodbye’s and wish you a great evening.

 

Peace