About this blog

A couple of years ago I decided to try and learn c++ so that I could write an enterprise resource planning application for my own company. Why I decided to do this in C++ rather than C is a mystery, but I made my decision and am sticking with it (it could have been worse; I could have picked Java).

I wanted an application that was both lean, fast and secure and so after a bit of research I decided to write it using Ncurses rather than using a full on graphical user interface.  I suppose I could have written it in php, but I went with Ncurses for a number of reasons which were:

  1. It’s fast:  Even on the slowest mobile connection an Ncurses screen will refresh as fast as if you were using it locally with hardly any lag.
  2. It is secure:  Running a server based application over ssh means that managing security is little more than a case of keeping openssh up to date.
  3. It can run on thin clients:  It is very easy to build a thin client out of an old laptop that does nothing other than run the application.  This keeps the minds of your staff focused as there is no option to have a hidden browser open so they can check what their friends had for dinner on facebook.
  4. No client installs:  Yes this is also true of php or any other browser based application, but there are no cookies to worry about with Ncurses.  Ok, so at a push you may need to install PUTTY on Windows, but that is about it (and technically it isn’t even an install per se).
  5. Less maintenance:  Ncurses is extremely mature, and as a result it requires very little maintenance once it is built.
  6. No incompatibility issues:  A terminal is a termial, no need to worry if it will be readable in FireFox, Chrome, Internet Exporer, Edge, Opera et. al.  The most technical compatibility issue is that you might need to change the font.
  7. Function keys are quicker than the mouse:  By integrating the Ncurses soft labels and function keys in your application you can keep the interface clean and fast for the user.
  8. Information overload:  Over the years I have seen some truly awful applications that try and present absolutely every piece of information on a single screen with small tables and drop down lists all over the place.  The user is presented with dizzying array of menus and options and has a great deal of difficulty in finding the exact information that they are looking for.  A well planned Ncurses application will present just the right amount of information enabling them to find what they are looking for without going cross eyed.
  9. Expandability:  Ncurses uses so little in the way of resources that scalability and expandability is not going to be a problem.

Yes, there are times when I wish that I had started this in something else, but in the end, after looking properly at other options I do think that I made the right choice

For my back end database I chose Postgresql: Why Postgresql?  I could get all technical here about database performance etc. etc., but the truth is that I thought that the name Mysql was a bit naff and the next on the list was Postgres.  Not really a great answer I know, but to be honest one relational database is very much like another as far as I can see.  I haven’t had any problems with Postgresql, it is well documented, does everything I want it to do and is lightening fast.  I cannot say I made the best decision here because I haven’t used any of the others, but it certainly wasn’t the worst.

I am no expert at c++ and I am sure that throughout this blog there will be examples where readers have a better way of doing things;  Great! feel free to drop me a line and let me know how , I am always keen to learn.

Some of you will be wondering why I haven’t used wrappers in my program, and the truth is that I don’t see the point.  I am not trying to write a program that conforms in every aspect to some paradigm; I do use objects and polymorphism quite extensively, but not everywhere.  This blog is to show how it CAN work, it is not the definitive way of doing things, it is just how I am doing them so while I am always open to learning new ways of doing things, if all you want to do is bitch about coding style then take yourself off to stack overflow.