The reason why most books force you to write useless programs is because they cannot make assumptions about your knowledge. Everybody can read and knows basic calculus so books can safely refer to that, but anything else is no-go.
To write a program solving problem in some area, you need to have knowledge in that area. If you want to write a program calculating result of chemical reaction, you need to have extensive chemistry knowledge on top of programming knowledge.
To
"create my own encoder", you need to understand all theory behing it. Litmus test: if you do not know what
FFT abbreviation means in context of signal processing, you do not have enough knowledge.
... I know that bricks are made from clay(In this case Clay would be C++). |
Clay is OS API, C++ is fermions and bosons.
As most people never learn particle physics, most programmers do not feel competent enough to tackle system programming: you need to be able to write programs before you will write systems for them. In other words, you need to use existing bricks to understand what is important fot bricks and what to look for when creating them.
A suggestion: write data compressor (archiver) using
run-length encoding. They you write stream wrapper: class inheriting from
ostream which takes another ostream as constructor argument. It should compress data you send to it and send compressed data to another stream. Do the same for
istream and decompressing. That way you will have stream adapter which allows you to directly read/write compressed data.