7.29.2011

Quick decision

I think I'll implement all linked list operations using macros. Macros are very powerful tools in C and giving the fact that you don't even need a handful of variables, they are suited for direct insertion as well as writing functions to wrap them in a more library-alike fashion. Also, they can be used function-style and encourage reuse of temporary variables. I have quite some experience with simplifying code now and think it's the best solution for C I can think of. It also frees me from those annyong extra structs and so on. It makes coding close to hardware more enjoyable and I think this shows when taking a lot at how few informations about the underlying data they need when using them. And I think I'll at first focus on using it on the NXT, this makes my goal a bit more clean compared to just "make it good" or whatever. I'm sick of that, I want a target platform and I think I found mine. Well, would I hold my Pandora right now (which I don't have), I would've started earlier for small target platforms I think. Using macros makes generalization and optimization easier cause you can define define the final output. It's just a finally invisible abstraction layer, the only really valid method of generating code in C.

Oh god, I'm so sick of putting everthing into functions, good that I have macros at hand.

No comments: