Posts Tagged C++

 

Extending the life of TomTom wearables

TomTom recently announced it would stop operating their supporting infrastructure by the end of September following its earlier decision to exit the wearables market. This means that its products, such as sports watches, will become effectively useless, as they will no longer be able to export their activities and sync them with tracker sites. Throwing away an otherwise fine watch only because its maker decided to shut down its proprietary infrastructure seems like a sad waste. Here is how you can download the watch’s data and upload it to Strava, a popular activity tracker, using open source software.

Continue reading "Extending the life of TomTom wearables"

Programming Languages vs. Fat Fingers

A substitution of a comma with a period in project Mercury's working Fortran code compromised the accuracy of the results, rendering them unsuitable for longer orbital missions. How probable are such events and how does a programming language's design affect their likelihood and severity? In a paper I recently presented at the 4th Annual International Workshop on Evaluation and Usability of Programming Languages and Tools I showed results obtained by randomly perturbing similar programs written in diverse languages to see whether the compiler or run-time system would detect those changes as errors, or whether these would end-up generating incorrect output.

Continue reading "Programming Languages vs. Fat Fingers"

How to Calculate an Operation's Memory Consumption

How can you determine how much memory is consumed by a specific operation of a Unix program? Valgrind's Massif subsystem could help you in this regard, but it can be difficult to isolate a specific operation from Massif's output. Here is another, simpler way.

Continue reading "How to Calculate an Operation's Memory Consumption"

Code Finessing

When I set out to apply CScout on the Linux kernel source code, I discovered that it failed to correctly expand a couple of C macros, causing the analysis to fail. This prompted me to reimplement CScout's macro expansion using a precise functional specification, then optimize the code's severe degradation in time performance, and finally tidy up the optimized code mess.

Continue reading "Code Finessing"

The Verbosity of Object-Oriented Code

As I refactored a piece of code from an imperative to an object-oriented style I increased its clarity and reusability, but I also trippled its size. This worries me.

Continue reading "The Verbosity of Object-Oriented Code"

UML Class Diagrams from C++ Code

I needed a UML class diagram of the classes I use in the implementation of CScout refactoring browser. I drew the last such diagram on paper about four years ago, so it was definitely out of date. I always say that whenever possible documentation should be automatically generated from the code, so I decided to automate the task.

Continue reading "UML Class Diagrams from C++ Code"

Dave Prosser's C Preprocessing Algorithm

For about five years I've been trying to implement a fully conforming C preprocessor for the front end of the CScout refactoring browser. I've found this to be a fiendishly difficult task. Although what I have written can correctly process million-line real-life projects, every once in a while I come across a construct that confuses my implementation. While searching the web for explanations of some of the finer points of the C standard I came across a reference to an algorithm by Dave Prosser that the X3J11 (ANSI C standard) committee used as a basis for the standard's wording.

Continue reading "Dave Prosser's C Preprocessing Algorithm"

Code Quality: The Open Source Perspective

My new book Code Quality: The Open Source Perspective got published, three years after I started writing it. The book owes more to open source software than any of the books dealing with Linux, PHP, Apache, Perl or any other book covering a specific technology.

Continue reading "Code Quality: The Open Source Perspective"

Efficiency Will Always Matter

Many claim that today's fast CPUs and large memory capacities make time-proven technologies that efficiently harness a computer's power irrelevant. I beg to differ, and my experience in the last three days demonstrated that technologies that originated in the 70s still have their place today.

Continue reading "Efficiency Will Always Matter"

If STL Had Been Designed by a Committee

I've been reading on XML schema, and it's embarrassingly obvious that it has been designed by a committee.

Continue reading "If STL Had Been Designed by a Committee"

C++0X Enhancement: Rational Metaprogramming

In a recent article Bjarne Stroustrup presented the evolution of C++ toward the 0X standard, and asked the C++ community for ideas regarding C++ enhancements. This is a proposal to add to C++ support for rational metaprogramming.

Continue reading "C++0X Enhancement: Rational Metaprogramming"

C++0X Enhancement: Packaged Libraries

In a recent article Bjarne Stroustrup presented the evolution of C++ toward the 0X standard, and asked the C++ community for ideas regarding C++ enhancements. This is a proposal to add to C++ support for using packaged libraries, and a standardizing a library distribution format.

