Tuesday, May 12, 2009

Does the government have any idea of which direction it should shoot?


Once in a while I read something that makes my blood boil.  Yesterday, around noon, a flurry of articles were published indicating that the Department of Justice intends to begin stricter enforcement of antitrust laws. Assistant Attorney General Christine Varney said the Justice Department is abandoning legal guidelines established by the Bush administration in September 2008.

So who is in the cross-hairs of the sniper rifle this time?  Sure it is Citibank, Bank of America, JP Morgan and Wells Fargo, right?

Wrong!  Google, Intel and Microsoft are the main targets.  Obama is shifting to the European approach to anti-monopoly action.  Since Google, Intel and Microsoft are constantly in trouble with European regulators, we can expect the same from the good old Federal Government.

Now, as much as I like small competitors like Borland (now dead), Yahoo (dying) and AMD (also in trouble), I know better than to think that monopoly power did it.  AMD simply failed to compete with Intel.  There were some very bad decisions there, such as the merger with ATI.  I know Yahoo has not been competitive with Google in terms of apps & hard information research for years now.  That isn't Google's fault.  Yahoo wanted to be a celebrity tabloid machine.  They decided move towards People Magazine on their own, and now they are fucked.  Borland died because it didn't seem to know how to market to corporate America.  They had awesome persuasive powers with true programmers, but they had no idea that they needed to market direct to corporate officers.  The CIO needed to be in the crosshairs.  They also had no idea that they needed to recruit MS Office power users.  It is a horrible thing that Borland basically died, but market-wise, they were stupid.

So, instead of breaking up the Banks, who fucked the entire world, the Justice Department intends to prepare anti-trust proceedings against Google, Intel and Microsoft.  These are the three most powerful and important firms in the high-tech sector of the world.  Incidentally, the tech sector is the only thing keeping our American economy afloat right now.  Boy, these supreme assholes in the Justice Department really don't have a fucking clue do they?

I have nothing against Trust Busting.  Teddy Roosevelt did it all the time.  He is one of my favorite guys, and I don't much like presidents and politicians.  If you are going to bust some trusts, bust the dangerous ones.  Don't go after the healthy, useful and benevolent ones.  For crying out loud!  Shoot strait will yah!?!?!?

This new policy statement indicates indicates that the Government does not know the difference between its ass and hole in the wall.  This has to be the most AFU announcement I have heard in sometime.

The problem with C# 4.0


I hear many things about my favorite programming language these days.  Not all are favorable.  Some statements conflict.  There are a couple of facts about the latest edition (additions) to C# that cannot be denied.

1.  Anders has added in support for dynamic language interop.  This is mostly a matter of implementing a new static type whose static type is dynamic.  I guess that is the C# way to do it.  Basically, a declaration of 'dynamic X;' means we will obtain a boxed object with some metadata attached to it to let us know what type it really is.  This is almost like generics in Java.  The performance penalty is not too terrible at run time when all factors are considered.  Still, there will be a penalty.  This won't be high performance.  Worse, there is no question that this is full-bore late-binding.  In any late binding situation, you loose type safety.  No compiler can ever predict that any piece of late-bound code will ever work, or work in all scenarios.  The compiler will go along with it, presuming that you know what you are doing.  When the build is successful, do not presume that the compiler has endorsed your code.

2.  Anders has added support for optional parameters, so we can now have pain-free use of C# in connection with the dreadful, much-detested, out-dated, out-modded Microsoft Office object model.  Optional params are big in OLE2 or COM or ActiveX or whatever you want to call that disgusting old shit we used to do.  Lamentably, the dastardly Microsoft Office object model is still a filthy COM beast.  You should obtain less painful interops with all COM servers because of Anders most recent additions to C#4.  Still... this is a dirty thing to accommodate.  It is the programming equivalent of saying "have sex with HIV infected individuals, just use this condom".

3. There is also some stuff about co & contra-variance with greater safety.  I have never stubbed my toe on Co & Contra Variance, so I see no issues solved here.  I suppose this helps in a few marginal edge cases.  I know of none in my code.

4. Finally, Anders & co are re-writing the C# 4.0 compiler in C# itself, thus making the compiler available as just another managed code software services at run time.  The presumption is that C# 4.0 programmers will now use this handy-dandy, ever-ready compiler to engage in meta-programming techniques and tactics.  Once upon a time, this was the exclusive privilege of people coded with Interpreters.  Java programmers can only get access to this sort of dynamism through a jar library called Janino.

These last two items are of no consequence to guys like me.  Some may be jumping for joy, but I don't need a runtime compilers just now.  

Surprisingly, the announcement of these language features has tripped off a debate surrounding the question of whether C# is getting too big for it's britches.  Some say that C# is becoming an over-bloated Swiss Army knife.  I really think this debate misses the point entirely.  The issue is not one of whether the language is getting too big, but rather whether it is growing in the wrong direction.

