I can't say what code makes you happy but I can tell what code makes me happy.
My greatest satisfaction is from :
A while back I had a couple of very pleasurable moments working with some code. One moment was working with the Java Swing GUI Library and the other was in a design pattern that was a variation of MVC (Model View Controller), or so I thought.
I was working with the Java Swing library trying to get a panel contained in a JScrollPane to set the scroll bar at the top of the viewport. For a normal panel this is a piece of cake but not when the panels components are dynamically added to the panel after it's made visible. What made me happy about this task was that it forced me to think of not what I wanted to do but what was really happening inside the library. My first try at a solution was the standard brute force method (which did not work), then scanning the forums for solutions (which did not cover my issue or work) and then looking at the problem from a very different angle. I needed to logically think of what must be occurring in the Swing library during the dynamic addition of components and look for injections points where a solution could be applied. This lead to a very simple, clean and easy solution to my problem. It's the re-training of the thoughts to come after a problem in completely different direction that makes me happy. It's the Aha moment that makes me happy.
My second happy moment is from looking at a design pattern that I have seen used long ago involving an SOA service request where the results used a Publish / Subscribe pattern to update the (MVC) Views that utilized the returned data. I had seen this pattern decades ago when Window's development was just getting started. Developers where using the WinAPI for not only the built-in messages but also created their own messages by defining new MessageIDs (aka "WM_USER + n") and passing their own data around inside the application. You do not see this patten anymore as the number of messages and transient data gets very complex as structure and API are replaced with messages that magically go somewhere. I could not quite put my finger on the other reason for why this pattern felt wrong, and then it hit me. It was combing the behavior of both the Model updates with the View notification. These are two separate concerns that are being combined into a single operation. This variation of the MVC pattern was not MVC at all, it was just the old WinAPI message pattern but with very little structure behind it. It was being called MVC was it was not. It's this process of removing hype and comments from others and learning for myself what is really occurring that I enjoy. Again it's the pealing away of miss-information, hearsay and preconceived notions to find the facts buried beneath that make me happy.
By diving deeper into what is really occurring in the code or design I get to understand what I need to do. For me this generally results is writing less code that I hope is clear and easy to maintain. This is what makes me happy.
Next: Truth -vs- Facts.
My greatest satisfaction is from :
- Getting things done (documents, features, working with people, etc).
- Understanding / learning how a specific framework, library or tool ready works.
- Visualizing how and why a design works or does not work.
A while back I had a couple of very pleasurable moments working with some code. One moment was working with the Java Swing GUI Library and the other was in a design pattern that was a variation of MVC (Model View Controller), or so I thought.
I was working with the Java Swing library trying to get a panel contained in a JScrollPane to set the scroll bar at the top of the viewport. For a normal panel this is a piece of cake but not when the panels components are dynamically added to the panel after it's made visible. What made me happy about this task was that it forced me to think of not what I wanted to do but what was really happening inside the library. My first try at a solution was the standard brute force method (which did not work), then scanning the forums for solutions (which did not cover my issue or work) and then looking at the problem from a very different angle. I needed to logically think of what must be occurring in the Swing library during the dynamic addition of components and look for injections points where a solution could be applied. This lead to a very simple, clean and easy solution to my problem. It's the re-training of the thoughts to come after a problem in completely different direction that makes me happy. It's the Aha moment that makes me happy.
My second happy moment is from looking at a design pattern that I have seen used long ago involving an SOA service request where the results used a Publish / Subscribe pattern to update the (MVC) Views that utilized the returned data. I had seen this pattern decades ago when Window's development was just getting started. Developers where using the WinAPI for not only the built-in messages but also created their own messages by defining new MessageIDs (aka "WM_USER + n") and passing their own data around inside the application. You do not see this patten anymore as the number of messages and transient data gets very complex as structure and API are replaced with messages that magically go somewhere. I could not quite put my finger on the other reason for why this pattern felt wrong, and then it hit me. It was combing the behavior of both the Model updates with the View notification. These are two separate concerns that are being combined into a single operation. This variation of the MVC pattern was not MVC at all, it was just the old WinAPI message pattern but with very little structure behind it. It was being called MVC was it was not. It's this process of removing hype and comments from others and learning for myself what is really occurring that I enjoy. Again it's the pealing away of miss-information, hearsay and preconceived notions to find the facts buried beneath that make me happy.
By diving deeper into what is really occurring in the code or design I get to understand what I need to do. For me this generally results is writing less code that I hope is clear and easy to maintain. This is what makes me happy.
Next: Truth -vs- Facts.
Comments
Post a Comment