Marquee de Sells: Chris's insight outlet via ATOM 1.0 csells on twitter

You've reached the internet home of Chris Sells, who has a long history as a contributing member of the Windows developer community. He enjoys long walks on the beach and various computer technologies.




Object-Orientation is Over

Tuesday, 5/15/01

Java, and Java 2.0 (aka .NET), have brought with them the end of object-orientation. Of course, by that I mean that object-orientation is no longer a question -- it's just how we program. Even our scripting languages have classes and objects now. That fight is over, as are the advances in that area. Object-oriented programming, with inheritance, polymorphism and encapsulation, is just the way we do things now and Java and .NET represent the end of that line and the beginning of several others:

Generic Programming

Generic programming (aka "generics") provides the ability to write a partial type or function and let the compiler or runtime environment fill in the details based on client usage. Of course, C++ templates have provided generics via templates for a long time. Unfortunately, no modern object-oriented languages, i.e. Java and C#, have generics as yet, but they're coming. My favorite research paper in this area describes how generics can be added to .NET languages, using C# as an example, written by Microsoft's own researchers, Andrew Kennedy and Don Syme.

Generics have been around for a long, long time, so if you aren't already familiar with them, you're behind. Only C++ programmers do this now, but very soon, everyone will be.

Component-based Programming

Components differ from objects in that they are binary objects, often callable from languages other than that in which they were written. COM, Java and .NET are popular modern component development environments, but even DLLs have provided component-like features since Windows. Components provide a degree of encapsulation that often exceeds that of source-based OO environments, often at the expense of ease of use (although both Java and .NET work real hard to make components look and feel like objects).

Aspect-Oriented Programming

Aspect-oriented programming (AOP) provides the ability to define a set of characteristics of an object or a component that are actually implemented by the hosting runtime. The benefit, of course, is that it's much easier to declare the need for some feature, e.g. method tracing or the need for a component to be part of a transaction, than it is to write the code. To date, we've had pretty primitive support of AOP in the popular programming environments, but it's been there, e.g.

The .NET attribute mechanism represents a giant step forward in AOP. It's the first popular environment that provides a convenient, extensible mechanism for not only declaring attributes, but also implementing custom attribute provides, i.e. those bits of code that are activated when an attribute is encountered. Extensible .NET metadata is replacing the COM+ catalog and providing exactly what the Java serialization keywords provide and I expect most language to converge on the AOP style that .NET provides.

Generative Programming

Generative programming is the newest of these new programming styles. The term itself was boasted into popular usage by the book of the same name by Krzysztof Czarnecki and Ulrich Eisenecker. Generative programming is about representing your system's design requirements in some computer-readable form, e.g. SQL schemas, XML, UML, etc, and feeding it to some kind of metaprogram that will generate your program. The main benefit of generative programming is that as the design requirements change, your programs can be regenerated, saving you from manually replicating design changes into the code. Likewise, as the implementation choices need to change, e.g. from Java to C# or from Linux to Windows, the metaprograms can change and your programs can be regenerated, saving you from doing the porting work.