Certainly, I do not welcome the advent of the dynamic type.  I don't need it, and I don't plan to use it.  I suspect that the mere presence of this type will slow the compiler considerably.  I hope it doesn't result in generally fatter CIL for all, which would in turn lead to fatter X86 code.

I am not a fan of optional parameters.  Optional parameters are element & aspect of a generally sloppy approach to programming.  That is why they are in VB.  They are not unlike the unstructured goto statement.  They are just bad for your code.  Either a param is necessary or it is not.  If it is necessary, it should always be required, and it should always be set.  Programmers should not be allowed to 'safely' ignore a parameter. This is one of the many ways in which unexpected and somewhat unpredictable behavior emerges in a system.  Programmers should be aware of the change in behavior flag settings will produce.  Of course, I realize that Optional Parameters were big in the days of COM.  This is one of several reasons why COM was a dirty, fifthly, nasty, ugly, disgusting, detestable, nasty, wretched, leaky, buggy, unstable, evil piece of shit.  [Did I mention that COM had no security model and was single handedly responsible for the Great Spyware Pestilence of 2003?]  There are explicit reasons why we flushed COM down the toilet in .NET.  One of the reasons optional params were rejected in C# is that we wanted to rid ourselves of this corruption.  Now here we go again.  Not good.

I understand why Anders reversed himself.  Many, many, many C# programmers have been bitching for years about how difficult it is to drive the Microsoft Office Model because C# does not support optional params.  Anders caved in under pressure from customers and the high command.  In a very real sense, I know this will make my life easier when I must do an Office automation project.  Still, I do not look forward to fully managed C# library, with no element of COM, which show optional params all over the place.  This eventuality will signal the arrival of sloppy coding techniques in the rather purist world of C#.

My real bitch is that the two language features we really need the most did not make it into C# 4.0.  What are those features?
1.  Traits, just like in Scala
2.  XML literals just like in VB.NET

In all honesty, these are the only two linguistic innovations I have seen in the past 6 ot 7 years that did not originate in the C# project.  

Traits are basically implemented Interfaces which you can tack on to almost any object.  They give you the advantages of interfaces with the advantages of mixins in Ruby.  The final yield is a language feature which gives you the reliability of single inheritance with some of the advantages of multiple-inheritance.

XML literals threw me for a complete loop.  XML literals took VB, a language which was dying IMHO, and suddenly made it the best language for the MVC framework. You don't know how much it hurts me to say this, but I would never want to code a helper class in MVC without the aid of VB.NET XML literals. This is not to mention all of the complex XML transforms which this system makes incredibly easy.  

XML literals are probably the greatest, most practical, most useful idea I have encountered in the past 5 years.  The biggest thing since Generics.  Scala also has a form of XML literals, but they don't seem backed by the sort of library power VB.NET offers.  In any case, C# should have had this feature.  Omitting XML literals from C# 4.0 is the same thing as capitulating the MVC framework to VB.NET.  Anders needs to take notice of this fact and make some corrections.

So the final verdict is clear.  C# is not guilty of getting too big.  C# is guilty of expanding in the wrong direction.  C# is guilt of not expanding in the right direction.  All-in-all I am quite disappointed.

Friday, May 8, 2009

Why is optimism considered a liberal thing?

Boy... I sure am reading some very strange things in regards to the new Star Trek movie.

A cursory survey of the articles shown on news.google.com indicate that every liberal is punching in an editorial on this movie.  They are saying some of the darnedest weird things.  If I understand them correctly, Obama is responsible for the best movie of the summer.  He seems to have created the optimism that forced Paramount to make this new Trek in precisely the way they made it.  This new Trek is the spirit of the Liberal Obama on film.  If you love the new Star Trek movie, you are a soul-brother of the Liberal Obama.

Wow...  He works fast, doesn't that Obama?  I think I smell a political cogitation.  What a co-inky-dinky?  Who woulda thunk they'd have done a strange thing like that?  This is very much like John Kerry putting on a Buckeye sweat shirt before appearing at Ohio State University and then a Wolverine cap in Ann Arbor the next day.

Let's face the facts folks.  The Democratic party is attempting make a long-term comeback. It was not long ago when the entire world considered the United States to be (by far) the most conservative advanced nation in the world.  Most of them still hold this impression of us today.  It was not long ago that  people were talking about the Democrats becoming a permanent minority party.  It was just a scant 9 months ago that Palin... er... McCain was 10 points ahead of Obama in the polls.  John only pulled ahead because he picked Sarah.  Otherwise his campaign was dead.

