WeCodeAcademy

Step 7: Compare and reflect

You solved one problem in four languages. Here is what the exercise showed:

CC++RustGo
Dictionarywrite your ownstd::mapHashMapbuilt-in map
Stringschar arraysstd::stringString/&strstring
Memorymanual limits, you freeautomatic (RAII)automatic (ownership)garbage collected
Mistakes caughtfewsomemost, at compile timemany, at compile time
Feels likeportable assemblypower and complexitystrict and safesimple 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.

Examplebash
Open in editor »
/ $
Quick check

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.