So i was looking at the SDL source code and my mind was blown. How long would it ever take a newb to be able write that type of code???
so i took one look at the sdl source code...
Libraries like that are grown over time - someone didn't set out to code specifically what now exists, but it has grown from version to version, and with each new platform that gets supported.
If you come from a C++ background, have a look at the SFML source code - created mostly by a single person much more recently in history.
Also, what exactly do you mean by "that type of code"? Are you impressed by the number of lines or files? If so, that's not a good measurements for determining the quality of the code.
Because SDL is written in the C programming language, if you use C++ you shouldn't try to mimic the style of the C code, because C++ has different coding styles and recommended guidelines for quality code.
Take comfort in the knowledge that SDL is already written (and open-source) for you to always use rather than having to rewrite something similar yourself.
Also, using SDL with C and C++ is easy. Just like using .NET (C#) is easy whereas if you look through the source code of Mono (or shared source (rotar) versions of Microsoft's .NET) it is incredibly complex.
I tried porting Microsoft's .NET to a modern version of FreeBSD (it originally was created for Windows XP and FreeBSD 4.7). I got as far as the PAL abstraction layer before I started to get the shakes. Now I am writing games until I recover from the experience haha.
Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.