Larry King famously asked Bill Clinton the following question in October 2008: "We are in the midst of the biggest financial collapse since the great depression.  We have the biggest deficit we have had since World War II.  We have the biggest debt ever.  We have had 6 years of unpopular war.  Why is Obama barely ahead in the polls?  Why is this not a done deal?  Why is this election not completely over and done already?"  

Larry was reffing the very slim lead Obama held in the polls during the month of October.  You should have seen the look on Bills face.  Boy that was a combo of affects!  Terribly embarrassing question there!  Bill was humiliated over being forced to grapple this question.  

Bill spun a political yarn about how 45% of the people are die-hard Republicans and 45% of the people die-hard Democrats.  10% of the people are die-hard independents who just can't make up their minds.  They won't decide until 1 week before the election, if they follow their normal pattern.

With all due respect to the last Republican... er... Democrat to give us 3 straight balanced budgets in a row and 2 with a surplus (and I thank him profusely for this) I have to say that this theory is absolute and complete bullshit.  Bill was telling one his famous lies there.

Fact of the matter is about 30% of the population now describes itself as die-hard Democrat.  About 29% of the population describes itself as die-hard Republican.  That number has shrunk considerably in the past 2 years.  I am one of those who left the Republican house.  Don't you dare think that makes me a Democrat.  Fuck no!  

The conclusion is clear.  Something on the order 41% of the nation now calls itself independent or 3rd party.  They don't like the Republicans.  They don't like the Democrats.  Most of them are like me in dismissing ideological rhetoric from both parties and watching actual voting behavior.  If you do this, you will understand that Republicans vs. Democrats is anything but Liberal vs. Conservative.  It is more like Target vs. Walmart.  Similar vendors, similar products, similar prices.  They pretend a difference.  That fantasy is bullshit.  It is just the Blue team vs. the Red team.  It is like the Rams vs. 49ers: Two formerly great teams who both suck ass today.    It makes no sense to describe the Rams as the conservatives and the 49ers to be liberals.  That would be foolishness.  We simply have two teams competing in a Zero-Sum game.  That is all.

The behavior of the electorate in October was an indication that a large majority of the people do not trust the Democratic Party.  Although they probably didn't want to support the Republicans, the notion of supporting a Democrat was unpalatable at best.  The majority went ahead and did so anyhow.  Truth be told, it was a 2 point victory for Obama.  That is closer than anybody would care to admit.  By the way, I don't think this had anything to do with race.  I would like to have voted for Obama on a personal basis.  I just don't like his party or their political slant, as mild as that slant might be.  Ergo, I stayed home.

The fact that 41% of the voting population of the United States is non-aligned is a deep terror to both Republican and Democrat alike.  It has produced unprecedented levels of voter volatility.  We now have some unpredictability in the system.  It used to be that every congressional seat was safe if occupied.  That is not exactly true now.  Worse still (from the point of view of the typical asshole in Washington) we have the most fertile conditions in American history for the arrival of a new 3rd party with some serious voter torque in its crankshaft.  Neither the Republicans nor the Democrats want that to happen.  They have co-constructed an election system which supposed to prevent that from happening.  This handiwork may be the only thing preventing a major third part from emerging.

Make no mistake, the Democrats are absolutely thrilled with their new domination of Government.  Make no mistake, they feel this is the way things aught to be.  Nevertheless, they are terribly insecure about this victory they won in 2008.  Given the number and percentage of independents, they know there is great volatility in the system.  Their victory next year is uncertain at best.  Political capital deposits can evaporate very quickly.  You can hit a political liquidity crisis fast in this environment.  

For this reason, the Democrats are doing a lot of post-sale evangelism.  Under the heading of advanced pop-culture analysis the libs are attempting to sneak some rhetorical black-magic past us.  That is why pessimism is now a conservative agenda according to the liberal columnist.  That is why the Republicans are now the part of NO!  That is why optimism is now a liberal thing.  This is why the new Star Trek, destined to be the biggest hit of the summer, is now the very artistic embodiment of the liberal spirit of Obama.

I just wish they would not mis-characterize my Star Trek in the process.  One Utopian liberal editorialised the question "Can the peaceful utopia of Star Trek happen in reality?"  The presupposition is utterly false.  Believe me, there was plenty of combat in Star Trek.  The new Trek has Romulan commanders destroying entire worlds with minature black-holes.  The Trek universe was not in a constant state of war, but it always seemed on the brink of a war.  Many Trek plots have to do with diplomatic attempts to head off war.  There were neutral zones like Berlin Walls separating Klingons and Romulans from those of the Federation.  They blew each other up often enough.

Frankly, the statements of Star Trek's political optimism, liberality, peacefulness and Utopianism is vastly overstated.  It shows how people project their biases upon the objects of their affection.  It also shows that a shaky and nervous party will now try to co-opt the movie biggest hit of the summer in an attempt to build a long-term friendship & solidarity with the people.

