Avinash Meetoo

Let us build a Smart Mauritius

Search

  • Home
  • About
  • Curriculum Vitae
This work is licensed by Avinash Meetoo under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License. Creative Commons License

Powered by Genesis

Standard C++ — Evolution at its best

20 June 2022 By Avinash Meetoo Leave a Comment

Using the right tool at the right moment is the best way to increase productivity. Those who have a thorough knowledge of the different tools in existence (with their key functions and major weaknesses clearly identified) can prove this sentence true. The purpose of this article is to give a brief outline of what C++ is capable to do as a tool, following its recent standardisation.

I wrote this article way back on 25 March 1999, after having joined DCDM Consulting as a Business Analysts, fresh from my Computer Science studies in France, and having had the pleasure and experience of writing a major software in C++ during an internship in a startup called Technodigit in Lyon. Some parts of the article are outdated but most of its content is still relevant after 23 years…

C++ as a programming language

The C++ programming languages was devised by Bjarne Stroustrup in the early eighties as a better C. C++ has a clearer syntax and, as a result of it being object-oriented, was much more adapted to handle complexity.

With time, vendors including Microsoft and Imprise (formerly Borland) customised the language for their needs. In parallel, Bjarne Stroustrup and his colleagues at Bell Labs introduced new features in the language like exception handling, templates and namespaces. As a result, C++ became more complex and therefore more confusing to the programmers. At the beginning of the 90’s, C++ was already a highly powerful tool but so complex that very few people mastered it.

The need for Standard C++

The American National Standards Institution (ANSI) and the International Standards Organisation (ISO) decided therefore to set up a committee to work on a Standard C++ project, with the ideas of purifying the language while adding essential but overlooked features to it. Bjarne Stroustrup quickly joined the committee together with Alexander Stepanov and Meng Lee, destined to become heroes of the C++ community.

The Standard Template Library

Alexander Stepanov and Meng Lee introduced the Standard Template Library (STL) to Standard C++.

STL has a dual personality: it is both a container library (with facilities to handle dynamic arrays, linked lists, trees and so on) and it enables one to program using generic and functional paradigms.

A new way of thinking: containers and iterators

STL defines different kinds of containers such as dynamic arrays, lists and trees together with numerous operations acting on them (like adding and deleting elements). One of the major breakthroughs of STL is the fact that the complexities of these different operations are known and are invariant. Adding an element to the head of a list always takes constant time whatever the size of the list. The programmer can therefore calculate the complexity of his own algorithm based on the published complexities of these STL operations.

The elements of a container are accessed via iterators. These special objects mimic C++ pointers. An algorithm to read all elements of a container must do the following: set an iterator to point to the first element and access the other elements by incrementing the iterator until the end of the container is reached…

When the OO, generic and functional worlds meet: generic algorithms

… which brings us nicely to genericity. Given that all STL containers are accessed through iterators, generic algorithms can be devised which work with all containers (whether dynamic arrays, lists, trees, etc.). The complexity of a generic algorithm depends, of course, on the container on which it is being used. The current version of STL has about 80 generic algorithms including functions such as find, fill, randon-shuffle, sort and reverse among others.

If the programmer decides to implement a new container (e.g. b-trees) having the same semantics of an STL container, all 80 generic algorithms will immediately work as expected thereby greatly increasing productivity by cutting development time. In the same way, writing a new algorithm (e.g. topological_sort) respecting the principle of genericity will enable it work with all STL existing containers.

Function objects

Another breakthrough in STL is to treat functions as objects. They can be passed as arguments to other function objects and can be composed with other function objects. Furthermore, they can be used as higher-order function objets (that is, functions returning functions as result). We can say that well-written STL function objets as just like mathematical functions. Well-written in this context means that the function objects does not have side effects.

This feature enables the functional paradigm to be used in C++. Specifically, composition of function objects can be used as a technique to handle complexity. Each function object (whether written by the programmer or not) can be considered as a component and these can be glued together to solve computing problems. A central repository of function objects can be set up and every time a component having certain behaviours is needed the programmer can check if an equivalent function object exists in this repository. Electronic or civil engineers have used this technique for many years and it is high time that computer engineers start to use it. The immediate benefit is a decrease in development time.

The Way Forward

Standard C++ is a major advancement over C++ just like C++ was over C. Owing to STL, component-based programming is becoming possible. Thinking in terms of containers, generic algorithms and components enables the programmer to concentrate on what is really important for the client: having a working solution for his problem that respects requirements and which is delivered on time. The big question is therefore whether the programming community is ready to embrace this new technology.

In the near future, it is estimated that this leading-edge technology will enable customisation and development of programmes to take up to 40% less time implying faster customer service at lower costs.

Filed Under: Computing, Education, News, Technology

What is high inflation and what can we do?

3 May 2022 By Avinash Meetoo Leave a Comment

Inflation is rising all over the world

I am not an economist but I have a family and it is important for us to be financially literate and sound. I have been hearing, for the past few months, that inflation is rising all over the world and is currently at 6.3% in Mauritius according to my own calculations. The last time the rate of inflation was that high in Mauritius was in 2011, eleven years ago.

