C Programming Use Continues

C Programming Language

The C Programming Language was developed by Dennis Richie and Ken Thompson at Bell Laboratories between 1969 and and 1973. It was the successor to B and used to create Unix. The recent bad experience with the Multics time sharing operating system development had made Bell Laboratories sensitive to that sort of cost blowout so the project was not widely promoted until the first working version was complete.

 

Ken Thompson and Dennis Ritchie

Ken Thompson and Dennis Ritchie

So what did C bring to the table that made it such a valuable asset? Here is a list:

 

  • can be used to directly interface to and manipulate hardware and IO
  • so it allows you to get close to the hardware itself
  • was a procedural programming language supporting structured programming
  • can be used to write an operating system
  • or sits very close to the operating system
  • had flexible naming conventions
  • had flexible memory allocation (static, local, global and dynamic)
  • could be compiled to machine language with a relatively simple compiler
  • is portable (mostly)
  • compiles to very fast executing code
  • compiled program can run without an operating system and do not need a virtual machine or any other components

The disadvantage compared to more modern procedural programming languages is that you usually do more typing to achieve the same outcome, it isn’t object oriented by nature and the variable typing is flexible so you can create some spectacular program failures if you get the cast wrong or convert a void pointer (no type associated with it) to the wrong data type. And one big compatibility issue is Endianness where different computing architectures store multi-byte data with the high byte at the top or bottom of the word so you can’t just swap binary data and expect it to always work. So you surely you would think we would have moved on to something better?

 

Programming Language Usage Trends

A recent study of computer language trends over the past 10 years by Embedded Gurus shows that unlike the anticipated rise of the C++ Programming Language in embedded systems, the use of C is rising and C++ falling. You can read the full article at C: The Immortal Programming Language where we see that Assembly Language use is falling as expected, the use of  C Programming Language is actually rising.

 

Programming Language Use Trends

Programming Language Use Trends

Now to be clear, this is for Embedded Software Development. In Top Programming Languages 2017 we see that Python is the most used programming language in the world across all domains with the  C Programming Language coming in second overall. This is a very big jump for Python but also a jump for the C Programming Language.

 

Successful Endeavours Programming Languages

At Successful Endeavours the majority of our embedded systems code is written using the C Programming Language . Our Windows code is a mixture of C and C++. For website development it is PHP and Python. So that’s 4 of the top 10 programming languages listed in Top Programming Languages 2017 .

 

Top Programming Languages 2017

Top Programming Languages 2017

So I expect we will be continuing to program systems using C for quite some time to come. Especially smaller systems that don’t have an Operating System. Now maybe someone should focus a bit more attention on teaching C to the next generation of programmers.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2018 Successful Endeavours Pty Ltd.

The Internet of Insecure Things

Insecurity in Cyberspace

This is not one of those topics that makes you feel better initially. In IoT Security we looked at how the emerging IoT world needed to protect itself against attacks. This is a different problem to pure Software Security which has its own challenges.

 

It was with recent interest that I received a copy of the Barr Group 2018 Embedded Systems Safety & Security Survey . We contribute and so get access to a free copy. I recommend you do the same if this is an area of interest.

 

They have also put together an infographic that speaks to the The Internet of Insecure Things and I am reproducing a low resolution version here with their permission. You can get a full resolution version by registering at the Barr Group website.

 

The Internet Of Insecure Things

The Internet Of Insecure Things

It speaks to where the insecure aspects come from. As usual, better Embedded Software Development practice leads to better and more secure products.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development, focusing on products that are intended to be Made In AustraliaRay Keefe has developed market leading electronics products in Australia for more than 30 years. This post is Copyright © 2018 Successful Endeavours Pty Ltd.

Software Languages

Top Programming Languages

A recent survey of the most used Software Languages, also known as the Top Programming Languages,  has revealed what most would have guessed as to the most popular Software Development Languages in use. The survey was published on IEEE Spectrum and usefully allows you to look at the statistics for four types of software development in any combination you want to. The categories used for the breakdown of the statistics are:

 

  • Web
  • Mobile
  • Enterprise
  • Embedded

Web Development Languages

The most popular Web Development Language was Java followed by Python, C# and PHP. I was surprised that Python ranked so highly. I understand the Google use it but hadn’t realised it had become so prevalent. So I learnt something new from that part. This is one of the advantages of being part of the professional body like IEEE. The world we live keeps changing and expanding and this is one way to stay up with those changes.

 

Mobile Software Development

For Mobile Software Development the winner was again Java with C, C++ and C# coming next. So here we are still very C oriented even on the most modern platform around. And of course Java is also very C like in its structure having been developed to address some system level issues such as memory management and garbage collection that C requires you to handle manually.

 

Enterprise Software Development

Enterprise Software Development sees Java again a the winner with C, C++, Python and C# coming next. Again Python is higher than I expected but the rest makes sense. Given that this area represents one of the core infrastructure requirements of modern scale-able companies it is interesting to see how narrow we still are with the Software Languages we use.

 