There is still motion blur and jutter on LCD TVs

Those of you who have read my blog know that I recently bought a Samsung Luxia UN55B7000.  This is the recently acclaimed LED LCD HDTV which supposedly defines the state of the art in LCD flat screens at this moment in time.  It is also 1.2 inches in total thickness, a fact cause the fashion critics to stand up and praise God. 

Almost 3 full weeks have elapsed since I made my purchase.  It will be 21 days as of tomorrow.  I purchased my Unit on April 18.  What have I learned?  Many things, in truth, but none more important than this:  There is still motion blur and jutter on LCD televisions.  There is also flat-cold ghosting and after-imaging on fast moving objects in movies.

Anyone who says otherwise is a Goddamn fucking fork-tongued liar.  Direct that filthy lying sonofabitch to my blog so I can insult the shit out of him.

You can't get away from it.  120Hz works for sports like Football and Basketball.  120Hz motion smothing does not work on Blu-Ray movies.  It does wacky things to 24fps movies.  You won't like it.  You will shut it off.  I guarentee it.  The first time you see the lips of an actor out of sync with the sound-track, you will hate this feature.  You will be pissed.

Folks, blurring and ghosting are not (and never have been) issues with DLP technology.  There is a very precise and logical, physical, scientific explanation for this fact.  Let me tell you about it.

LCD is an acronym signifying Liquid Crystal Diods.  There are approximately 2 million Liquid Crystal Diods in a rectangular array on any 1080P LCD television.  Each one of those 2 million Liquid Crystals changes its color osculation in response to an electrical signal sent to it by the video processor.  It takes a bit of time for an LCD to change its osculating frequency (and therefore color) in response to a new electrical signal.  We call this delay between signal change and osculating frequency change "Refresher Rate" or "Refresh Time".  LCDs carry an important measure quote called "Refresher Rate".  This figure is quoted in Milliseconds.  All LCDs featuring 120Hz technology have a refresher rate of 4ms.

Believe it or not, that is hella-slow.  DLP is radically faster.

DLP is a different kind of technology.  DLPs are based on a light gun powered by a 150 or 180 watt bulb.  This gun is located at the back of your 10 to 19 inch deep DLP HDTV.  It is a type of projection technology, not unlike CRT or the projectors you see in movie theater.  It is identical to the digital theater projection systems you see in high-end movie houses like the Archlight, or the Mann Chinese Theater in Hollywood.  It is merely rear-screen projection rather than front-screen projection.

The DLP shoots photon waves of light at your screen, and paints the picture in colored light.  How fast is this in comparison to LCD?

Last time I checked, the speed of light is a universal physical constant and is quoted at 299,792,458 meters per second.  How long does it take a beam of light to travel about 13 inches or 33cm from the bulb to screen?  Last time I checked that works out to 1.10076 E-8.  I think that's just about 11 nanoseconds.  Last time I checked a nanosecond is defined as 1 E-9 s.

So we are talking about the difference between 4ms and 11ns.  We are talking about the difference  between 4.0 E-3 vs. 1.1 E-8.  That is 5 orders of magnitude, and 363% multiplied on top of that just for good measure.  That means my new LED LCD is 3.63 E+5 slower than my old DLP.  In English that means my new LED LCD is 363,384.79758 times slower than my old DLP.

When I said DLP is radically faster, I meant radically faster.  I bullshit you not.

That means that there is no fucking motion blur on any fucking DLP.  That means that there is no fucking ghosting or after images on any fucking DLP.  You can shove that fact up you fucking ass and bleed to death rapidly it if you are DLP detractor.  The problem that afflicts LCDs does not apply or pertain to DLP in any way shape or form.  By its very scientific nature, DLP completely avoids this problem.  Asking how DLPs control motion blur is like asking how you rewind your DVDs before returning them to Block Buster.  The question is illogical because the problem does not exist.

Are you ready for some whipped cream on top?  My old DLP cost $2000 about 2 years ago.  This new LCD cost about $3000 just 20 days ago.

Are you ready for the cherry on top of the whipped cream?  My old DLP was 6 inches larger than my new LED LCD.  It was a 61 inch behemoth.  This one is just 55 inches.

For this reason I am disappointed in my purchase.  All-in-all, it is still pretty good television, but it is not as good as the best DLPs on the market today.  Although the clarity and detail are magnificent, motion is more important.  We call them motion pictures for a reason.

I am very glad that my mother covets my new LED LCD with great lust.  She is seeking a family discount price on a used purchase as I write this.  I think I am going to sell it to her... just the second that the Mitsubishi WD-82837 comes out in June.






Wednesday, May 6, 2009

Java programmers are just hog wild about AOP

