Posts

Showing posts from February, 2009

Doing it wrong, fun with Clojure

Image
I certainly take a liberal approach to programming, some may call it quantity over quality but I like to enjoy everything I do. This may include doing it wrong, but sometimes I like the end result. I am working on a SWT GUI tool and could not figure out a clean way to avoid SWT's illegal thread exceptions. When a user clicked a menu option on the gui, I needed to first take text from an edit box field and then use that data to pass to a long running thread. This is what I ended up with: ;; Define the clojure 'agent', save the state of our search box ( def *search-text-state* (agent nil)) ;; Define an implementation of 'SelectionAdapter/Interface' ;; SelectionAdapter requires one method 'widgetSelected' ;; With display.syncExec, pass an implementation of java.lang.Runnable ;; The thread updates the 'agent' search-text-state text. ;; After we get this text value, then launch another thread 'start-findgrep' ( def findgrep-listener (p

Test Driven Development, BDD and Junit

Here is a question I asked on stackoverflow. The responses are pretty interesting. I don't know if you read the recent post by Joel, but basically he says that you don't need unit testing for every unit or piece of code in your code base. "And that strikes me as being just a little bit too doctrinaire about something that you may not need. Like, the whole idea of agile programming is not to do things before you need them, but to page-fault them in as needed." -- Joel And I would say that most developers don't have full coverage anyway, yet there are some blogs out there touting the 100% code coverage. "Yeah. In fact, if you're making any kind of API, a plug in API, it is very important to separate things into interfaces and be very very contractual, and tightly engineered" -- Joel "Right. The longer I think about this, the less I care about code hygiene issues (laughs). Because the unit of measure that really matters to me is, how quickly you

Cher is a moron, or why I hate group-think hate on other groups

Image
http://cnsnews.com/public/content/article.aspx?RsrcID=43192 Cher is a moron. "You know what? I have so – I try to be charitable and there are some really good Republicans, but I just don’t understand how anyone would want to be a Republican. I just can't figure it. I don’t understand," she said. 'If you’re poor, if you're any kind of minority – gay, black, Latino, anything. If you’re not a rich – I don’t know. If you're not a rich born-again-Christian, I don't get it." I have a comment for you, musicians shouldn't discuss politics. How does that feel? Doesn't make a lot of sense, does it? I feel that there isn't such thing as a "Republican", the same way that I feel there is no such thing as a "black" person or a "white" person. Race is also unscientific and difficult to categorize people. You have genealogy which can be traced from generation to generation, but that doesn't mean anything. For example,

Outline for "Enterprise Development with JVM languages"

I am creating a book, "Enterprise Development with JVM languages" I am an "Enterprise" (I know people don't like that term) developer and about to start a book that deals with JVM languages for use on larger enterprise applications, especially geared towards Web and Database driven systems. I want to cover a lot of the JVM languages that are used today, I don't feel that a book has truly covered these topics. If I am an Enterprise developer and am considering a JVM language, I would want to see how the language compares with other languages, possibly with the Java language. How could this language be used? What are the advantages, disadvantages, etc? I have also noticed that some developers are religious about the programming language they use. I am not partial and just want to find the most productive tool for the job. I want to cover the following languages, I know there are a lot, but a developer may decide to investigate all of them or use a combinat