LOGBOOK

HELP

1 / 72
Other keys: showSpace: good1-4: rate0: skip5: flag

Question

Why is C/C++ still relevant today despite being decades old?

Answer

Because its ubiquity, power, and raw speed make it indispensable for systems-level work that higher-level languages can't do.

Reason Examples
Ubiquity Operating systems (Linux, Windows), device drivers, embedded/IoT
Power Direct memory access, expressive yet terse syntax
Speed Among the fastest languages, minimal runtime overhead

C/C++ is the foundation for many "higher-level" tools:

  • CPython (Python's interpreter) is written in C
  • V8 (Chrome's JavaScript engine) is written in C++
  • Most database engines, web servers, and game engines

The trade-off:

"With great power comes great responsibility."

C gives you direct hardware access, but it won't stop you from shooting yourself in the foot. No garbage collection, no bounds checking, no hand-holding.

Tip: For performance benchmarks comparing languages, see: https://benchmarksgame-team.pages.debian.net/benchmarksgame/

Go deeper:

or press any other key

Question

What are the key syntactic differences between Python and C?

Answer

C makes you write down everything Python infers for you: explicit types, semicolons to end statements, braces for blocks, and your own memory management.

# Python
def binary_search(data, N, value):
    lo, hi = 0, N-1
    while lo < hi:
        mid = (lo + hi) // 2
        if data[mid] < value:
            lo = mid + 1
        else:
            hi = mid
    return lo if data[lo] == value else -1
// C
int binary_search(int *data, int N, int value) {
    int lo = 0, hi = N-1;
    while (lo < hi) {
        size_t mid = (lo + hi) / 2;
        if (data[mid] < value)
            lo = mid + 1;
        else
            hi = mid;
    }
    return (hi == lo && data[lo] == value) ? lo : -1;
}

Key differences:

Aspect Python C
Types Dynamic, implicit Static, explicit
Blocks Indentation Braces { }
Statements Newline ends Semicolon ; required
Memory Garbage collected Manual management
Arrays Dynamic, bounds-checked Fixed size, no checking
or press any other key