Posts

How JavaScript Uses Hashing

Image
 How JavaScript Uses Hashing Hashing Hashing has to do with taking a certain value (for example your password), applying some kind of mathematical operation to it (called a hashing algorithm or a hashing function) and getting the resulting changed value (known as a hash or hash value or digest message). So one can say that hashing simply means using some function or algorithm to map object data to some representative integer value. This so-called hash code (or simply hash) can then be used as a way to narrow down our search when looking for the item in the map. Generally, these hash codes are used to generate an index/key, at which the value is stored. Hashing is designed to solve the problem of needing to efficiently find or store an item in a collection. So one benefit of using hashing and in turn the key-value relationship hashing creates, is to store passwords in databases securely.  As it would be very insecure to store all passwords as plain t

Interfaces in Object Oriented Programming Languages and Prototype-based Languages

Interfaces in Object Oriented Programming Languages and Prototype-based Languages Interfaces An interface defines which methods and properties a class must implement .   Interfaces are a key concept in OOP.  Interfaces specify what a class must do but not how they go about doing it. The interface itself does not contain any code to implement an object. Therefore a class is used to implement an interface, interfaces have to be implemented by a class before you can access them.  Therefore, the interface hides all unnecessary implementation from the user. Thus one can say that interfaces are used to achieve abstraction, as abstraction   involves showing only the relevant data and hiding all unnecessary details of an object from the user. This is a notable benefit to the use of interfaces as you can use an interface to achieve security i.e. hide certain details and only show the important details of an object (interface). Another key benefit

Big O Notation Basics for Web Developer

Image
Big O Notation Basics for Web Developers Big O notation “Big O notation is a mathematical notation that describes the limiting behaviour of a function when the argument tends towards a particular value or infinity. It is a member of a family of notations invented by Paul Bachmann, Edmund Landau, and others, collectively called Bachmann–Landau notation or asymptotic notation.”   — Wikipedia’s definition of Big O notation In other words one can say that Big O notation is a mathematical notation for describing the performance or complexity of an algorithm.  Why this is important for web developers is because i t enables a web developer to determine how efficient different approaches to solving a problem are, as  Big O Notation is a way to represent how long an algorithm will take to execute.  Further  it will allow the early detection of potential performance and optimisation issues. Complexity Growth Illustration  Here are some common types of time complexities in Big O Notation. O(1)

Concurrency in Web Development

Concurrency in Web Development Concurrency Concurrency is everywhere in modern programming, whether we like it or not, for example: m ultiple computers in a network, m ultiple applications running on one computer and even m ultiple processors in a computer. But ... what is concurrency ?  Concurrency simply relates to an application that is processing more than one task at the same time .   C oncurrency is essential in modern programming: Web sites must handle multiple simultaneous users Mobile apps need to do some of their processing on servers (“in the cloud”) Graphical user interfaces almost always require background work that does not interrupt the user Concurrency is crucial in the field of Web Development, as highlighted above, websites must be able to handle multiple simultaneous users. Whilst browsing a website, users will demand a number of requests from the web servers and these web servers need to support these requests at any given moment.  This is made possible through the