Making the ugly elegant one day at a time
|
My Stuff Front Page Presentations Projects Music Favorite Quotes Dynamic Language User's Group Love Michelle Buxton Respect Vincent Foley-Bourgon Sam Griffith LeRoy Mattingly Colin Putney Matt Secoske Sam Tesla Andres Valloud Admiration Leo Brodie Avi Bryant Alan Cooper Steve Dekorte Stephane Ducasse Doug Engelbart Eric Evans Brian Foote Martin Fowler Paul Graham Dan Ingalls Alan Kay John McCarthy Steve McConnell Peter Norvig Niall Ross Randall Smith Gerald Jay Sussman David Ungar Rebecca Wirfs-Brock ...And So Many More... My Amps Squeak JavaScript Scheme Java Corman Lisp Ruby Dolphin Smalltalk Cincom Smalltalk Self Archives 05/01/2003 - 06/01/2003 06/01/2003 - 07/01/2003 07/01/2003 - 08/01/2003 08/01/2003 - 09/01/2003 09/01/2003 - 10/01/2003 10/01/2003 - 11/01/2003 11/01/2003 - 12/01/2003 12/01/2003 - 01/01/2004 01/01/2004 - 02/01/2004 02/01/2004 - 03/01/2004 03/01/2004 - 04/01/2004 04/01/2004 - 05/01/2004 05/01/2004 - 06/01/2004 06/01/2004 - 07/01/2004 07/01/2004 - 08/01/2004 08/01/2004 - 09/01/2004 09/01/2004 - 10/01/2004 10/01/2004 - 11/01/2004 11/01/2004 - 12/01/2004 12/01/2004 - 01/01/2005 01/01/2005 - 02/01/2005 02/01/2005 - 03/01/2005 03/01/2005 - 04/01/2005 04/01/2005 - 05/01/2005 05/01/2005 - 06/01/2005 06/01/2005 - 07/01/2005 07/01/2005 - 08/01/2005 08/01/2005 - 09/01/2005 09/01/2005 - 10/01/2005 10/01/2005 - 11/01/2005 11/01/2005 - 12/01/2005 12/01/2005 - 01/01/2006 01/01/2006 - 02/01/2006 02/01/2006 - 03/01/2006 03/01/2006 - 04/01/2006 04/01/2006 - 05/01/2006 05/01/2006 - 06/01/2006 06/01/2006 - 07/01/2006 07/01/2006 - 08/01/2006 08/01/2006 - 09/01/2006 09/01/2006 - 10/01/2006 10/01/2006 - 11/01/2006 11/01/2006 - 12/01/2006 12/01/2006 - 01/01/2007 01/01/2007 - 02/01/2007 02/01/2007 - 03/01/2007 03/01/2007 - 04/01/2007 04/01/2007 - 05/01/2007 05/01/2007 - 06/01/2007 06/01/2007 - 07/01/2007 07/01/2007 - 08/01/2007 08/01/2007 - 09/01/2007 09/01/2007 - 10/01/2007 10/01/2007 - 11/01/2007 11/01/2007 - 12/01/2007 12/01/2007 - 01/01/2008 01/01/2008 - 02/01/2008 02/01/2008 - 03/01/2008 03/01/2008 - 04/01/2008 04/01/2008 - 05/01/2008 05/01/2008 - 06/01/2008 06/01/2008 - 07/01/2008 Feed ![]()
|
Wednesday, November 29, 2006To Closure or Not
First, read this before continuing.
Both of the extreme cases seem comical. One takes the position of nothing but objects and the other nothing but blocks. It seems that pure object-oriented programming is at odds with functional programming. But, it's not. They need each other. I think Smalltalk and Ruby strike a good balance in this area. Blocks are used as lightweight objects (ala syntactically cheap) where a full object definition would be cumbersome. But, having nothing but blocks would also be problematic. For bigger things, we use full objects. It's the balance of having both that allows us to choose the one that allows us to more succinctly express our solution. I don't know why people argue these things. There are problems that are better expressed in objects and others in closures (blocks). Why do I have to choose one over the other? I want both! There's also a lot that object-oriented programmers can learn from functional programmers and visa-versa. In fact, I'm always shocked how much functional programming is in pure object-oriented languages like Smalltalk and Ruby. I'm going to go message something. Tuesday, November 28, 2006Notes From One of Alan Kay's Talks
Notes from Alan Kay's talk at O'Reilly Emerging Technology Conference 2003. Now, I was searching for something else and came across this. The interesting bit is the exchanges of emails between L. Peter Deutsch and Alan Kay.
"interactive LISP -- a metainvention, the Maxwell's Equations of programming. Today is the 40th aniversary of the first interactive implementation by a 16-year-old Peter Deutsch. It was the first time a programming language became an operating system." WOW! Really, that's all I can say. Peter does correct the above quote. But, I'll leave that to you to discover. Makes me wish I would have asked more questions when I met Peter at Camp Smalltalk. Darn it! CommentsPrefactoring Hate
I was shocked to find developers appalled by Ken Pugh's "Prefactoring" book. In both cases, it's amazing how much they missed the whole point behind the book by focusing on exact definitions. I think it's an excellent book on design and who couldn't use another of those? It seems to me that the XP zealots are the only ones that have a problem with it (look at the comments at Amazon). I remember the Amazon comments when the book came out, but I just ran across the above blog entries. Oh well, each to his own and if you're curious, Read this article by Ken Pugh for more on "Prefactoring". I strongly suggest you read the book. There's too much good advice in there to be ignored. The discussions on abstract data types and collections are awesome.
CommentsFriday, November 24, 2006After A Rough Day, This Made Me Laugh.
I was browsing the net and found this....
![]() I don't why, but it made me chuckle. It cheered me up a little from a very dark day. CommentsThursday, November 23, 2006About Time
The glorious end to text-based command line environments is around the corner:
Commands are not Text-based This was taken from the documentation for Microsoft's PowerShell. All I can say is: FINALLY! Tools like grep have their place, but man, working with objects is so much nicer. I just started to look into this, but I'm liking it thus far. I've been waiting forever for a command line environment that dealt with objects instead of dumb old text. Comments
Wednesday, November 22, 2006Compile Time Reflection
I want compile time reflection in Java. They came close with giving me this:
Class someClass=MyObject.class But, I wish it went further. If you're going to make me go through the pain of verifying everything at compile-time, then make my life easier for example: try {Right now, if I mis-typed "doSomethingCool" then it wouldn't get caught until run-time.Now, we don't want to make the baby Gosling cry, do we? How about this: Method method=MyObject.class.doSomethingCool(AnotherObject,String); For one, it's more succint and no need for any try/catch blocks because the compiler did all of the work. Another nice side effect is that you can check regular visibility constraints (if I call the above in MyObject and doSomethingCool is private, then all is good. Otherwise, don't allow it if outside of MyObject). Now, I don't have to set the setAccessible() method on Method and no security check. Now, of course, you can also use this for fields as well. In fact, it's simpler. Now, I ask since they gave us ".class", why didn't they finish the job? Java reflection has always seemed half way there to me. Just don't get me started on JavaBeans (where are the collections?). Comments
Beauty. Remember that word.
Cool story about Lisp from Conscientious Software by Richard Gabriel:
In 1958, John McCarthy was thinking about a symbolic differentiation program in a programming language that was later to become Lisp. He was concerned about the “erasure problem”: no-longer-needed list structure needs to be recycled for future use. In subsequent languages, such problems were handled either by the structure of the program being restricted to trees (stack allocation of data and its trivially automatic deallocation through stack popping) or by explicit allocation and deallocation (malloc/free). His comment on erasure / explicit deallocation: What are you waiting for read the whole thing. It's awesome and will make you think about how we can write better software. The garbage collection story put a smile on my face. "Beauty. Remember that word." I couldn't have said it better. We should always strive for beauty in our designs. CommentsI Am Object
One thing that many Java developers that I work with think is weird is that I speak in first-person for my objects. For example:
"I should calculate the total when given a new line item" "...that is not my responsibility..." I act like I am the object. It's so natural to me that I don't even think about it. Now, this is very common when designing with other Smalltalkers as well. Are we the only ones that do this? And if so why? Is it because we are behavior-ists (ala Wirfs-Brock) and not data-ists? I don't know, but I think it's funny and it's what makes being a Smalltalker a joy. Comments
Fate Is Weird
I said good-bye to Smalltalk earlier this year for what I thought was the last time. Now, by good-bye, I mean no longer working full-time in it. Did you really think that I could ever *NOT DO* Smalltalk? Anyway, I had relegated myself to Java-land with possible probation to Javascriptville or Rubypolis.
Well, I am pleased to announce that I will be returning (once again) to the land of messages and freedom. I can't wait to start. I will be working with some scary smart folks and doing outrageously cool feats of programming acrobatics. And it can only be done in Smalltalk. How lovely. The railroad was awesome in retrospect and I had a blast. It was short-lived and I wish I could have stayed longer because I was just getting some steam on my project. Oh well, this new opportunity was just too good to pass up. The railroad has some cool aspects that I never thought about and the shipping industry is an interesting domain. ROCK! Pass the messages and hold the data. I'm back to writing elegant code unhampered by a stuffy old compiler! CommentsTuesday, November 21, 2006Why Lisp Has The Parentheses
I finally figured it out. It's so that you keep things small. When you have too many paranthesises, you're doing too much in your function. Small is elegant. And that is why Lisp makes you a better programmer in my mind. Of course, figuring out the Y combinator (recursive functions without names) from "The Little Schemer", macros (programs writing programs) from "Advanced Lisp", and all of "Structure and Interpretation of Computer Programs" help you make you great as well.
CommentsNull: The Runtime Error Generator
I never for the life of me want to hear another argument about how static typing catches errors at compile. I really don't. It drives me crazy! When you have to cast arguments to get them to the right thing in generic situations, it's frustrating. But, that's not the biggest sin. After writing the following line for the uptenth time:
if (something != null) {You know what I mean. It's inevitable in legacy java applications. Now, I generally only do null checks on my inputs and avoid null conditions at all cost. But, the other day it got me thinking: Null gets around all static type checking at compile time. It's not a real type. It can be ANYTHING. At compile time, it slips under the radar because it only exists at runtime. So, what is my typing system doing for me? I find NullPointerExceptions tend do great damage on lazy (bad, whatever you want to call it) code. And let's face it, we've all had those days where we weren't exactly on the ball. NullPointerExceptions are sitting there to wake us up. I really don't mind static typing. But, let's not kid ourselves. Allowing nulls throws out the safety of the compiler catching our dumb mistakes because most of mine are of the null variety (the dumb ones that is). Of course, we could just reference everything by their interface and do the Null Object pattern and be smart about messages to ignore and which ones to worry about. But, it's a lot of typing without much gain. Now, you might be saying to me, "But, Blaine, you imbecile! Don't you have nulls in Smalltalk, Ruby, and Lisp?" Yes, we do and it's called nil. But, we don't pretend to catch all of our dumb mistakes up front. And our nil is an ordinary object which we can add messages to. Nil, our null, is a little bit more powerful. Does it still sting when we make a programming mistake? You bet it does. Enough on that, just don't get me started on primitive arrays in java. They are even sneakier and there's a plethora of stuff that the compiler doesn't catch. Till next rant, keep your objects small and your messages plenty. AMEN! CommentsSunday, November 05, 2006Worst Web Site Ever?
Could this be the worst website? Probably not, but I'm sure it could be in the running...This is the site of one of the independents running for governor of Nebraska. Embarrassing. Not only is it annoying to read, it says absolutely nothing about the "issues" except ones that everyone can agree on. It even comes complete with an inappropriate cartoon. I expect republicans and democrats not to address issues, but I expect more from independents. Needless to say, he didn't get my vote. But, it's funny to look at his site. It's truly bad.
Comments
Wednesday, November 01, 2006Happy Belated Halloween
We carved pumpkins this halloween. My wife did the scariest spider you have ever seen. Check it out!
![]() ![]() How cool is that? So, you might guess what I might have done. I was thinking carving either Alice Cooper or this: ![]() ![]() And of course, my wife, Michelle had to quickly take a snapshot of me in all of my techy glory. ![]() Now, I must ask the question, am I knight now or what? I even used Squeak to edit the pictures. By the way, I used Melissa Winger's "Powered By Smalltalk" logo. Thanks! It was a blast to carve! Comments |
My Weekly Top 20 Artists |
Comments
(The link appears to be gone; Something weird going on with the UIUC Wiki).
Vassili's response was a seminal piece of work.
Some of the "get rid of blocks" effort came from Objective-C. The Objective-C guys never got around to adding anything block like. And one of the things that's interesting, is the patterns and techniques that have evolved to make up for the lack of blocks. One is the "higher order messaging" work that Marcel Weiher has done, which Michaell Lucas Smith later replicated in Smalltalk. To be sure, it's just better/easier to have blocks. But there's some interesting stuff that actually comes from the "how would we do it without blocks" approach.
Ruby blocks aren't as blocky as Smalltalk blocks either. :)
By
kerrin, at 11:34 AM
Above comment from Travis Griggs, who is Kerrin's husband. :) I hate these "register to comment" blogthings.
By
kerrin, at 11:35 AM