| A love letter to ASP.NET | Posted on Tuesday, February 05, 2008 at 4:23 AM | Dear oh so wonderful ASP.NET,
I know that we programmers are far, far more stupid than your code generator. Clearly, if I write:
<form action="BoardEdit.aspx" method="post" runat="server">
Then actually you might as well assume I'd written:
<form method="post" runat="server">
And left you to figure out what the form action should be, because you can do that perfectly every time, fully accounting for the URL re-writing. If I suggest something different, clearly I would never have a good reason for doing this (for example, in the case that you've got no damm clue how to respect URL re-writing rules, but oh no, that would NEVER happen, would it? Oh, wait...).
Love (the thought of punching) you loads,
Jonathan |
| A wish for C# 4.0 | Posted on Monday, February 04, 2008 at 8:25 AM | OK, OK, so C# 3.0 is only just out of the door. As anyone who has been reading my stuff for a while will have realized, I like what they've done with the language. Here at PH, we have now fully migrated all our solutions to Visual Studio 2008, and can now use C# 3.0 language and .Net 3.5 framework features everywhere they're useful. This makes me happy (though some annoying issues migrating to Web Deployment Projects 2008 decidedly aren't making me happy).
I haven't thought long and hard about what I'd really like in C# 4.0. I think I need C# 3.0 to settle in a bit more. I've used it quite a bit, but it takes a while to fully realize the power of all that is there, and I certainly don't want to start suggesting additions to the language when there is already a perfectly good solution to that problem.
Read More |
| Inside PH: Final Builder | Posted on Thursday, January 10, 2008 at 1:41 PM | Before now I've talked about our use of the Subversion version control system and Visual Studio.Net 2008. These are two of the most important tools we all use in our day-to-day operations. Today I am going to talk about another one that saves us a lot of time and potential mistakes: Final Builder.
Programmer's Heaven is a large site. To keep the code base modular, we break it up into many libraries. Some of these libraries provide primitives that we use all over the place. On top of this bottom "layer" are another set of modules that relate to specific features. For example, we have the wiki engine, the forum, the blog engine and so on. Finally, there is the web project for the site itself.
Read More |
| Upgrading from Vista to XP | Posted on Monday, December 17, 2007 at 1:57 AM | For a light start to the week, I was amused by this parody review of Windows XP, written as if it was the successor to Vista. It certainly captures a lot of the reasons why I'm still on XP and have no plans to downgrade. Uh. Upgrade.  |
| I hate "== true" | Posted on Thursday, December 13, 2007 at 9:19 AM | If you've asked someone to look for something you left at their house, would you say, "give me a call if it's true that you found it"? No, you'd say "give me a call if you found it". So why do so many people write things like:
if (found == true)
Instead of the shorter, clearer, equivalent:
if (found)
Yes, I know, I shouldn't let refactoring get me so cranky.  |
| Inside PH: C# 3.0 and Linq | Posted on Monday, December 10, 2007 at 6:01 AM | This morning I started working on a new library for a new feature we'll be rolling out in the not too distant future. It is the first production code that we're developing at PH using Visual Studio 2008, which brings us C# 3.0 and Linq.
Just one morning into it, it already feels like a vast improvement. It took all of ten minutes to get the DLinq classes generated in Visual Studio; it would have taken under five if it hadn't been my first time doing it and working it out as I went. Then they were ready to use, which was also trivial. No more writing SQL or stored procedures or calling methods on a data reader to get the data out: just instantiate the DataContext (which represents the database), write the query, and it's done.
Read More |
| When C# bites | Posted on Wednesday, November 28, 2007 at 6:25 AM | So I wanted to do:
private TTo Identity<TFrom,TTo>(TFrom I)
{
return (TTo)I;
}
Well, actually I didn't. I wanted C# to be smart enough to realize that if S is a subtype of T then List<S> can safely be assumed to be a subtype of List<T>. But anyway, that's not the case, and you have to call ConvertAll on the List to get it to be a List<T> rather than a List<S>. Joy. Anyway, turns out the above fails to compile. Thankfully, this works:
private TTo Identity<TFrom,TTo>(TFrom I)
{
return (TTo)(object)I;
}
But, argh. |
| Splitting CSV with regex | Posted on Wednesday, November 21, 2007 at 6:01 AM | I answered a question on the Perl forum today about splitting CSV. CSV is a comma separated format; for example:
blah,blah,blah
You can put values in quotes:
blah,"blah blah",blah
And those quotes make commas within them meaningless too:
blah,"blah,blah,blah",blah
If we do the naive thing and implement it using split on a comma:
my @fields = split(/,/, $string);
Then we will obviously get the Wrong Answer. The question was, is there a regex we can use with split that will do the Right Thing? And the answer was yes, though it took me a few minutes to come up with it. The thing is that we don't want to match anything more than the commas we are splitting on, but we do need to do some analysis on the string that is up ahead (or behind us) to detect if the comma we are seeing is in quotes.
Read More |
| Perl 5.10 Coming Soon! | Posted on Monday, November 19, 2007 at 10:40 AM | I've spent the last few days at the French Perl Workshop. As well as my brand new talk, I gave two re-runs of two that I had given before. One was entirely new to the French audience, and the other one was from quite a while back and given a face lift so it seemed new (in fact, it was the first talk I ever gave to the Perl community; it was on the topic of web security, and from the web code I encounter it is no less relevant today than it was then). That was 100 minutes worth of talks, which was a pleasure thanks to a great audience.
Read More |
| Inside PH: Now we're using Subversion | Posted on Monday, November 12, 2007 at 5:04 AM | I'm now working as lead developer at Programmer's Heaven. Every so often, I'll be bringing you a little look inside, sharing some of the tools and techniques that we use to build and run the site.
Last week I completed migrating the Programmer's Heaven source tree to the Subversion version control system. Before I arrived, we were using a commercial offering, which I won't name here. I tried to give it plenty of chances to work well, and was patient when I heard a new version was coming out. However, the new version introduced new problems more than resolving the old ones, and I could never track down a pattern to the most serious issue, which led to broken builds a couple of times. It was frustrating knowing there were better tools out there; I had worked with Subversion on numerous projects before and knew that it was simple and Just Worked most of the time. It has its quirks, but nothing as close to annoying as what we were using.
Read More |
| Catch Me At Conferences! | Posted on Monday, October 22, 2007 at 7:05 AM | I've got a brand new talk in the works, which I will be delivering at both the French Perl Workshiop (Lyon, 16th-17th November) and the Israeli Perl Workshiop (Tel Aviv, 31st December). I will be talking on the topic of parallelism - why we need to do it, how (not) to screw it up, what Perl 6 will bring to the table and some of the latest research for future ideas, including lock-free data structures. I hope to announce more European dates for the talk over the coming months, subject to it being accepted at more conferences. |
| Are Internal DSLs Really Just Well Designed APIs? | Posted on Wednesday, October 03, 2007 at 9:19 AM | Well, I figured I may as well make the first post in my PH blog vaguely controversial. If the title's not enough for you, then let me go on to suggest that the Bible has some useful advice in it for those of us trying to decode the continual stream of acronyms that the computing industry likes to throw at us.
"What has been will be again,
what has been done will be done again;
there is nothing new under the sun."
-- Ecclesiastes 1:9
One of the things that amuses me most about the computing industry is how we seem to keep getting shiny new names for the same old technologies, perhaps just applied in a different problem domain or using a different language.
Read More |
|
Subscribe
RSS Feed
By Tag
AJAX ASP.NET Automated Build Tool C# C# 3.0 conferences CSV DSL FinalBuilder Inside PH Linq parallelism Perl Programmer's Heaven Programming Subversion types Version Control Visual Studio 2008 Windows Vista
By Month
February 2008
January 2008
December 2007
November 2007
October 2007
Help
Check out the Blog FAQ.
|