Step 7: Compare and reflect
You solved one problem in four languages. Here is what the exercise showed:
| C | C++ | Rust | Go | |
|---|---|---|---|---|
| Dictionary | write your own | std::map | HashMap | built-in map |
| Strings | char arrays | std::string | String/&str | string |
| Memory | manual limits, you free | automatic (RAII) | automatic (ownership) | garbage collected |
| Mistakes caught | few | some | most, at compile time | many, at compile time |
| Feels like | portable assembly | power and complexity | strict and safe | simple and quick |
Which to choose? C for tiny, portable, embedded code; C++ for performance with rich abstractions (games, browsers); Rust for fast code where bugs are costly (systems, security); Go for network services and tools where simplicity and fast builds matter. The ideas you practised (tables, sorting, splitting text) are the same in all of them.
Challenge: extend any version to ignore a list of very common words (the, a, of), or to take the file name from the command line (argv in C, os.Args in Go). Where next: the Git course shows how to keep four versions of a project tidy, and the Bash course shows how to combine your tool with others using pipes.
Which language did the comparison call the one that catches most mistakes at compile time?
Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.
Tip: use the left and right arrow keys to move between lessons.