Recently, a flaming post went up on the DZone.com website.  A Java fellow posted a blog in which he bluntly stated that he would much rather employ Java programmers than C# programmers.  The absolute point of the piece is that AOP is extremely popular in Javaland, and all Java programmers (young and old) are well versed in the paradigm.  Such cannot be said for the C# programmer.  C# programmers seem to think that AOP is for testing only.  We don't seem to understand the other mega-benefits of AOP.  For this reason you should hire Java guys, not C# guys

I've given this political statement consideration over the past several days, I am completely sure that this a further example of the ethnocentric and narrowly learned specialization of all programmers in our field.  You see, the Java guy clearly doesn't understand the deep strategy of C#.  Neither does he understand the deep strategy of Scala.  Neither does the C# programmer understand why AOP is totally essential to life in the Java ecosystem.  The C# programmer does not understand why a lack of events and delegates in Java would push the entire ecosystem towards AOP.

Let me tell you about it.

Since the dawn of time, the dream of programmers everywhere has been code reuse and modularity.  We want to stop writing the same code over and over again every time we start a project.  We want a nice library we can compose with.  Composition is a big fucking word in our profession.  It is the dream of the blue turtles.  We want to write just those little bits of app-specific logic our customers demand.  Composition and reuse are the absolute ideas driving most changes over the past 30 years of computer languages.

Simple OOPs is nothing more than an attempt to achieve composition and reuse.  In the days of Smalltalk, simple OOPS worked out fairly well.  Because of the weak typing system, simple objects did the trick fairly well.  It was easy to interchange BaseA object with ModifiedA object, or BaseA with BaseB, or ModifiedA with ModifiedB.  The weak and dynamic typing system just went along with it, and if it could work, the interpretor would make it work.  For this reason, composition was pretty dang easy in Smalltalk.  There was pretty good code reuse in Smalltalk.

The problem is that a lot of us hate interpretors and weak typing systems.  A lot of us out-right fear dynamic systems for their unpredictable behavior and their slowness.  Others hated the ugly and goofy looking interface of the Smalltalk virtual machine.  Ergo, Smalltalk was not widely adoped and it ultimately died.  It was always a niche thing which the Ubergeeks used.  It is now having an interesting undead afterlife in the form of Squeek, but Smalltalk is dead none the less.

In response to Smalltalk, a number of strongly typed and compiled OOPs languages were invented.  C++ and Object Pascal were two perfect examples of this movement.  The problem was that they were only half-assed OOPs languages.  They were also structured.  A lot of Dephi programmers programmed in flat structured Pascal and claimed to be object oriented.  Likewise, a lot of C++ programmers were really writing C code and claiming to be object oriented.  As you might imagine, this approach did little for Composition and Reuse.  Worse still, once the language is strongly typed, interchange of BaseA object with ModifiedA object, or BaseA with BaseB, or ModifiedA with ModifiedB is no longer possible.  The signature of a function or a method demands a specific type.

Next, Java came around with a simple language and simple OOPs and the notion that you should inject dependences in an AOP fashion.  In this approach, you pass everything by interface type or abstract class.  This loosens the type system enough so that interchange of BaseA object with ModifiedA object, or BaseA with BaseB, or ModifiedA with ModifiedB is possible... with in some limits.  IoC and DI were formalized in things like Spring, AspectJ, and Guice to make this even easier.  You get pretty good code reuse in this AOP approach to doing business.  Implicit within this success story is a clear cut admission that pure OOPs doesn't yeild composition and reuse when you are compiled and strongly typed.  You need to take an AOP approach, or you don't get composition and reuse at a good high level.  

At roughly the same time (a bit earlier) Delphi came around with the notion that you should have something greater than objects called components.  These should be wired together with delegates and events.  Delphi died.  Java won by default.  Delphi was reborn as .NET and C#.  Suddenly the battle was renewed.

Of all the things that have triggered the greatest number of flame-wars between Java and C# programmers over the past 8 years, a pure lack of understanding of the .NET Component is top of the list.  C# programmers know they have components.  Some are dimly aware of how they work.  Many of them have no ideal in the world that Java lacks components.  They don't understand that strategy and command patterns are built into the CLR as first class citizens.  Specifically, strategy=events and command=delegates.  [Some would rap my knuckles for making that hard fast association.  Bring it on.  You'll get knocked the fuck out.]  These first-class citizens of the .NET framework are the foundation of components and loosely coupled, modular, composable, reusable code framework that we enjoy in the .NET system.

Java programmers do not understand this.  Events, delegates, properties, full lexical closures, all these things work together to make AOP far less necessary in the .NET programmer's life than in the Java programmer's life.  Coversely, because you lack events, delegates, properties, full lexical closures in Java, you need AOP much more than we do.  We get good composition and reuse without AOP.  We get good simple code without AOP.  If you think your AOP code is clean, you should see our component code.  It is wired together and loosely coupled with Events and Delegates.

