What difference does that make? Between you, me, the lamp post, and a couple million Microsoft developers, CTP usually means that Microsoft is open to responding to feedback that validates the directions that it has already committed to.
Thursday, November 29, 2007
Favorite Quote of the Day
From Scott Bellware to Phil Haack on the altnet mailing list:
Labels:
quotes
Tuesday, November 27, 2007
What's the most important aspect of long-term-quality software?
Just doodling...What's the most important aspect of long-term-quality software? I'll define long-term quality software as some piece of software with a lifespan of many years, over which that software can be extended and changed to suit new needs without compromising quality.
Some potential answers, with my best spur-of-the-moment arguments:
Are there other candidates?
Some potential answers, with my best spur-of-the-moment arguments:
- Strong typing - not just variable types, but any sort of type, like a database table. If something changes in the contract (field name changes, or a 1-1 relationship becomes 1-many), then I should be able to make the change and within minutes, know each of the places that are impacted in the code. The justified fear of making changes to a system is driven by the unknown impacts. If I know all of the impacts, then I am in a very strong place.
- DRY (Don't Repeat Yourself) - If logic is represented in multiple places, then someone will only change it in one, which will automatically create some inconsistency. If you are lucky, then the inconsistency will be noticed quickly. If you are not, then you will only find out later when the damage is done.
- YAGNI (You Ain't Gonna Need It) - Software is complex. At some point, the complexity becomes too much for us to fit in our minds at one time. The longer we can defer that point in time, the more maintainable (and learnable) the software will be. There are two distinct types of complexity though - inherent complexity (because the problem is complex) and artificial (unnecessary) complexity. By introducing functionality before we know for sure that we need it, we are creating artificial complexity. Thus, we will reach the point of too much complexity before we should have.
- Minimized Coupling - The complexity of software is directly related to how big it is. When we couple things together, we are making something more monolithic, and thus harder to understand. We also cross a line that is difficult to un-cross. (One coupling-point is just the first of many). Minimized coupling is an antidote to complexity.
Are there other candidates?
Labels:
architecture,
DRY,
musings,
OO
Tuesday, November 20, 2007
Exception Handling 101
- In some older languages, the runtime was not able to expose a call stack when exceptions occurred. This led to programmers spattering the code with exception handling-code, so that they would have a better idea of where exceptions occurred.
- Historically, programmers have sometimes used exceptions to communicate status.
The above 2 ways of doing things are no longer appropriate.
First, in a language which exposes an exception call stack (like C# or VB.NET), the only place you need an exception handler is at the top-most point of a thread. So, you need a try...catch around your application entry point (Main sub), and around every new thread you manually spawn.
Second, using exceptions to communicate status is a terrible practice. I cannot articulate why really. Perhaps because it forces you to code everything very defensively, which obscures the intention of the code. In any case, experience shows that things are much simpler if you follow the rule that exceptions are only for exceptional scenarios. In other words, do everything you can to avoid having to trap exceptions.
This is harder than it sounds. It pairs well with the "fail fast" rule though. You can implement this rule by validating parameters to your methods. If they do not meet your expectations (e.g. something is NULL when it should not be), then throw an exception. The intention of the exception is always to indicate an invalid system state. (An invalid system state is unpredictable and dangerous, and should never occur - it is an exception).
Labels:
.NET,
OO,
patterns,
productivity
Friday, November 16, 2007
DSLs - a stupid abstraction of an abstraction
It implies that if only we could invent a new miracle language for any given problem domain, then we could talk about it (and instruct our computers to deal with it) in a way that gives complete power over that domain.
Abacadabra. Open Sesame. If only I knew the magic words...
Labels:
rant
Wednesday, November 14, 2007
Domain Specific Languages - the real ones
People talk (and write) about Domain Specific Languages as if it is the way of the future. It is. But they do not understand why, and nor can they until they discard the term.
The idea is what is important. And this is the idea:
Nothing to do with languages, or scripting, or any such programmer-oriented way of thinking. The term "Domain Specific Language" (DSL for short) is soo 90's CASE tool thinking. Still, I'm gonna continue to use it in this blog entry, because I do not have a better term.
As with all advances in software development techniques, it is about increasing the level of abstraction. To my way of thinking, this blog is published using a DSL. I have never looked at any HTML or even CSS on this site. Someone else discovered a neat way to abstract the problem domain of Blog writing. They encapsulated their idea in a piece of software (Blogger.com if you're interested), and now I am 100-times more productive than I would have been if I used HTML.
(I made up that number of course. Its probably closer to infinity, because I would not write a blog at all if I had to use low-level tools).
So to my way of thinking, a true DSL increases the level of abstraction of a problem to the point where it is orders of magnitude easier to solve the instances of that problem.
While the buzz on DSLs is relatively high, the buzz on "frameworks" is low, to the point of being a dirty word for some people. I disagree. A framework is just a premature DSL. Someone's attempt to abstract some aspects of a problem domain.
This is what I am doing with my new website, PerfectAPI.com. I am building abstractions that I think will increase developer productivity by orders of magnitude. I'm betting that the abstractions I am creating are sufficiently mature that they will stand the test of time. Wish me luck.
The idea is what is important. And this is the idea:
A componentized (re-usable) abstraction of some problem domain.
Nothing to do with languages, or scripting, or any such programmer-oriented way of thinking. The term "Domain Specific Language" (DSL for short) is soo 90's CASE tool thinking. Still, I'm gonna continue to use it in this blog entry, because I do not have a better term.
As with all advances in software development techniques, it is about increasing the level of abstraction. To my way of thinking, this blog is published using a DSL. I have never looked at any HTML or even CSS on this site. Someone else discovered a neat way to abstract the problem domain of Blog writing. They encapsulated their idea in a piece of software (Blogger.com if you're interested), and now I am 100-times more productive than I would have been if I used HTML.
(I made up that number of course. Its probably closer to infinity, because I would not write a blog at all if I had to use low-level tools).
So to my way of thinking, a true DSL increases the level of abstraction of a problem to the point where it is orders of magnitude easier to solve the instances of that problem.
While the buzz on DSLs is relatively high, the buzz on "frameworks" is low, to the point of being a dirty word for some people. I disagree. A framework is just a premature DSL. Someone's attempt to abstract some aspects of a problem domain.
This is what I am doing with my new website, PerfectAPI.com. I am building abstractions that I think will increase developer productivity by orders of magnitude. I'm betting that the abstractions I am creating are sufficiently mature that they will stand the test of time. Wish me luck.
Labels:
architecture,
re-use
Subscribe to:
Posts (Atom)