Macro languages, e.g. the C preprocessor, are generative languages for generating code within files. ASP and PHP are both generative languages for building web pages. Of course, DevelopMentor's own Gen<X>, was built from the ground up to be a generative programming tool (although we designed and built it long before we'd heard the term). Generative programming has a vast potential, I think (although I'm biased), because it encourages you to specify your design requirements and keep them up to date with the code, but also because of the potential for generating large parts of a system's code, testing data and even documentation. In fact, in building Gen<X> itself, we find ourselves generating more and more of the next version using the previous version. We don't use it for unique code, but we use it for the repetitive horizontal or hierarchical code as well as reference docs and test data. Highly recommended.

[new] Comment from Mickey Williams [mickey.williams@codevtech.com], Mon 7/2/2001 10:54 AM:

"I'd like to remind you that Eiffel has had generics longer than C++, and Eiffel's generics work on .NET. So there.

"Best regards from the Eiffel bigot,
"Mickey"

That's true, Mickey. I knew that Eiffel supported templates, but I didn't know that Eiffel# (the .NET version of Eiffel) did, so that's really cool.

0 comments




From COM to .NET

Saturday, 4/21/01

Enough people have asked me what I think about the transition from COM to .NET that I thought I'd publish my thoughts instead of responding to each individual email. This is the question that finally lead to me publishing this page in the first place.

In the early days of C, ASM was much more efficient, but C was much easier to use and as machines got faster, and C compilers got better, ASM was relegated to use by only a few. During the transition, ASM programmers were valuable and continue to be so for very targeted tasks, but they grow increasingly unnecessary. For example, in all the time that I've developed software (17 years), I've needed ASM exactly *once* (and then I just used Keith Brown : ). To this day, I have to admit that I can neither write nor even read x86 assembly. I've always meant to learn and I admit to being embarrassed that I can't, but I've never needed it. Each platform I programmed for, I started after the platform had moved away from ASM being the dominant programming environment.

As Microsoft ships increasingly stable betas of .NET towards a final release, we're nearing the end of a long and messy transition from processor-specific low-level programming to programming at a higher level on the Windows platform. To be honest, most Windows programmers are already there and have been for a while. They're the forward-thinking Visual Basic programmers. They recognized that they had no need to learn Win32 or COM. They could program at a comfortable level and make their C++ programmer friends do the grunge work for them. C++ programmers that haven't moved to VB yet had two reasons: the programs run too slowly and VB doesn't let me do what I want. With each successive release of VB, the efficiency argument has gotten weaker and weaker. Now that VB6 uses the same intermediate language and backend compiler that VC6 does, speed's really no longer an issue. The 2nd reason, "VB doesn't let me do what I want," is real and continues through VB6. The problem is really the language. There is one feature that no C++ programmer can live without: implementation inheritance. It's so useful for day-to-day programming chores that we can't give it up.

This one fatal flaw in VB6 was made very clear to me the other day when I was doing .NET programming using C#. Before we go any further, let me make one thing perfectly clear: VB.NET *is* C#. The only difference is the syntax. The language features are all the same but one: you can write "unsafe" code in C#, but not in VB.NET. Unsafe code in C# is the equivalent of  inline ASM: when you need it, you can't live without it, but you probably won't need it. So, when I'm programming C#, I could as easily be programming VB.NET. And the beauty of my experience of programming C# caused me to examine the difference between my previous VB6 experience and my current C# experience. I had a form-based drag-n-drop environment in both. I had IntelliSense in both. I had a programming model that was much simpler than raw Win32 in both. In short, C# and .NET gave me everything that VB6 gave me, but with one addition: implementation inheritance. When I needed to model the data for my application, it was so easy because I had inheritance but would've been so much harder without it. That feature made all the difference to me and is the reason that C++ programmers will finally feel free to move into the VB-like environment that .NET provides.

Will everyone abandon the Win32 API when .NET ships? No. Will everyone eventually move their code over to .NET? No. Will most folks spend most of their time programming .NET within 18-24 months of ship? Absolutely, yes. It's too compelling a platform with too many real advantages to ignore.

Does that mean you should stop all development and wait for .NET to ship? Absolutely, no. Build you components in COM today and you'll be able to move them over to .NET when the time is right (which may be never). The .NET backwards compatibility story is a good one. You'll be able to continue to make use of most of your COM components and DLLs in .NET, which means that the code you're working on today will continue to be useful long after you've moved your day-to-day programming activities to .NET. To ease the transition, I recommend marking your COM interfaces with [oleautomation] if possible. This limits your method parameters to types and attributes that .NET is particularly good at marshaling.

 .NET via C# and VB.NET is the future of programming for Windows, leaving Win32 and COM as the ASM of .NET.

0 comments




College Fun

I spoke at a college last week for a friend of mine who's an adjunct professor (Cal Caldwell). During the talk, one of the male attendees bolted <sigh>, but on his way out, trusted sources say that, when sighting a young coed whom our our bolter was clearly interested in engaging with in some way, he said, "Hey! Do you know who's in there? Chris Sells!" Clearly this young man was misguided in his attempt, but I'm glad to hear that someone thinks that using my name will help in attracting members of the opposite sex. It's never worked for me... : )

0 comments




College Fun

In Japan, it is said, the impersonal and sometimes unhelpful Microsoft error messages have been replaced with Japanese haiku poetry. Maybe in the next upgrade to our Windows...

Your file was so big.
It might be very useful.
But now it is gone.

The website you seek
Cannot be located, but
Countless more exist.

Chaos reigns within.
Reflect, repent and reboot.
Order shall return.

Aborted effort.
Close all that you have worked on.
You ask far too much.

Windows NT crashed.
I am the Blue Screen of Death.
No-one hears your screams.

Yesterday it worked.
Today it is not working.
Windows is like that.

Stay the patient course.
Of little worth is your ire.
The network is down.

A crash reduces
Your expensive computer
To a simple stone.

Three things are certain:
Death, taxes and lost data.
Guess which has occurred.

You step in the stream,
But the water has moved on.
This page is not here.

Out of memory.
We wish to hold the whole sky,
But we never will.

Having been erased,
The document you're seeking
Must now be retyped.

I ate your Web page.
Forgive me; it was tasty
And tart on my tongue.

First snow then silence
This thousand dollar screen dies
So beautifully.

The Tao that is seen
Is not the true Tao, until
You bring fresh toner.

With searching comes loss
and the presence of absence:
"My Novel" not found.

See how in Haiku
All error messages are
Somehow more peaceful

Richard Blewett
Ian Griffiths
George Shepherd
Internal Mailing List

0 comments




TZ Data to XML Project

These are the outputs of my attempts to translate the native tz data into XML for easier parsing for applications other than implementations of the standard C routines related to time.

This is the first step in a project to merge time zone and map data by the Time Zone Map Group, lead by Chuck Ellis.

Done

Yet To Do

Help!

Unfortunately, I'm but one man. If you'd like to help on any of these projects, let me know.

License

Copyright © 2001 by Chris Sells. All rights reserved. No warrantees extended. Use at your own risk. You may not distribute any portion of the tz2xml source code without express written consent. You may, however, use the source with no fee or redistribute the sample XML data at will.

0 comments




Genghis

Genghis is a set of extensions built on top of .NET and integrated with WinForms to provide application-level services in the same flavor as the Microsoft Foundation Classes. Genghis gets its name as the functional heir to Attila, a similar set of functionality built on top of ATL.

0 comments




a poem

Dear MFC::CString
You were such a beautiful thing
I miss you so much
CComBSTR is painful to touch
WTL may restore my churning (out string manipulating code).

Phil Beck
ATL Mailing List

0 comments




These Days its only COM COM COM (Am I Crying)

There is no vacation when I am doing COM.
Some go through very well, but stuck are some.

I don't go to parties, so I feel I am IUnknown.
People talking to me, those days are gone.

Brother has a complaint, that I don't callback.
Which kind of apartment he has, I don't check

Everyone stares me through those windows.
I live in ATL* and that is what I chose.

*(short for Atlanta)

Sandeep  Chawla
Private Email

0 comments




DM in the Wall Street Journal

Portland, OR, August 8, 2000 According to an article appearing in tomorrow's Wall Street Journal, DevelopMentor has developed a new technology for creating software applications. Attached is a photo of this technology in beta test at DevelopMentor's Portland Satellite office. DevelopMentor's device is attached to a user and using the latest LFM technology it auto-generates complete software applications. Evil Genius, Chris Sells, DevelopMentor's Senior Programmer, co-invented the technology with their Security Guru, the Prince of Darkness Keith Brown. Says Sells; "[our] new technology holds great promise for future generations of code warriors."

Cal Caldwell
Private Email

0 comments




UrlRun

Mon, 26 Jun 2000

To deal w/ the number of wrapped URLs I get in my email box, I built UrlRun. It checks the clipboard for an URL, no matter how broken, strips spaces, newlines and greater thans out of it and runs IE. To handle an URL as show above, select it, copy it to the clipboard and launch UrlRun.exe. I keep it on my QuickStart toolbar.

If you happen to be using Outlook 2000 or Outlook XP, Tim Tabor has built an UrlRun add-in that does the magic by simply right-clicking on a mangled URL that's you've selected. It's pure sex.

0 comments




Signs that you may be taking COM too seriously...

Tony Toivonen
DCOM Mailing List

0 comments




ATL Borg

Jeff Smith
Thu 2/10/2000 12:07 AM
Private Mail

0 comments




In defense of the VB Programmer

> -----Original Message-----
> From: Russ Huffman [mailto:russ@DEVAUTHORITY.COM]
> Sent: Thursday, January 20, 2000 8:39 AM
> To: ATL@DISCUSS.MICROSOFT.COM
>
> Don't we already have a "bunch of programmers who have no
> idea about how the underlying systems work"? I think they
> are called VB programmers... ;)

