Follow Us
Categories
Archives
- August 2023
- December 2022
- November 2022
- October 2022
- February 2022
- October 2021
- September 2021
- August 2021
- July 2021
- June 2021
- May 2021
- January 2021
- November 2020
- October 2020
- August 2020
- April 2020
- February 2020
- January 2020
- October 2019
- September 2019
- July 2019
- May 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- October 2018
- September 2018
- August 2018
- July 2018
- April 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- April 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- April 2014
- March 2014
- February 2014
- January 2014
- November 2013
- September 2013
- August 2013
- July 2013
- June 2013
- May 2013
- April 2013
- February 2013
- January 2013
- November 2012
- October 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- March 2012
- December 2011
- November 2011
- June 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- September 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
Tag Archives: Modern C++. C++11. C++14
Practice makes perfect, part 3 – Idiomatic kata
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
Previously, we looked at some of the foundational C++ code kata – that is, elements of C++ coding that are absolutely key to master if you’re going to be programming in C++.
Practice makes perfect, part 1 – Code kata
Practice makes perfect, part 2 – foundation kata
In this article I want to introduce what I call ‘idiomatic’ kata. These exercises have a bit more latitude (and variation) in how they can be implemented. In that respect they are closer to traditional […]
Posted in C/C++ Programming, Design Issues, training
Tagged Code kata, exercises, Modern C++. C++11. C++14, training
Leave a comment
Practice makes perfect, part 2 – foundation kata
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
In the previously article we looked at the need for repetitive practice – code kata. In this article I want to present some of my preferred foundational kata.
If you’re a beginner to C++ I recommend you fully internalize all these examples before having a look at the idiomatic kata.
If you’re a more experienced C++ programmer you may be looking at these kata and thinking “Jeez – these are so basic! Who couldn’t do this!”. Bear in mind though – we […]
Posted in C/C++ Programming, Design Issues, training
Tagged Code kata, exercises, Modern C++. C++11. C++14, training
1 Comment
Practice makes perfect, part 1 – Code kata
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
Imagine you’re at a Jazz club, enjoying a smooth jazz quartet. It’s time for the sax player’s solo. All of a sudden, he stops the band, rifles in a bag a pulls out a book of music theory.
“What the?!” you think.
The saxophonist looks to the audience, “I’ve just got to look up the notes for E-flat minor. I can never remember them.”
It’s understandable you’re unlikely be too impressed with this particular musician.
If you’re a musician, a sportsperson, a dancer, martial […]
Posted in C/C++ Programming, Design Issues, training
Tagged C++, Code kata, exercises, Modern C++. C++11. C++14, practice
3 Comments
Function function return return values values*
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
The latest C++ standard is now upon us, so it’s time to have a look at some of its new features.
To put one of the new features into context we’re going to have a look at – as the title suggests – multiple function return values
I should really distinguish between the following:
A Subroutine (or Subprogram) is a parameterised block of code that can be called multiple times from within a program.
A Procedure is a subroutine that may have multiple input […]
Posted in C/C++ Programming
Tagged C++17, C++2a, Function return values, Modern C++. C++11. C++14, structured bindings
Leave a comment
Celebrating 10 years – my top 10 blog articles
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
It’s difficult to believe we’ve been writing articles for 10 years. In that time I’ve written over 90 technical articles on C, C++ and embedded system design.
To celebrate I’ve picked my ‘Top 10’ articles, with a little background into why I enjoyed writing them so much, or the story behind them.
So, sit back, cue up “At the Sign of the Swinging Cymbal“* and enjoy.
(* This really dates
Posted in C/C++ Programming, Design Issues, Testing, UML
Tagged arrays, casting, forwarding, Modern C++. C++11. C++14, move semantics, priority, Testing, unit test
Leave a comment
Thanks for the memory (allocator)
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
One of the design goals of Modern C++ is to find new ways – better, more effective – of doing things we could already do in C++. Some might argue this is one of the more frustrating aspects of Modern C++ – if it works, don’t fix it (alternatively: why use lightbulbs when we have perfectly good candles?!)
This time we’ll look at a new aspect of Modern C++: the Allocator model for dynamic containers. This is currently experimental, but has […]
Your handy cut-out-and-keep guide to std::forward and std::move
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
I love a good ‘quadrant’ diagram. It brings me immense joy if I can encapsulate some wisdom, guideline or rule-of-thumb in a simple four-quadrant picture.
This time it’s the when-and-where of std::move and std::forward. In my experience, when programmers are first introduced to move semantics, their biggest struggle is to know when (or when not) to apply std::move or std::forward. Usually, it’s a case of “keep apply std::move until it compiles”. I’ve been there myself.
To that end I’ve put together a […]
Posted in C/C++ Programming
Tagged C++, C++0x, C++11, C++1y, Modern C++. C++11. C++14, move policy, move semantics, resource management
2 Comments
Making things do stuff – Part 8
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
We’ve been using templates to provide a hardware register abstraction for use with hardware manipulation problems, typical of what you’d find in a deeply-embedded (“bare-metal”) system.
Previously, we looked at using trait classes to establish pointers and tag-dispatch to handle special-case registers, such as read-only or write-only register.
In this article we’re going to add some syntactic sugar to our Register class, to allow the developer to access individual bits in the register using array-index ([]) notation. This will allow us to […]
Making things do stuff – Part 7
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
In our previous article we explored using templates to build a generic ‘register’ type to allow programmers to access hardware without all the nasty syntax of integer-to-pointer casting, etc.
At the moment, this class gives us little extra functionality beyond cleaning up the syntax (although, in its favour, it also doesn’t incur any additional run-time cost/performance).
In this article we’re going to extend our design to consider special hardware register types – notably read-only and write-only registers – and see how we can […]
Posted in C/C++ Programming
Tagged C++, C++0x, C++11, C++1y, hardware manipulation, Modern C++. C++11. C++14, Templates
2 Comments
Making things do stuff – Part 6
Technical Consultant at Feabhas Ltd
Glennan is an embedded systems and software engineer with over 20 years experience, mostly in high-integrity systems for the defence and aerospace industry.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
He specialises in C++, UML, software modelling, Systems Engineering and process development.
Latest posts by Glennan Carnie (see all)
- Practice makes perfect, part 3 – Idiomatic kata - February 27, 2020
- Practice makes perfect, part 2– foundation kata - February 13, 2020
- Practice makes perfect, part 1 – Code kata - January 30, 2020
As code designers we tend to eschew specific ‘stove-pipe’ code in favour of reusable code elements. Up until now we’ve been coding some very specific examples so it’s probably worth looking at some more generic solutions.
In this article we’ll look at building generic register manipulation classes (or, as one commenter referred to them, ‘register proxy’ classes). Here, we’re really exploring code design rather than coding ‘mechanics’. I’m using this to explore some factors like the balance between efficiency, performance and […]
Posted in C/C++ Programming
Tagged C++, C++0x, C++11, C++1y, GPIO, hardware manipulation, Modern C++. C++11. C++14, Templates
3 Comments