I am trying to understand what effects a rising inflation will have on the country’s economy but also the economy of a typical household. I am doing that by reading a lot of articles online, watching relevant videos on YouTube as well as participating in a few selected online forums.

Why inflation is so high?

As observed in an article in The Conversation, the population generally feels that COVID-19 is under control and are going out and consuming / purchasing more now.

People are using their own savings made during the pandemic but also the stimulus checks and other pandemic-related aid they obtained from Government.

In some countries, because of the Great Resignation currently happening, companies have had to increase salaries to retain their departing staff. This contributes to an increasing inflation. I don’t think that salaries are increasing in Mauritius yet but I might be wrong…

Consequently, as demand is increasing, sellers are increasing the prices for products and services (and this is what inflation basically is).

The disruptions in shipping and logistics are also contributing to increased prices. There are also chip shortages for important electronic products.

Why high inflation is bad?

High inflation means high prices and poor people will start having difficulties. This is already happening in many countries and can give rise to social unrests.

Companies also suffer when inflation is high as they buy their raw supplies at higher prices. They are forced to sell at a higher price too to keep their profitability (or they need to lower their expectations or decrease production).

If inflation continues increasing, then there is the risk of hyperinflation. This has happened in the past in a few countries.

How does central banks limit inflation?

The best way to control inflation is to incite people and companies not to consume or purchase too much. The way to do that is to increase the interest rates on savings in banks.

Right now, it is around 0.4% per year in Mauritius and, with a 6.3% inflation rate, people have (nearly) zero incentive to save. Better use the money, which will be worth 6.3% less next year, and get the latest car or TV, they say.

The central banks will surely decide to increase the interest rate on savings this year. Of course, people will save more and, hence, the economy will slow down. Similarly, borrowers will have higher interest rates to pay which will also incite them not to borrow too much thereby slowing down the economy even more.

But slowing the economy too much is as dangerous as letting prices increase.

Central banks will definitely have to be careful in their approach.

I am trying to understand what to invest in (securely) in times of high inflation. I will write a post on that. Meantime, please free to offer your suggestions in the comments section.

Filed Under: Education, Finance, Future, News, Society

Privacy Policy for Free Mobile Application

1 January 2022 By Avinash Meetoo Leave a Comment

Avinash Meetoo built this app as a Free app. This Service is provided by Avinash Meetoo at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible in this app unless otherwise defined in this Privacy Policy.

Information Collection and Use

For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not collected by me in any way.

The app does use third-party services that may collect information used to identify you.

Link to the privacy policy of third-party service providers used by the app

  • Google Play Services

Log Data

I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.

Cookies

Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device’s internal memory.

This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.

Service Providers

I may employ third-party companies and individuals due to the following reasons:

  • To facilitate our Service;
  • To provide the Service on our behalf;
  • To perform Service-related services; or
  • To assist us in analyzing how our Service is used.

I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.

Security

I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.

Links to Other Sites

This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.

Children’s Privacy

These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.

Changes to This Privacy Policy

I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.

This policy is effective as of 1st January 2022

Contact Us

If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at .

Filed Under: Computing, News, Technology

  • 1
  • 2
  • 3
  • …
  • 12
  • Next Page »

I am proud of

My family
My company
My music
My photos

A few posts at random

Privacy Policy for Commercial Mobile Application

How to Succeed Overnight in Ten Years

World Creativity and Innovation Day

Recent Posts

  • Standard C++ — Evolution at its best 20 June 2022
  • What is high inflation and what can we do? 3 May 2022
  • Privacy Policy for Commercial Mobile Application 1 January 2022
  • Privacy Policy for Free Mobile Application 1 January 2022
  • Mauritius becoming a Knowledge Society 27 September 2021

I am active on

Facebook
FB Page
Twitter
LinkedIn
Reddit
Hacker News
Stack Overflow
GitHub
Wikipedia
YouTube
IMDB
Last.fm

All posts

  • June 2022 (1)
  • May 2022 (1)
  • January 2022 (2)
  • September 2021 (1)
  • June 2021 (2)
  • February 2021 (1)
  • January 2021 (2)
  • November 2020 (1)
  • October 2020 (1)
  • September 2020 (1)
  • August 2020 (1)
  • May 2020 (1)
  • April 2020 (3)
  • March 2020 (4)
  • January 2020 (1)
  • July 2019 (1)
  • June 2019 (1)
  • April 2019 (2)
  • January 2019 (1)
  • December 2018 (2)
  • September 2018 (1)
  • August 2018 (1)
  • April 2018 (1)
  • January 2018 (1)
  • December 2017 (1)
  • November 2017 (1)
  • October 2017 (1)
  • August 2017 (1)
  • July 2017 (1)
  • May 2017 (1)
  • March 2017 (1)
  • February 2017 (1)
  • August 2016 (1)
  • July 2016 (1)
  • June 2016 (3)
  • April 2016 (3)
  • March 2016 (3)
  • February 2016 (1)
  • December 2015 (1)
  • November 2015 (1)
  • October 2015 (1)
  • August 2015 (5)
  • June 2015 (2)
  • September 2013 (1)