4 ms·
Original author here. Exactly, thank you! I thought everybody knew 'C' and C++ both, and specifically that: 1) 'C' is the most basic, it only has functions.
by brianwski 12y ago
Original author here. Exactly, thank you! I thought everybody knew 'C' and C++ both, and specifically that:
1) 'C' is the most basic, it only has functions. A function call looks like "bzuiutil_pause_backup();"
2) 'C++' is a super set of 'C' and if you want to group several static functions together, you can put several static functions in one class. This defines scope, and also allows programmers to find where the function is written, in this case "BzUiUtil::PauseBackup()" means that there is a 'C++' class called BzUiUtil and it has a static function with EXACTLY the same contents as the 'C' version has inside "bzuiutil_pause_backup();"
At Backblaze, we tend to void writing 'C' code in favor of 'C' code in static C++ wrappers as described in point "2" above. There isn't any downside as long as all of your compilers on all platforms are C++ compilers anyway. I honestly didn't know a pure 'C' compiler still exists. Specifically, Microsoft Visual Studio does both seamlessly. On the Macintosh Xcode does both seamlessly. On Debian Linux (the flavor we use most and is also the slowest to adopt anything) the g++ compiler ships for free on every linux box that does both seamlessly.