Some notes on computer stuff code tags rss about

Come to terms with computer terms

March 26, 2018
[autoconf] [c] [c++] [rant]

There are many things which people get wrong over and over again. People seem to care enough to repeat these mistakes out loud regularly, but apparently not enough to actually check correctness of the information or at least question it. Let's deal with some claims of this sort from IT field which bug me personally.

"Autotools aren't cross-platform"

This one usually comes from Windows-developers and seems to be based on inadequate assumption that if something doesn't support their platform well, then it's not cross-platform.

First of all, autotools does work on Windows, even if it's inconvenient to use it there. The port was done late, so Windows-support isn't great, yet enough for it to work there. This alone disproves the claim from Windows-developers, but let's give more generic proof of why the claim is utterly wrong:

  1. Let's assume that autotools isn't cross-platform because it doesn't support some particular platform. Then same logic can be applied to any other program.
  2. There are myriads of platforms and no program supports all of them.
  3. Therefore, no program is cross-platform.
  4. Since we know that there are cross-platform programs, our assumption about nature of cross-platform software is wrong.

The true meaning of cross-platform is ability to run on more than one platform which are more than superficially different. If some software doesn't run on your favourite platform, it doesn't stop it from being cross-platform as long as it runs on at least two others.

"C is a low-level language"

This one seems to be based on absence of knowledge of what low-level actually means. Low-level things are those which lack abstractions beyond what's necessary. In programming these are represented as assembly languages (even though they might provide macro capabilities which emulate high-level constructs). C is obviously not an assembly and people calling it "portable assembly" don't mean it literally (or at least they shouldn't or they would be wrong).

Somebody might try to object that compared to languages like Java, C is low-level and thus calling it such is justified. This has at least two flaws:

  1. Lisp has already existed for 4 years when C was created. So introduction of Java and others don't change anything.
  2. Creating more and more high-level languages doesn't push other languages down the stack. If anything, it's Java which should get a new label like ultra-high-level if somebody needs it, C shouldn't suddenly be classified differently.

Criteria for being low-level didn't change, C was high-level and stays high-level.

"Functor is a bad word for functional objects in C++"

The argument that was put forth is that in functional programming functor means something different (an entity from category theory). It probably wasn't meant to be logical, yet let's look at it from this side at first, it's easy to prove wrong.

If the word functor shouldn't be used because it's used somewhere else, what about other words that have different meaning in different contexts? I doubt anybody would argue that words should have one and only one meaning (could be nice, but it's too late to push this idea). So clearly there is no strong support for this argument from this point of view, because meaning of words are determined also by context in which they are used, not just merely by a pattern of characters.

The actual argument seems to be about avoiding confusion when doing functional programming in C++. However, there is usually no such confusion in the first place. Those who introduce concepts into C++ from other fields should work around pre-existing terminology of C++, not the other way around. And "functor" is a bad and rather confusing name even for the thing it's used in functional programming for, because it's pretty much just a visitor which performs map operation on an element of some structure that's being visited. In C++ the term is way less confusing, which makes its use in C++ as is quite well motivated.

"C/C++"

This thing is just confusing. The slash means "AND or OR", but I doubt there are many situations where phrase "C and/or C++" makes sense.

If slash is supposed to mean "AND", then why not write it that way? In reality, though, it rarely means conjunction and is usually more about C++.

If slash is supposed to mean "OR", this sounds very weird because these are two distinct languages, which aren't interchangeable in general (both universal and Turing-complete, but that doesn't really count as it covers more than these two languages).

Another interpretation of "C/C++" I was presented with is: knowledge of C++ with read-only understanding of C. So there might be some people out there thinking that it means "knowledge of C with read-only understanding of C++".

Too many conflicting interpretations for the same term. Ambiguous terms aren't terribly useful ("functor" from above isn't ambiguous unless two separate context are mixed), just use a word instead of the slash.

The rest

Other terms might be added in the future to keep this ranting contained in one post.