This is not to say that AOP is completely irrelevant to the C# programmer.  Many of us, especially me, are asking serious questions these days like:

1. How can we take advantage of some of the goodness of AOP?  
2. When should I select AOP rather than a component approach?  
3. What are the specific scenarios where AOP is preferable to writing a component?  
4. Can AOP improve certain approaches where components don't work so well?
5. If so how?

So far, there is a lot of debate about this topic among serious minded C# programmers.  We don't have a lot of clear-cut, indisputable design-wins and use-cases for AOP.  Logging application activies and errors is one winner.  Automatic unit testing of production code is another.  This is strong sign of the high value of components.  They only break down {with certainty} in a couple of scenarios.  Of course, we do not yet understand AOP as well as we will in 10 years time.  In that time we may have even more compelling use-cases for AOP.  Right now, we don't.

It should be noted in passing that several veteran polyglot programmers are rallying against AOP in the .NET world.  In particular, the gentileman scholar Ted Faison has written a super book called "Event-Based Programming:  Taking Events to the Limit".    I remember Ted well from my Delphi days.  He was a great Delphi programmer.  Like most of us, he moved with Anders to the .NET platform and C#.  I like him and respect him, so I read his book.

Although Mr. Faison doesn't say it bluntly, a careful consideration of what he says in this book boils down to the following: "All of you C# programers runing toward AOP are headed in the wrong direction.  Don't do AOP just because the Java guys do AOP.  Use the events and delegates in our systems to wire together components, and you will obtain better and looser coupling.  This will give you the best possible composition and reuse you can obtain today."  I reached a conclusion that mega-AOP, as it is practiced in Javaland, is a specific solution pattern, in a specific language, which lacks key attributes we have.  Ted Faison might not have actually said that bluntly in his book, but I achieved that realization from reading his book.

This conclusion becomes even more interesting when you consider the design goals of the Scala language.  For those who don't know about it, Scala is Java's replacement and successor. This is like Marcus Ulpius Nerva Traianus taking over for Marcus Cocceius Nerva.  It is the succession from a good emperor to a better one.  Martin Odersky is explicit in his design manifesto for Scala.  Two questions drive him:
1.  Can we provide better language support for component systems?  He wrote a nice paper and did a video about this subject.
2.  Can we find a perfect fusion of Object Oriented Programming and Functional Programming at the same time?

Dr. Odersky very delicately offers a tough critique of Java in Scala.  You don't actually have a delegate in Scala, but you don't need one.  You pass functions without any delegate machinery in any functional language.  You don't have interfaces in Scala, but you don't need them.  You are better served by Traits, which give you all of the advantages of Interfaces, Mixins, and Multiple inheretence.  You don't have to pass things by Trait or by abstract class in Scala.  Type Inference and fully-orbed Generics will get the job done for you.  This generic based polymorphism obviates the need for OOPs polymorphism.  All of this adds up to a system which can do serious components, composition and reuse.

But this Scala approach to the problem is not well understood by Java programmers.  This is where they are going to have a big problem adjusting to life in Scala.  As a proof consider this:  A Java programmer learning Scala posted up at the Scala-Lang.org site.  He asked the following question:  How do I use Guice in Scala?  Since he was a Java programmer who did not want to reinvent the wheel, the question is perfectly understandable.  One of the Scala team members on the site answered his question.  Paraphrasing, the team member answered that AOP is basically out of place in Scala.  You can use it.  It is not recommended.  It isn't the Scala way of doing things.  Scala uses components.  Scala achieves composition and reuse by loosely coupling components together.  You don't have to inject methods, objects or any dependency anymore.  Use a trait, or pass the function or class to the object.  The old problems are not a big deal anymore.  To get the juice out of Scala, you need to get the Guice out of Scala.

The Java guy seemed extremely disapointed that the Scala team did not appreciate the great value of AOP.  It was likewise, I am sure.


Monday, May 4, 2009

Why I don't like talking to other programmers online

Those who I work with know I don't spend much time online interacting with my fellow programmers.  Sometimes I regret this.  The websites we have today for interaction are vastly superior to the ones we used to have.  The web software itself is better, but the content is also much better.  You have multi-disciplinary coders, working with many languages, and many architectural patterns all sharing one common web forum these days.  Unfortunately, these cats seem to be in a perpetual flame war.

The problem is that most of the heavy users of these sites are beginners.  They ask a lot of questions, because they don't have much knowledge or experience.  Intermediate pros answer these questions.  They give very stereotypical platform-centric, ethnocentric advice.  You get rote Java advice from Java programmers.  You get rote VB advice from Visual Basic programmers.  Same thing goes for all the languages.  These guys do not know or understand each other's approaches.  No VB programmer is particularly honest about, or even aware of the flaws in his game plan.  Same is true for Java programmers, C++ programmers, C# programmers, Python programmers, etc.  Ethnocentrism reigns supreme all over these forums.