I hate to break this to you, but I've met a lot of VB programmers trapped in the body of a C++ programmer. Unfortunately, many development shops place a lot of peer pressure on people to reject their yearnings to stop using semicolons and memory allocators. It's sad, but VB programmers today are where US Blacks were in the 30's and gays were in the 50's. We have yet to see the "Rosa Parks" or "Stonewall Riots" for VB programmers.

BTW, I have been preparing a keynote address in case I am ever asked to keynote a VB-friendly conference. If you want to look at a draft, go to http://www.develop.com/dbox/dream.htm [ed: MLK's "I have a dream" set to VB music]

...I have been to VB7. I've seen the promised land. I may not get there with you...

DB

PS: Last time I checked, all programmers have selective ignorance. I know nothing about 3D graphics. I know a lot about COM. VB gets under people's skin because one can be ignorant of computer architecture and ASM and still
get a lot done.


Don Box
ATL Mailing List

0 comments




Abort, Retry, Ignore

Once upon a midnight dreary, fingers cramped and vision bleary,
System manuals piled high and wasted paper on the floor,
Longing for the warmth of bed sheets,
Still I sat there, doing spreadsheets:
Having reached the bottom line,
I took a floppy from the drawer.
Typing with a steady hand, I then invoked the SAVE command
But got instead a reprimand: it read "Abort, Retry, Ignore."

