I also don't like that trend in code examples. Mircochip for example loves to cram parameter settings for every possible target you may want to compile particular example for. Which means that their examples are literally stuffed with code like #ifdef PIC32XXXXXX [set set something to zero] elseif [pic18xxxxx][set that to other value].
I think that for the sole purpose of easier code readability they should put all the code in one simple file, or even few files, but not in multi-level structure. Of course they could put a comment in there like: "this code is normally in library xxx. You have to include xxx.h to use that function". How hard can that be?
This is something I also hate.....
For the case of supporting multiple processors it would be nice if there was some sort of preprocessor that would look at all the #define options and create new source files with all the unused bits stripped out to make it easier to read.
I've just been hacking some examples for the NXP LPC1800 and there are all sorts of macros and trivially short procedures that just seem to be about making things "more friendly", but actually it means you need to know ot only the chip but also all the "friendly" names and APIs. And I've already found some bugs in them...
They even go as far as having some quite complex procedures for setting up peripherals, with huge run-time tables, meaning that a simple LED blinky takes 5K. At least IAR's linker is smart enough not to include unused procedures, unlike Microchip's C30 (this may have changed recently).
Another pet peeve of mine is examples which are split up into zillions of files buried in a heirarchy of folders. IMO this is a practice dating back to the days when editing larger files was hard and compilers were slow. It makes it a total nightmare to follow to figure out what's going on.
One feature I really like in IAR is that it will automatically add any included file it finds while compiling into the project, so you can quickly go to things like processor header files to look up names of registers, bits etc.