Archive for the ‘Programming’ Category

Architecting for scalability and audit logs by explicitly modeling state transitions

Saturday, July 18th, 2009

In his talk, Unsleash Your Domain, Greg Young presents a dense discussion of topics about which I am passionate.  At its core, the talk is about how to guarantee a correct audit log and architect for scalability. Before watching this talk, I suggest brushing up on the following terms if you're ...

Clean Code

Monday, July 13th, 2009

The Clean Code Talks concentrating on writing testable code. In his talk, Unit Testing, Miško Hevery explains unit testing and makes a case for unit tests. [youtube]http://www.youtube.com/watch?v=wEhu57pih5w[/youtube] ... In his talk, Don't look for things, Miško Hevery provides a practical guide to the Principle of Least Knowledge (aka Law of Demeter, aka Don't Ask, ...

Processing in batches and improving maintainability

Saturday, June 28th, 2008

Here's a common pattern: void process(final List foos) { final ArrayList batch = new ArrayList(batchSize); for (final Foo foo : foos) { if (isValid(foo)) { final Bar ...

Authoring Iterators Using Google’s Collections Library

Monday, June 23rd, 2008

Let's implement an iterator. /** * Removes duplicates from the elements returned by provided iterator. * The provided iterator must return the elements in the order elements in the order defined by the comparator. * The first element of a series of duplicates is returned by this iterator. * @param ...

Parleys.com

Saturday, April 5th, 2008

Parleys.com publishes talks from software conferences.  I like seeing high-quality slides alongside video of the speaker.  Paryleys' podcast is an audio only version of the talks you can watch on their site. Two of my favorite talks are: Flow of Change which discusses managing change in source control systems Speaker: Tony Smith, ...

Creative use of closures in testing.

Sunday, October 14th, 2007

Having moved to Java, I do miss closures. xUnit.net has a creative use of closures in their unit testing framework: [Test] public void DivideByZeroThrowsException() {   Assert.Throws(   delegate   {   DivideNumbers(5, 0);   }); } This code snippet was taken from xUnit.net's documentation. Previously, each test method could ...

Phishing and other scams.

Sunday, October 14th, 2007

I always find these security talks entertaining. In his talk, Searching for Evil, Professor Ross Anderson discusses research done by himself, Dr. Richard Clayton, Tyler Moore, Steven Murdoch, and Shishir Nagaraja. [googlevideo]http://video.google.com/videoplay?docid=-1380463341028815296[/googlevideo] Related links: Security Engineering: A Guide to Building Dependable Distributed Systems by Ross J. Anderson - book on Amazon

Design by Contract

Sunday, October 14th, 2007

I would like to see design by contract become mainstream. JSR-305, Annotations for Software Defect Detection, is a step in the right direction. The applicability of this standard is broader than the name suggests. Here's a talk about the JSR by Bill Pugh: [googlevideo]http://video.google.com/videoplay?docid=-1531727105949862857[/googlevideo] I would like to see ...

Favorite JavaOne Videos

Tuesday, September 25th, 2007

I've moved over to Java. Here are my favorite sessions from JavaOne. Videos require free registration. You only need to register once for all the videos. Language: Languag-Oriented Programming and Language Workbenches Scala is a functional and object-ortiented language that runs on the JVM, it's similar to F# (F sharp) Closures for Java Fast x86 ...

Automated Testing – Model-Based Testing

Saturday, September 22nd, 2007

In his talk, Model-Based Testing: Black or White?, Mark Utting discusses the difference between black-box and white-box models and their affect on the ability to automate testing. [googlevideo]http://video.google.com/videoplay?docid=5521890509476590796[/googlevideo] Related links: Practical Model-Based Testing: A Tools Approach by Mark Utting and Bruno Legeard - book on Amazon

Closures for Java

Monday, August 6th, 2007

In his talk, Closures for Java, Neal Gafter provides a description of and an argument for closures in Java. [googlevideo]http://video.google.com/videoplay?docid=4051253555018153503[/googlevideo]

Functional list processing with anonymous delegates

Monday, December 18th, 2006

Derrick Coetzee has an article about functional list processing with anonymous delegates. Keep code close to where it's used.

Using @ infront of literal strings

Thursday, June 15th, 2006

Using @ infront of literal strings lets you do: instead of: "C:\\directory\\file.xml" or "SELECT field FROM table where field=var" you can do: @"C:\directory\file.xml" and @"SELECT field FROM table WHERE field = var"

FTP with streams in .net c# vb.net

Friday, June 9th, 2006

There needs to be a good opensource ftp library for .net.  I want to be able to write to the FTP stream, not pass a byte array or even a pointer to a file.  Why can't I get a Stream Upload(string filename) closing the stream would just end the file upload, not ...

Screen scraping poker web sites

Friday, June 9th, 2006

Screen scraping is very brittle. It will require continual maintenance and will never be complete. A good screen scraper is like writing a parser. Extracting semantic meaning from text with a poor signal to noise ratio is non-trivial. Ideally, you would access the data via an API or ...

Faster first byte.

Monday, February 20th, 2006

override render(HtmlWriter) HtmlWriter.Flush DoSomeExpensiveOperation // or join with a thread that's loading state base.Render(HtmlWriter) This way, you can send the headers and navigation to the client so they'll see something while you're waiting for something to finish. Perhaps the client won't even finish downloading the headers when the render completes, you've gotten the first ...

Should you be persisting more state?

Monday, February 20th, 2006

Lost state is state that has been destroyed, deleted, garbage collected or otherwise removed from storage not because of some domain specified reason.  In the best case because of limited storage capabilities, but because the value of the state is underestimated. Microsoft Word has autosave.  By default, every ten minutes the ...