Was this some occult illusion? Some maniacal intrusion?
These were choices Solomon himself had never faced before.
Carefully, I weighed my options.
These three seemed to be the top ones.
Clearly, I must now adopt one:
Choose Abort, Retry, Ignore.

With my fingers pale and trembling,
Slowly toward the keyboard bending,
Longing for a happy ending, hoping all would be restored,
Praying for some guarantee
Finally I pressed a key --
But on the screen what did I see?
Again: "Abort, Retry, Ignore."

I tried to catch the chips off-guard --
I pressed again, but twice as hard.
Luck was just not in the cards.
I saw what I had seen before.
Now I typed in desperation
Trying random combinations
Still there came the incantation:
Choose: Abort, Retry, Ignore.

There I sat, distraught, exhausted, by my own machine accosted
Getting up I turned away and paced across the office floor.
And then I saw an awful sight:
A bold and blinding flash of light --
A lightning bolt had cut the night and shook me to my very core. I
saw the screen collapse and die "Oh no -- my database", I cried I
thought I heard a voice reply, "You'll see your data Nevermore."

To this day I do not know
The place to which lost data goes
I bet it goes to heaven where the angels have it stored.
But as for productivity, well
I fear that it goes straight to hell
And that's the tale I have to tell
Your choice: Abort, Retry, Ignore.

Anon

0 comments




Welcome to Attila!

Attila GDI sample
(Jim Murphy likes Attila and GDI a little too much...)

Welcome to Attila

Attila stands for "ATL for Applications." Attila is a set of extensions built on top of ATL to provide application-level services in the same flavor as MFC. Towards that end, Attila uses a lot of the same notions as ATL, e.g. heavy use of templates, static binding and reliance on the compiler and the linker doing their job.  Also, in the flavor of ATL, Attila is under-documented and requires a lot of user investment to make use of it. However, once you do, we think you'll find the flexibility and efficiency worth it. If you don't, you haven't lost much, 'cuz Attila is free. Enjoy.

Disclaimer

Attila isn't a class library. Some of the headers depend on some of the others. Some are stand-alone. You are free to pull in the pieces of Attila that you need and leave the rest alone. Most of the headers were built by different folks and while every effort was made to keep things consistent by choosing ATL design techniques, everyone does things there own way.

This work is the work of the individuals involved and does not represent any contribution of their respective employers. You are under no obligation to use any of Attila at any time, but if you do, please abide by the License.

License

Attila is copyright (c) 1999-2000 by its contributors.
All rights reserved.
No warrantees extended.
Use at your own risk.

You may use Attila in your product in compiled form without royalty.
You may not distribute Attila in source code form without the express written consent of the contributors.

The official home of Attila is http://www.sellsbrothers.com.

Installation

The current Attila bits are located at attila.zip. Download and unzip them into the folder of your choice (making sure to preserve path names). Make sure to add the Attila include directory to your compilers include path. For example, if you unzipped Attila into the c:\attila directory, add c:\attila\include to your compiler's include path. You can check to make sure you did this right by building any of the samples in the samples folder.

Support

Please do not send Chris Sells or any of the other contributors personal email complaining about Attila. Also please do not post Attila bug reports to any other mailing list, e.g. DCOM or ATL. If you like, you can submit bugs to the Attila Hit Squad mailing list (but only if you're a member). Nobody there is under any responsibility to fix anything in Attila, but you might shame someone into it. A much better way to contribute to the life of Attila is to submit the fix along with the bug report. Or even better, join the Attila Hit Squad mailing list and fix bugs submitted by others.

Official Attila Contributors

Who Did What

Documentation

You might find some implementation notes for Attila in the docs folder, but you probably won't. If you have any documentation you'd like to submit, we'd love to have it.

Samples

Check the samples.htm file in the samples folder of the Attila distribution. You can build all of the samples from the command line using the buildall.cmd batch file in the samples folder.

CComSingleInstanceModule

SdiDocView

MdiDocView

LookOut

History

0 comments




10 older posts       2625 newer posts