Thursday, 3 January 2013
When I was a kid we had this book about electricity. There was a tutorial how to create a small engine using paperclips and battery. I couldn't do it but I was fascinated how can you create a more complex thing from something basic. (I know it's not entirely true.) For many years I thought making complex things what really motivates me. Then I realized it's information that is amazing.
I guess many learned in school about information theory. It sucked, right? Never understood why you learn something you won't use for a decade at least. Now I get it.
I'm a developer. What I do is I'm crafting, manipulating and transforming information. Well, to be really precise, I create high level rules. Why is it really important? Because you only get programming through information awareness. Whenever you develop a system you work with data and guide that data through various control structures. You need to know what is happening with all variables at all states of your program. Optionally you try to keep consistency - at the end that makes sure you don't break your code.
When I do code I often think of how the information flows though my functions, classes and other parts of the project. I think one of the biggest skill in coding is to maintain a mental abstraction stack in your brain. (And on purpose I'm not trying to emphasize code readability now.) Data structures are more effective when they can represent data by behavior. And control structures are acting as (de)coders in the process. When you hold these transformations in mind and try to change the behavior of a tier you need to transfer that change to the upper tiers. And yeah - good luck if it's not transitive or you have to encounter with information loss or redundancy.
It's really interesting when I see other developers handling information badly. I know - if it works sometimes it's enough. But I like the straight way that targets and keeps the entropy (I know I have to use this work very carefully - so please tell me if you disagree with using here).
Other interesting thing about information awareness is that when you actually take attention to it - you know the critical points of your code, where possible bugs can occur. Bugs - if you think about it - happen when the expected information differs from the reality. It's like playing chess. You try to guess all possible future states and make a decision on that. If you fail to do so - you'll more likely fail on the game.
Design patterns - imho - the queens are information theory. They explain gorgeous abstraction layers of information flows. To be honest - I don't know all of them by heart - I believe after some practice you learn the essence of it and can use without labeling them. Information states can be imagined as a directed graphs. Design patterns are the rules to make those directions. When you chose a pattern it's potentially the lowest energy level and maximum throughput option that serves the best.
And in general thinking in graphs I found a really good practice. It's an awesome representation and visualize nicely how to structure your system. What are the independent islands, connections, relations, cardinalities, etc.
I love information. It's fucking amazing. There was a post on StackOverflow about complex computation and energy. Information is not just a theoretical thing. It's everything. Information is the base of everything. You have it in your DNA. Environment have it in states in atomic level. Information and its state that defines everything that will happen and happened already. And information as a state needs energy to change. Energy is measurable. So the guy on that SO post calculated how much energy that certain algorithm would require. It's amazing. You realize you need energy to play games or watch tv or drive your car or run. But it's all information in the background. And think about evolution and future. How much energy the next technological breakthrough requires? How can we make it more effective by grades? Otherwise we will use all our resources up soon.
So please, don't handle your variables loosely ;)
If you know about any cool blog or article about that topic, please, share. I'm really interested to read them and I'm sure other visitors too.