Continue reading "C++0X Enhancement: Packaged Libraries"

The Efficiency of Java and C++, Revisited

A number of people worked on replicating the results and optimizing the programs I listed in my earlier blog entry.

Continue reading "The Efficiency of Java and C++, Revisited"

The Efficiency of Java and C++

I seem to have trouble convincing my neo-Turk students that Java's design makes it inherently less efficient than C++. The arguments often and up in an exchange of comments like:
— This (micro) benchmark executes with the same speed when written in Java and C.
— Yes, but a realistic application, like Eclipse takes ages to start up.
— You are only complaining about the cost of the runtime startup costs and JIT compilation, which are quickly amortized, and, anyway, Eclipse offers many more features than other IDEs.
and so on. I therefore wrote a small program to demonstrate the exact problems of Java's design decisions.

Continue reading "The Efficiency of Java and C++"

Book Review: C++ Coding Standards

A number of years ago, reading Koenig's and Moo's Ruminations on C++ [1] I made a wish for more of the same, updated to reflect current C++ practice. My wish has come true. The book C++ Coding Standards: 101 Rules, Guidelines, and Best Practices by Herb Sutter and Andrei Alexandrescu [2] is an indispensable book for all serious C++ programmers.

Continue reading "Book Review: C++ Coding Standards"

Not All Open-source Systems Are Perfect

I am a big fan of open-source software, and I use many open-source programs on a daily basis. Some of my favourite systems, on which I depend, include the FreeBSD operating system, the apache web server, and the vim editor. I also often use graphviz, CVS, Ghostview, gnuplot, LaTeX, and the GNU C Compiler. I find all of these systems robust, well documented, and, in many cases, superior to their proprietary alternatives.

Continue reading "Not All Open-source Systems Are Perfect"

Computer Languages Form an Ecosystem

(This is a copy of an article I posted on slashdot on March 15th, in response to a discussion titled C Alive and Well Thanks to Portable.NET. Many posters argued that the C language is dead. I add my response here, because one month after its original slashdot submission, I am still getting web site hits from it.)

Continue reading "Computer Languages Form an Ecosystem"

Become a Unix command line wizard
edX MOOC on Unix Tools: Data, Software, and Production Engineering
Debug like a master
Book cover of Effective Debugging
Compute with style
Book cover of The Elements of Computing Style
Syndication
This blog is also available as an RSS feed:

Category Tags
AI (4)
AWS (4)
Android (2)
Apple (11)
C (21)
C++ (17)
Computers (58)
Databases (6)
Debugging (10)
Discussion (6)
Electronics (15)
Environment (1)
FreeBSD (26)
Funny (14)
GSIS (5)
Git (2)
Google (6)
Government (3)
Hacks (26)
Hardware (27)
History (13)
Information systems (1)
Internet (12)
Java (26)
JavaScript (1)
Linux (7)
Management (27)
Microsoft (11)
One Laptop Per Child (3)
Open source (58)
Opinion (30)
Parenting (11)
Perl (13)
Photos (13)
Politics (5)
Programming (110)
Python (3)
R (1)
Raspberry Pi (6)
Risks (7)
Scala (1)
Science (35)
Security (26)
Sights (19)
Smartphones (3)
Software (22)
Software engineering (93)
Standards (7)
System administration (46)
Teaching (9)
Technology (33)
Testing (3)
Tips (43)
Tools of the Trade (52)
Travel (9)
UML (6)
Unix (53)
Web (31)
Windows (17)
Writing (46)
XML (10)
vim (5)
Archive
Complete contents (382)
2024 (3)
2023 (5)
2022 (2)
2021 (3)
2020 (15)
2019 (4)
2018 (5)
2017 (20)
2016 (7)
2015 (6)
2014 (5)
2013 (13)
2012 (17)
2011 (14)
2010 (13)
2009 (40)
2008 (40)
2007 (41)
2006 (48)
2005 (44)
2004 (30)
2003 (7)

Last update: Tuesday, October 15, 2024 2:19 pm

Creative Commons Licence BY NC

Unless otherwise expressly stated, all original material on this page created by Diomidis Spinellis is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.