Today I was at yet another seminar, this time at Agical about how UCD combined with Agile methods does work and how it can be beneficial.
It began with Illugi Ljótsson och Eric Idebro describing the "write a big document and throw it over the wall"-problem and that UCD and Agile development methods weren't that far apart if they where only allowed to work together, iteratively.
To allow for this they would have an interaction designer in their scrum. In a 4 week scrum the interaction designer helped with usability and each friday he did user testing to get feedback for the coming week.
I got the impression that this kind of feedback would work and that it would help a great deal to have that kind of expertise at hand during development.
Do we really need a 4 step publication routine with document comparison if all the users really need is a way to get text out on the web quickly?
They also made the point that what the product owner asked for and what the users actually needed where quite some way apart. When using this method you have more material to help guide your decisions on what to build in addition to making the application more user friendly.
Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts
Monday, November 26, 2007
Thursday, November 15, 2007
Andy Hunt: ”How Hard Can it Be?” at Valtech
Today I was at a seminar by Andy Hunt called "How Hard Can It Be?" at Valtech (Stockholm, Sweden).
It was a great and very funny seminar and I recommend anyone that has a chance to go to the next one.
One thing that got to me was the discussion about complexity... that is accidental complexity and essential complexity. One example he used was the way a language like Java could isn't very intuitive for people new to development compared to a language like Ruby due to accidental complexity.
In Java you would need "public static void Main(.... System.out.println(..." for the basic Hello, World example, whereas in Ruby you would type 'puts "Hello, World!"'.
IDE's do us a great disservice in hiding accidental complexity by using macros to autogenerate code that is required by the language, but probably isn't of any value for the task at hand.
The point of it all is that when the domain is complex, we have essential complexity, but we should avoid accidental complexity, extra code that creates noice, making the code less readable without adding any value.
He also hinted on the irony of the waterfall method that it wasn't supposed to be used the way it has and in fact the document describing the method was a example of a flawed, non-working model of development.
Some time ago I found a really nice book that uses this way of avoiding accidental complexity that Ruby does for introducing newcomers to programming, Learn to program (pragmatic bookshelf).
On the way home I listened to a podcast about RoR, the Ruby on Rails Podcast episode featuring Stuart Halloway. I've only listened to one episode so far but it was great :), got me thinking of contributing a bit more to Open Source.
It was a great and very funny seminar and I recommend anyone that has a chance to go to the next one.
One thing that got to me was the discussion about complexity... that is accidental complexity and essential complexity. One example he used was the way a language like Java could isn't very intuitive for people new to development compared to a language like Ruby due to accidental complexity.
In Java you would need "public static void Main(.... System.out.println(..." for the basic Hello, World example, whereas in Ruby you would type 'puts "Hello, World!"'.
IDE's do us a great disservice in hiding accidental complexity by using macros to autogenerate code that is required by the language, but probably isn't of any value for the task at hand.
The point of it all is that when the domain is complex, we have essential complexity, but we should avoid accidental complexity, extra code that creates noice, making the code less readable without adding any value.
He also hinted on the irony of the waterfall method that it wasn't supposed to be used the way it has and in fact the document describing the method was a example of a flawed, non-working model of development.
Some time ago I found a really nice book that uses this way of avoiding accidental complexity that Ruby does for introducing newcomers to programming, Learn to program (pragmatic bookshelf).
On the way home I listened to a podcast about RoR, the Ruby on Rails Podcast episode featuring Stuart Halloway. I've only listened to one episode so far but it was great :), got me thinking of contributing a bit more to Open Source.
Thursday, November 8, 2007
Degrading link_to_remote
I've been learning RubyOnRails and I noticed that the 'link_to_remote' helper didn't degrade gracefully...
Here's the fix I used (Inspired by this blog post).
(in helpers/application_helper.rb)
Just keep in mind that this uses a HTTP GET when javascript is disabled. A HTTP GET should not have side effects. I can't think of a good way to do a HTTP POST from a link (trigger a form-post) without using javascript.
Here's the fix I used (Inspired by this blog post).
(in helpers/application_helper.rb)
def link_to_remote(name, options = {}, html_options = {})
unless html_options[:href]
html_options[:href] = url_for(options[:url])
end
link_to_function(name, remote_function(options),
html_options)
end
Just keep in mind that this uses a HTTP GET when javascript is disabled. A HTTP GET should not have side effects. I can't think of a good way to do a HTTP POST from a link (trigger a form-post) without using javascript.
Labels:
code,
frameworks,
Javascript,
learning,
Ruby,
RubyOnRails,
Web
Tuesday, September 25, 2007
Dojo at Agical
Yesterday I was at a dojo at Agical in Stockholm.
The idea of a dojo is to as a group drive out the design of a piece of code using TDD. The goal is to practice TDD outside of real live projects.
We used a method called randori that meant that we worked on the code as a pair, describing to everyone what we did and switching out one of us every now and then. It was a trilling experience to say the least, if only too short! I'm definitely going to go to more of these dojo's :)
When we where done we got into discussing the differences between BDD and TDD. What does it really mean to drive your development based on behavior?
The sense I got from it was to not let the testing run away with you. To focus on the real behaviour. What is the point of creating tests for code that define a behavior that you don't have any story for? Excessive error handling can be a suspect in this category.
Aside from that I also got some repetition on the TDD cycle: Red, Green and Refactor. Focus on passing the test, save all refactoring for when it's green. To get ahead of yourself is like premature optimization, tempting but probably not a good idea...
The discussion then continued into whether Code Coverage is a good metric from a BDD perspective. When doing BDD/TDD the number will be high, but it will not tell you if you implemented functionality that was really required or not. You're goal is to solve the problem at hand, not achieving full coverage.
But there are uses for it, one opinion where that the coverage serve as well needed positive feedback for the developers, another that it can be a great tool for finding uncovered code that ought to be run by a test.
I wish that I'd had the time to stay after the dojo, but it was late and I had an early morning :(. It's not often that you get the chance to meet people that actually know their way around these concepts in real life!
The idea of a dojo is to as a group drive out the design of a piece of code using TDD. The goal is to practice TDD outside of real live projects.
We used a method called randori that meant that we worked on the code as a pair, describing to everyone what we did and switching out one of us every now and then. It was a trilling experience to say the least, if only too short! I'm definitely going to go to more of these dojo's :)
When we where done we got into discussing the differences between BDD and TDD. What does it really mean to drive your development based on behavior?
The sense I got from it was to not let the testing run away with you. To focus on the real behaviour. What is the point of creating tests for code that define a behavior that you don't have any story for? Excessive error handling can be a suspect in this category.
Aside from that I also got some repetition on the TDD cycle: Red, Green and Refactor. Focus on passing the test, save all refactoring for when it's green. To get ahead of yourself is like premature optimization, tempting but probably not a good idea...
The discussion then continued into whether Code Coverage is a good metric from a BDD perspective. When doing BDD/TDD the number will be high, but it will not tell you if you implemented functionality that was really required or not. You're goal is to solve the problem at hand, not achieving full coverage.
But there are uses for it, one opinion where that the coverage serve as well needed positive feedback for the developers, another that it can be a great tool for finding uncovered code that ought to be run by a test.
I wish that I'd had the time to stay after the dojo, but it was late and I had an early morning :(. It's not often that you get the chance to meet people that actually know their way around these concepts in real life!
Saturday, April 21, 2007
Validation logic, security and the web
I just read a blog post by Rocky Lhotka where he discusses where to put the validation logic. This interests me quite a bit because it's one of those caveats I've found around ASP.NET and web development in general.
The problem with validation in a web environment
In web projects you often want validation to take place on the client (to reduce the number of post backs and give a better user experience), but it's not an environment you can trust.
How not to do validation
For obvious reasons, as stated above, you should not exclusively put validation on the client.
One way of solving it
I would agree with Rocky Lhotka that you should put validation in the business layer to begin with, and then duplicate that to the frontend to give the user a better experience. The main point here is that the business layer will be the deciding factor what gets though no matter if the UI validation isn't working as it's intended to.
Preparing for the future
Another important point Rocky touches on is that the UI is more frequently replaced than the business layer code, which gives some value to having the validation there no matter if it's implemented in the UI.
Security
One good rule I've come across is that you should treat everything coming from the user as potentially dangerous, and even better, do the same for anything that comes from the database. With this in mind, putting at least the critical validation in the business layer seems like a good idea.
Patterns and practices?
I'm looking into ways of building robust applications by using the MVP pattern (supervising controller) and TDD. I'll probably write more about that when I've gotten a bit more experience on the subject.
The problem with validation in a web environment
In web projects you often want validation to take place on the client (to reduce the number of post backs and give a better user experience), but it's not an environment you can trust.
How not to do validation
For obvious reasons, as stated above, you should not exclusively put validation on the client.
One way of solving it
I would agree with Rocky Lhotka that you should put validation in the business layer to begin with, and then duplicate that to the frontend to give the user a better experience. The main point here is that the business layer will be the deciding factor what gets though no matter if the UI validation isn't working as it's intended to.
Preparing for the future
Another important point Rocky touches on is that the UI is more frequently replaced than the business layer code, which gives some value to having the validation there no matter if it's implemented in the UI.
Security
One good rule I've come across is that you should treat everything coming from the user as potentially dangerous, and even better, do the same for anything that comes from the database. With this in mind, putting at least the critical validation in the business layer seems like a good idea.
Patterns and practices?
I'm looking into ways of building robust applications by using the MVP pattern (supervising controller) and TDD. I'll probably write more about that when I've gotten a bit more experience on the subject.
Thursday, April 5, 2007
Weeks of .NET
This last month have been spent coding in .NET (mostly VB.NET) at my full time practice at Avancit AB. I thought I would share a few things I've come across in the projects I've been working on during that time.
T-SQL
I had a problem where I needed to get all mail addresses of all groups in a company except those in the current group. This was solved by the SP shown below:
BCP versus SqlBulkCopy
Another problem was where we had an application that needed to push tables from a client to a server effectively. The current version at the time used BCP which was run from a batch process and sometimes (but very rarely) failed.
I started to look around and I found that people where replacing BCP with SQLBulkLoad. I suggested we'd try it and we successfully implemented the transfer using it. As the whole process now took place inside the .NET application it was simple to setup a better error handling than was possible with BCP.
Macros
As for productivity, I've started to look into using macros in VS2005. The first macro I installed was one that reversed assignments. I know there are tools that do this, I think ReSharper has this ability, but I don't have it yet so a macro works just as good. You can find this macro at: http://www.codeproject.com/useritems/macroswapassignments.asp
DNR
Anyone still not listening to DotNetRocks are missing some great stuff. As I'm on a train or a bus for 3 hours a day I've listened to quite a few episodes in the last few weeks (1 to 40). Even the early episodes are great, they give a good insight into why things are the way they are and what is new in .NET 2.0 (as I started with 2.0, I don't have much of a reference as to the differences compared to 1.1).
TDD
Next week we're starting a project that will use TDD (Test Driven Development) for the first time within Avancit. It will be lots of fun and I'll probably write how that goes here later.
T-SQL
I had a problem where I needed to get all mail addresses of all groups in a company except those in the current group. This was solved by the SP shown below:
ALTER PROCEDURE [dbo].[sp_GetMailAddressesByCompany]
(
@intCompID INT,
@excludeGroupID INT
)
AS
BEGIN
— Get all addresses in company that are NOT in the excluded group
SELECT addr.* FROM tblMailAddresses addr
INNER JOIN tblMailGroupsToAddresses con
ON con.intMailAddressID = addr.intMailAddressID
WHERE addr.intCompID = @intCompID
AND addr.intMailAddressID NOT IN
(
— Get all addresses in the excluded group
SELECT addr.intMailAddressID FROM tblMailAddresses addr
JOIN tblMailGroupsToAddresses con
ON con.intMailAddressID = addr.intMailAddressID
WHERE con.intMailGroupID = @excludeGroupID
)
END
BCP versus SqlBulkCopy
Another problem was where we had an application that needed to push tables from a client to a server effectively. The current version at the time used BCP which was run from a batch process and sometimes (but very rarely) failed.
I started to look around and I found that people where replacing BCP with SQLBulkLoad. I suggested we'd try it and we successfully implemented the transfer using it. As the whole process now took place inside the .NET application it was simple to setup a better error handling than was possible with BCP.
Macros
As for productivity, I've started to look into using macros in VS2005. The first macro I installed was one that reversed assignments. I know there are tools that do this, I think ReSharper has this ability, but I don't have it yet so a macro works just as good. You can find this macro at: http://www.codeproject.com/useritems/macroswapassignments.asp
DNR
Anyone still not listening to DotNetRocks are missing some great stuff. As I'm on a train or a bus for 3 hours a day I've listened to quite a few episodes in the last few weeks (1 to 40). Even the early episodes are great, they give a good insight into why things are the way they are and what is new in .NET 2.0 (as I started with 2.0, I don't have much of a reference as to the differences compared to 1.1).
TDD
Next week we're starting a project that will use TDD (Test Driven Development) for the first time within Avancit. It will be lots of fun and I'll probably write how that goes here later.
Wednesday, February 28, 2007
As a student...
As a student I've got a problem... there is just so much information out there.
You know when you have a fair bit of knowledge about a topic but there are several big gaps missing? I've encountered this while I worked on a CakePHP site where I often had to search in the documentation as I couldn't get myself to read the entire thing to begin with.
To solve this I started up a new tiddler in my TiddlyWiki where I wrote down the sections in the manual. Then I began skimming though the manual and noted every potentially useful bit of information. There is nothing incredibly new about this study technique, but it works for me. This approach of course requires that you have a project in mind.
What I really would like is some way to attach little notes to places in texts and podcasts, and have them indexed, labeled and searchable. Maybe there is such a thing, a Firefox plugin perhaps?
On a side note I've been working on a few projects, including a CakePHP site and a couple of ASP.NET/C#/VB.NET sites. Also been using my TiddlyWiki a lot, it has even replaced the need for FreeMind to some degree as it is searchable, indexable, has labels and can take really long and formatted texts :)
You know when you have a fair bit of knowledge about a topic but there are several big gaps missing? I've encountered this while I worked on a CakePHP site where I often had to search in the documentation as I couldn't get myself to read the entire thing to begin with.
To solve this I started up a new tiddler in my TiddlyWiki where I wrote down the sections in the manual. Then I began skimming though the manual and noted every potentially useful bit of information. There is nothing incredibly new about this study technique, but it works for me. This approach of course requires that you have a project in mind.
What I really would like is some way to attach little notes to places in texts and podcasts, and have them indexed, labeled and searchable. Maybe there is such a thing, a Firefox plugin perhaps?
On a side note I've been working on a few projects, including a CakePHP site and a couple of ASP.NET/C#/VB.NET sites. Also been using my TiddlyWiki a lot, it has even replaced the need for FreeMind to some degree as it is searchable, indexable, has labels and can take really long and formatted texts :)
Subscribe to:
Posts (Atom)