Very few of the guys on these forums have more than 10 years of experience.  Most of us stop coding before we reach age 10 as professional coders.  We get kicked up the chain of command.  This is what makes a brilliant guy like Robert C. Martin so amazing.  He has been coding for 39 years.  He just never stopped coding.  This is a deeply experienced polyglot programmer who really knows the answer to the question "Why?" because he has seen the full evolution of software development.  He lived through every movement. 

Recently, Uncle Bob had a smack down with the dudes at StackOverflow.com.  I was rather appalled.  The Stackoverflow gang wrote the site in C# and the Microsoft MVC framework.  Ergo, they are members of my most recent tribe.  I was shocked to see such good members of my tribe speak so ignorantly.

It was pretty clear to me that the very brilliant young entrepreneurs at StackOverflow.com did not use the SOLID techniques Uncle Bob advocates.  It is also clear that they felt threatened by the advent of SOLID, because an acceptance of these techniques would marginalize the StackOverflow.com software itself.  They took Uncle Bob to task for preaching SOLID.  As you listened to these podcasts, forum posts, and blogs, it became clear that the noise coming from the stackoverflow gang was driven of their own personal insecurities about the status and longevity of StackOverflow.com rather than the validity of Uncle Bob's SOLID principles.  They didn't want to talk about SOLID.  They wanted to talk about owning a business.

Uncle Bob knows this.  He did a caper Podcast with Scott Hanselman in which the recapped this smack down.  Although he didn't explicitly say it in this way, Uncle Bob gave me every impression that he knew he was dealing with young and insecure entrepreneurs floating on their very first life-boat on the high-seas of commercial SAS.

Older, veteran, multi-lingual programmers with 14 years of experience and 4 or 5 major languages worth of professional experience have a hard time finding people to talk too.  Programmers are rare.  Veterans are scarce.  Multi-lingual veterans are seldom seen.  I wonder if it is possible to form a club where the scarce 2000+ of us might get together on line.  We would have to restrict membership quite sharply.  No monolingual or mono-platform guys allowed.  If you are Unix only, you are out.  If you are Mac only, you are out.  If you are Windows only, you are out.  If you are C/C++ only, you are out. If you are VB.NET only, you are out.  etc.

If such a forum existed, it would be possible for serious and objective software engineers to discuss the patterns and practices of the various languages and platforms free from the sort of fundamentalism that drives so many in our field.  That would be a wonderful thing.  Can you imagine an objective discourse on the strengths and weakness of software systems?  Could be very beneficial.  

But you just can't discuss the pros and cons of Islam with Osama Bin Laden.  Neither can you discuss the pros and cons of VB.NET with a mono-lingual VB programmer.  Neither can you convince a Java programmer that Microsoft uses its own software to write MSN or Microsoft.com.  They think must be running on Unix because Windows doesn't scale.

The last time I had a "conversation" online, it was with a young Java programmer.  I am sure he would have embarrassed James Gosling.  I was doing a comparison of Java, C# and Scala.  He quickly got belligerent.  He seemed to think I was unfairly putting Java down, by not recognizing it's innate superiority to C# and Scala.  His response was to resort to mocking derisiveness.

The lad didn't seem to know that Java generics aren't real generics.  He didn't seem to know that Java lacks full lexical closures.  He was sure it couldn't be important if Java didn't have it.  He didn't know that closures have been burning topic #1 in Javaland for some 2 years now.  He didn't know what an event is.  He didn't know what a delegate is.  He didn't know what a Scala trait is.  He was quite sure Scala could not replace Java because it could never be as cross-platform as Java! (!!!)  He was very rude & insulting in the process.  Young men like to play king of the hill, and they want to beat you down.

I can recall the bad days of 1994 when I was first doing a bit of professional work on the market.  I was very insecure.  I didn't know if I could make it in life doing this particular line of work.  I didn't know how long it would last.  I did know the other options were worse.  But still, this profession might not be for me.  One thing I knew:  Borland and Pascal were my only life-line.  An attack on these agents was an attack upon my livelihood.  I took any objective criticism as an attempt to sink my ship.

I am sure that the young Java lad was in the same boat.  He is probably working on his first pro assignment.  He knows some Java and nothing else.  Any objective critique of Java is immediately interpreted as an attempt to sink his financial lifeboat.  He must respond vigorously.  Most other members of the tribe feel this way.

Still, you can imagine that a guy like me dislikes dealing with a young guy like that.  He can't discuss the pros and cons of his system.  He just isn't experienced enough.  At this point, he would not be willing to be honest about it.  He really can't hear what you say because fear of financial collapse.