Embedded Software Development

And finally to the world we mostly deal with, Embedded Software Development. The clear winner here is C followed by C++ and Assembler. I took a snapshot of the complete rankings. Embedded C remains the primary language for software development in embedded systems.

 

Top Programming Languages - an IEEE published survey

Top Programming Languages

 

The overall winner was Java when you take all 4 categories into account and that isn’t hard to accept given Java was the Top Programming Language in 3 of the 4 categories. So if you are thinking about what Software Languages you should learn, it depends on where you want to work and what you want to work on. For Embedded Software Development, it is still C and C++. For everything else, Java is core with C, C++, C# and Python all playing a part.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2014 Successful Endeavours Pty Ltd

iAwards 2014

iAwards

The iAwards are an annual celebration of Innovation in driving economic growth in Victoria. This year we were pleased to see one of our clients, Rectifier Technologies Pacific, nominate for an award. They were encouraged to do so and I was pleased that they followed through on that encouragement.

 

iAwards

iAwards

iAwards Winners 2014

The iAwards 2014 Winners for Victoria have been announced and Rectifier Technologies Pacific are winners in two categories:

 

  • Research and Development
  • Sustainability

 

This was for their RT15 240V 100A HRE Rectifier. This is a high power level and high efficiency AC to DC Power Converter.

 

Rectifier Technologies Pacific

Rectifier Technologies Pacific

One of the reasons we are familiar with the product is that we did some of the core Embedded Software Development and know just how good the hardware design in the power stage is.

 

So congratulations again to Rectifier Technologies Pacific and to all the rest of the winners at this year’s iAwards.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2014 Successful Endeavours Pty Ltd

Software Estimation

Estimating Software Development

This is actually a huge topic so I am just going to touch on some high level points. What prompted me to start writing on this topic is a recent conversation with a client and a cartoon I came across at Gizmodo about what happens when your Boss Estimates Software.

 

How long to write the software?

How long to write the software?

The question of how long it will take to write a particular piece of software is dependent on several factors:

 

  • what is your direct experience in writing that sort of software?
  • is there existing code you can leverage? – Software Reuse
  • build versus build – can you buy a module?
  • what is the Operating System? – an RTOS will usually slow things down
  • is it a hard or easy problem?
  • is it well defined?
  • how will it be tested?
  • what quality standards does it have to comply with – eg. Medical Device Class C
  • how many people will be working on it?

 

I’m sure you get the idea.

 

And the coding is just part of the Software Development Process. That is the thing that gets forgotten more than anything else.

 

Software Development Process

In the Software Development Process, coding is preceded by:

 

  • user requirements analysis
  • product requirements analysis
  • technical analysis
  • solution selection
  • specification
  • test methodology
  • Software Design

 

Then there may be a Design Review.

 

Then we code (sometimes referred to as putting the bugs in).
Then we test and debug (getting the bugs out).

 

Then there may be a Code Review and Refactor followed by confirmation it still passes all the tests.

 

Then we complete the Software Documentation package and create a labelled revision so it can be properly released and tracked.

 

That is the small software team version of the process and for some projects some of those steps are trivial.

 

Larger companies have larger processes but can also do larger projects as a result.

 

Industry Metrics for Coding

Here are some really basic Coding Metrics.

 

High security, financial systems, mission critical code – as little as 10 lines of fully debugged and documented code per day averaged across the whole process.

 

Commercial and scientific software is usually created at a rate of between 100 and 1000 lines of code a day.

 

And better processes actually speed that up rather than slowing it down.

 

Estimating Software Development Time

A recent conversation with a client was on the topic of redoing someone else’s code. They had been working with another Software Development company and had decided that the code needed to be done again. They had spent two years without getting to a fully working version. My first though was “commendable patience”. My second was merely “ouch”!

 

So we did some analysis. I was initially optimistic. We used a tool called RSM to do some code base analysis. We use quite a lot of science in our Software Development Process including Static Analysis, Code Quality Analysis and complexity measurement. What we got from the initial analysis was 50K lines of code with an average Cyclometric Complexity of 6.21. The normal rule of thumb is that anything above 5 should be redesigned. Not Good. Then we looked at some specific files that had really high complexity scores above 10. That was the clincher. No evidence of design, no consistency, lot’s of cut and paste and everything is global variables.

 

The good news, is that the real complexity of the required code will not require 50K lines of code when it is properly designed. The bad news is that our client was right. It did need to be done again from scratch. Some parts might be reusable but it was unlikely.

 

Assuming we can do it with 20K lines of code, this will take between 20 and 200 person days to produce. In our case closer to 20 person days because the thing that makes the biggest difference to software delivery on time is your Software Development Process.

 

So that is a really quick look at a really big topic.

 

Successful Endeavours specialise in Electronics Design and Embedded Software Development. Ray Keefe has developed market leading electronics products in Australia for nearly 30 years. This post is Copyright © 2014 Successful Endeavours Pty Ltd.