Random updates
Well, it has been a while again. I've been trying to avoid bashing Google while continuing to use their blogging service and most of my dev related happenings are work related. But I have some tech things on my mind and some programming things.
First, the programming things. I've probably said this before, and I will undoubtedly say it again. Code re-use is the key to maintainability. Time and again, both at work and at home I have rewritten applications to increase their code re-use. Though it is important to do it correctly. But each time I have my code has become both simpler and more robust.
Simpler is obvious. The more you are able to re-use code, the fewer lines of actual code you have. Also, reusable methods, functions and classes tend to have more understandable names leading to more readable code as well.
The robust part may not be immediately obvious. But code that is reused is more heavily used, and used in potentially more diverse scenarios. This leads to code that is more heavily tested by design and code which is designed to be better able to handle exception cases.
Then there are additional benefits. Code which is heavily reused means minor fixes automatically improve more areas of your code.
But, as I stated, there are good and ways to achieve code reuse. Especially in the OOP world. An example of bad code reuse would be a single method that handles a large variation of similar problems. In these cases you end up with masses of IF and CASE statements. Extending functionality becomes near impossible, you end up having redundancy within that code and readability and maintainability are thrown out the windows. Probably the first thing I do when de-cluttering code is take any sizeable amount of code or small but critical that appears in more than one place or which I might imagine could be used in more than one place and create a dedicated method/class for that functionality. This can take a lot of redundancy out of larger methods and classes.
There are times however, when code needs to be able to handle a large array of possibilities and simply removing the small pieces of redundant code from the main body of code isn't sufficient to clean it up. In these cases, the approach I generally go with is inheritance. By using either implementations of an abstract class or a base class, code specific to specific implementation can be overridden where necessary, and a base implementation can be used where possible. Then there is simply one dispatch/factory method which returns the appropriate instance of the implementation.
Anyway, bringing this up because I applied this on a larger scale to my projects for my Brother and for my wife. Both applications now run the exact logic for controlling the database connections. The implementation I had in my brothers code was older and wasn't particularly well written and was causing problems. So I knew I needed to either rewrite it, or reuse the code in Veronica's application. I went with the latter. I split her codebase into 2. One for projects and code specific to her application and one with code I had designed to be used a base implementation. Both solutions are smaller, and simpler now with the core code off in its own solution. And my brothers codebase is now quicker and more robust. It is hard to quantify the difference... but it was something I knew I wanted to do, and I was surprised at the end to find how easily it was done and how big a difference it made on performance and stability of the application.
On the tech front. XBoxOne was unveiled yesterday. And I'm not sure if it is simply that tech journalist hate Microsoft, or if everyone is plain stupid, or if someone saw something I didn't. Anyway, the response, from what I've seen has been largely negative. And I'm floored. Everyone was expecting a gaming console. From what I've read, Microsoft is delivering something so much more than simply a gaming console. They are delivering an entertainment system with the power to be a gaming console. This is revolutionary. The PS4 is barely evolutionary. The Wii U is 2 consoles with 1 giant identity crisis. Apple and Google have no offerings in this realm, unless you consider the possible overlap with Apple TV and Google TV, but even there... this is so much more than either of those.
I have been laughing off Smart TV's for years. They are a stupid idea. Vendors say they sell like hot cakes... but the reality is that EVERY SINGLE TV which isn't a bargain model is now a Smart TV. It isn't that people want Smart TV's, it's that people want something that either high quality or larger than 32". And you cannot simply find a non-Smart TV that matches those criteria.
I had thought for a long time that set top boxes would eventually kill off the Smart TV, but no major OEM's bought into the notion, and there were a lot of things they couldn't handle well in general out of the box from other vendors.
If Microsoft does this right, they will have consolidated more entertainment devices into their own solution than anyone has done successfully to date. EVERYONE should be thrilled about this possibility. Some of these are things which others have already consolidated... what is important is that no one has consolidated all of these and some of these have never been consolidated into a single entertainment box; Gaming console, Smart TV functionality, Blue Ray player, Television Receiver, Telephone (Skype). With the exception of a stereo sound system this is a complete modern entertainment unit in one box.
People have clearly missed this. I say this for 2 reasons. Almost no one talks about how much functionality this is delivering, and because everyone complains about what it looks like. You're right, it doesn't look like a gaming console. It looks like an entertainment unit. And in that respect it is actually aesthetically pleasing.
Now, all of the details aren't out, and I'm sure I missed some. I'm interested in how the television integration part will work. If this is delivered properly then this device will be game changer. I think this is the biggest argument for the Xbox One. If it does this right, (in that, if it could actually replace a cable/satellite receiver box, even if it means a little extra work getting things setup) then I could easily see people buying up multiple for a single household. Even if they aren't gamers. And that would be huge. Granted, I perceive that as hoping for too much. But the existence of such a possibility should be generating far more excitement than it appears to be. Oh well.
First, the programming things. I've probably said this before, and I will undoubtedly say it again. Code re-use is the key to maintainability. Time and again, both at work and at home I have rewritten applications to increase their code re-use. Though it is important to do it correctly. But each time I have my code has become both simpler and more robust.
Simpler is obvious. The more you are able to re-use code, the fewer lines of actual code you have. Also, reusable methods, functions and classes tend to have more understandable names leading to more readable code as well.
The robust part may not be immediately obvious. But code that is reused is more heavily used, and used in potentially more diverse scenarios. This leads to code that is more heavily tested by design and code which is designed to be better able to handle exception cases.
Then there are additional benefits. Code which is heavily reused means minor fixes automatically improve more areas of your code.
But, as I stated, there are good and ways to achieve code reuse. Especially in the OOP world. An example of bad code reuse would be a single method that handles a large variation of similar problems. In these cases you end up with masses of IF and CASE statements. Extending functionality becomes near impossible, you end up having redundancy within that code and readability and maintainability are thrown out the windows. Probably the first thing I do when de-cluttering code is take any sizeable amount of code or small but critical that appears in more than one place or which I might imagine could be used in more than one place and create a dedicated method/class for that functionality. This can take a lot of redundancy out of larger methods and classes.
There are times however, when code needs to be able to handle a large array of possibilities and simply removing the small pieces of redundant code from the main body of code isn't sufficient to clean it up. In these cases, the approach I generally go with is inheritance. By using either implementations of an abstract class or a base class, code specific to specific implementation can be overridden where necessary, and a base implementation can be used where possible. Then there is simply one dispatch/factory method which returns the appropriate instance of the implementation.
Anyway, bringing this up because I applied this on a larger scale to my projects for my Brother and for my wife. Both applications now run the exact logic for controlling the database connections. The implementation I had in my brothers code was older and wasn't particularly well written and was causing problems. So I knew I needed to either rewrite it, or reuse the code in Veronica's application. I went with the latter. I split her codebase into 2. One for projects and code specific to her application and one with code I had designed to be used a base implementation. Both solutions are smaller, and simpler now with the core code off in its own solution. And my brothers codebase is now quicker and more robust. It is hard to quantify the difference... but it was something I knew I wanted to do, and I was surprised at the end to find how easily it was done and how big a difference it made on performance and stability of the application.
On the tech front. XBoxOne was unveiled yesterday. And I'm not sure if it is simply that tech journalist hate Microsoft, or if everyone is plain stupid, or if someone saw something I didn't. Anyway, the response, from what I've seen has been largely negative. And I'm floored. Everyone was expecting a gaming console. From what I've read, Microsoft is delivering something so much more than simply a gaming console. They are delivering an entertainment system with the power to be a gaming console. This is revolutionary. The PS4 is barely evolutionary. The Wii U is 2 consoles with 1 giant identity crisis. Apple and Google have no offerings in this realm, unless you consider the possible overlap with Apple TV and Google TV, but even there... this is so much more than either of those.
I have been laughing off Smart TV's for years. They are a stupid idea. Vendors say they sell like hot cakes... but the reality is that EVERY SINGLE TV which isn't a bargain model is now a Smart TV. It isn't that people want Smart TV's, it's that people want something that either high quality or larger than 32". And you cannot simply find a non-Smart TV that matches those criteria.
I had thought for a long time that set top boxes would eventually kill off the Smart TV, but no major OEM's bought into the notion, and there were a lot of things they couldn't handle well in general out of the box from other vendors.
If Microsoft does this right, they will have consolidated more entertainment devices into their own solution than anyone has done successfully to date. EVERYONE should be thrilled about this possibility. Some of these are things which others have already consolidated... what is important is that no one has consolidated all of these and some of these have never been consolidated into a single entertainment box; Gaming console, Smart TV functionality, Blue Ray player, Television Receiver, Telephone (Skype). With the exception of a stereo sound system this is a complete modern entertainment unit in one box.
People have clearly missed this. I say this for 2 reasons. Almost no one talks about how much functionality this is delivering, and because everyone complains about what it looks like. You're right, it doesn't look like a gaming console. It looks like an entertainment unit. And in that respect it is actually aesthetically pleasing.
Now, all of the details aren't out, and I'm sure I missed some. I'm interested in how the television integration part will work. If this is delivered properly then this device will be game changer. I think this is the biggest argument for the Xbox One. If it does this right, (in that, if it could actually replace a cable/satellite receiver box, even if it means a little extra work getting things setup) then I could easily see people buying up multiple for a single household. Even if they aren't gamers. And that would be huge. Granted, I perceive that as hoping for too much. But the existence of such a possibility should be generating far more excitement than it appears to be. Oh well.
Comments
Post a Comment