This is the rant of a lonely old programmer who has nobody to talk too.  Many of these points are being refreshed in my mind day by day as I learn Scala.  Many programmers around me, particularly those I work with, have no idea why I would ever want to learn a language like Scala.  They believe I am letting down the Microsoft faction.  

What these young fellows don't know or understand is that you can't get married for life if you are a programmer.  Computer languages are not women.   You do not wed a language or vendor as you would a woman.  Even if you did, languages and vendors die, ergo in death shall you part.  Neither are languages religions.  You do not experience a religious conversion experience and become a programmer of language XYX.  

Wednesday, April 29, 2009

So the reviews for the final cut of Wolverine are starting to roll in

And it sure as fuck isn't pretty.  If you are a studio manager, you are going to have to be upset about reviews like this one.  They are calling it a fiasco.

For those of you stuck under a rock, obsessed with the NFL draft, the Jay Cutler drama, the NCAA Basketball Tournament, or the bad economy, there was another major story in March 2009. It turns out that world media piracy scored it's biggest kill ever.  They jacked an advanced working copy of the new Super Hero blockbuster X-Men Origins: Wolverine.  Of course, this XVID went straight to Bit Torrent, and from there to millions of kids around the world.

The work was unfinished at the time this cut was made.  None of the photo-realistic 3d visual effects (you can expect to see soon) are in the bootleg cut.  Super simple 3d previz graphics are in place.  DOS video game air planes fly across polygon grid sky, etc.  This is hysterical to the typical viewer.  You can also see the wires & cables attached to every character as he or she leaps across the warehouse, office, road, canyon, etc.  Wire removal is one of the most basic and important elements of action film effects these days.

As you may have gathered already, I did see a copy of this film.  Didn't manage to get all the way through it.  Time was pressing.  I needed to get home, and I was board.  The interest wore off rather quickly.  After the novelty of seeing a bad copy one month early wore thin, there was not much reason to watch it.  I refrained from reviewing the bootleg here, as I didn't finish it, and it is quite unfinished.

I wrote to some friends and told them the product was bad.  I did caution them that this work was unfinished, but with such hammy segues between critical plot-points, I couldn't see how this work might be fixed up.  A friend of mine inside the industry cautioned me not to draw any conclusion just yet.  He informed me that there are emergency editors in the world who are paid millions of dollars to fix-up would-be blockbusters teetering on the brink.  With some tweaking, the final cut can be dramatically improved.  He reminded me that the first cut of Star Wars is now a legendary fiasco among film students.  Everything was patched up by D-Day.

I respect this guy, so I heard him out, but I had a hard time believing that such an effort might fix this film.  With such fundamental mistakes in writing and direction, there is only so much magic an emergency editor can weave.

Anyway, the reviews of Wolverine look pretty nasty right now.  A preview was granted to a limited number of friendly critics.  According to Rottentomatoes.com, the number of critics there was just 17.  Right now the count is 9-8.  9 say it is good.  8 say it is bad.  Reading the 9 positive reviews will raise a lot of eyebrows.  When the review is positive, it is not very good.  When it is negative, it is pretty bad.  Based on a reading of these reviews, it would seem that there are some pissed off fanboys, and some lukewarm fanboys.

What will happen when the non-fanboys begin to review this movie?  Right now Wolverine is pulling 53% on the T-Meter, and the strength score.  I would expect that to fall right through the floor as hostile reviewers like Rex Reed begin to check in.  Expect this movie's T-Meter to finish in the 30s.

I have to say, I am most highly displeased.  I am a big fan of comic books.  This is the second bust in a row.  Worse still, this is a movie that should not have been a bust.  It could have and should have been every bit as good as Iron Man or the Incredible Hulk.  Wolverine is not like the Watchmen.  We are not talking about a vastly overrated piece of shit story here.  We're talking about one of the most favored characters in Marvel history.  They also have one of the most favored stars in Hollywood for this one.  What I see here is a missed opportunity for a terrific blockbuster.  Another one goes down the drain.

So, Dave, if you were to put a fine point on it, just what is wrong with this movie?  It is incredibly cliche.  You have a good brother.  You have an evil brother.  The two of them walk through life together, back-to-back until finally one day, the evil brother's evil becomes to terrible, and the good brother parts company with him.  Of course this means war, and the bad brother must have some revenge.  Now the good brother must kill the bad brother.

Folks, Ballywood makes 20 movies like this every single year.  I am not kidding you either.  They litterally make 20 of these movies every single year.  It is an old archetypal story.  This was just too damn similar to other basic stories I have seen.  It wore thin very fast once I identified the anchient pattern of the work.  Everything was utterly predictable.  No surprises here folks.  You knew the end from the begining.  This is why I didn't bother to finish it.