The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Productivity via Less Code

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Productivity via Less Code Posted: Jun 20, 2009 11:37 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Productivity via Less Code
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

While this is a trivial example, I think it demonstrates something useful in the whole "less is more" arena: If you can write less code, there are just fewer opportunities for bugs. Having said that, note the tongue in cheek nature of the challenge:

The kiloseconds project is a very sophisticated and exquisite, ego-boosting and mind-blowing (albeit perhaps a bit over-engineered) project which aims to provide its audience with the time in kiloseconds, since we cannot live without it.

The Ruby example is nearly as short as the Smalltalk one, but still manages to be a bit more complex. Then there are things like the Java example :)

import java.util.GregorianCalendar;

public class Kiloseconds {

	public static void main(String[] args) {
		
		GregorianCalendar calendar = new GregorianCalendar();
		int hours, minutes, seconds, kiloseconds;
		
		hours = calendar.get(GregorianCalendar.HOUR_OF_DAY);
		minutes = calendar.get(GregorianCalendar.MINUTE);
		seconds = calendar.get(GregorianCalendar.SECOND);
		kiloseconds = (hours*3600 + minutes*60 + seconds) / 1000;
		System.out.println(kiloseconds + "\n");

	}

}

The Smalltalk example?


'It is ', (Time now asSeconds/1000.000) printString, ' kiloseconds'


Trivial yes, but it does make a useful point...

Read: Productivity via Less Code

Topic: Security and the Mac Previous Topic   Next Topic Topic: Getting Closer on Facebook Feed for BottomFeeder

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use