Metacircular thoughts

June 7, 2008

Imitating Ruby’s anonymous hashes in VB.NET

Filed under: Uncategorized — metacircular @ 10:13 pm

Module Program
    Sub PrintObj(ByVal obj As Object)
        Try
            Console.WriteLine(obj.B)
        Catch ex As MissingMemberException
            ' Do something appropriate here
        End Try
    End Sub

    Sub Main()
        PrintObj(New With {.A = 1, .B = eh})

    End Sub
End Module

Except here we’re passing in an anonymous object where one of the members is XML, something you can’t do in Ruby.

This seems like a reasonable workaround to VB.Net’s infuriating lack of collection initializers if you’re willing to give up type safety, I suppose.

February 25, 2008

What users want: porn, music, and video games

Filed under: Uncategorized — metacircular @ 10:41 am

Let’s get things nice and sparkling clear about what users want.

They want to download torrents of the latest episodes of their favorite TV shows. This is why torrent and P2P clients have billions of downloads. They want the utilities they need to watch, compress, decompress, and transfer around their media. This is why codec packs and utilities like WinZip have hundreds of millions of downloads. They want to keep their machines reasonably free of spyware. This is why applications like AdAware have hundreds of millions of downloads.

They want to communicate with their friends, be it through instant messaging, social networking websites, or whatever.

They do not give a shit about your blog or your productivity/organizational application (they don’t care about this blog or the little project I’m working on on the side, in particular). They won’t give a shit about it, anyway, unless you have an unusual angle, like Perez Hilton where you can get an eyeful just by scrolling, and without reading or taking the time to appreciate all the hard work the site’s creator puts in.

If you’re going to talk about what users want, look at how they’ve voted with their mice clicks: AdAware and celebrity gossip is in, Web 2.0 is out, not that it was ever in.

Maybe this is an indication that just because millions of people want something doesn’t mean that it has any intrinsic worth, eh?

Maybe spending your precious spare time on something that’s really tedious and difficult isn’t a good idea just because millions of dumb IE 6 users want it. Maybe, instead, you should spend your time on what you enjoy and value.

What you do to pay the bills or make your clients happy is a completely separate matter: you’re probably going to be logging quite a bit of time in Firebug because that’s quite possibly the most pragmatic way to do an application 5,000 people in a large corporation are going to use.

But when you finish the work day and you want to create excellent software for yourself, where you get to do the things your clients won’t let you do, why would you willingly make a Pentium 4 feel like a 386 with JavaScript hacks?

February 4, 2008

Web applications suck and they’re not worth creating

Filed under: Blasphemy — metacircular @ 10:28 pm

It’s a simple fact that complex web applications are almost impossible to create. This constrains you to making simple apps, which is often a good thing, but if the problem domain you happen to be in genuinely deserves deep exploration over time, you’ll quickly be fighting your deployment medium instead of working with it.

If you want a WYSIWYG editor roughly on par with the rich text box controls that give you about as much formatting oomph as Wordpad along with simple spellchecking of the kind that Firefox uses to tells me that “Wordpad” is incorrectly spelled as I type this, be prepared to spend several months to a year to get a production-ready version of it, the way Fog Creek did. That’s with FogCreek-level people on the job.

If you want a very nice, elegant calendar of the kind paying Backpack accounts do, be prepared to spend 2-3 months the way 37Signals did, and that’s if your coding chops are on par with DHH and the people who created scriptaculous and Prototype.

At least, if you want to achieve Internet Explorer 6 compatibility.

What chance do us po-faced mediocre daycoder fucks have? Fuck! We’re still trying to pretend Unicode doesn’t exist.

And then you have to host this. Once you grow big, you will need a full time system administrator to manage all of this, the way Fog Creek and 37Signals both do.

The unfortunate truth is that with a few minutes of point and clicking and a few more minutes of hacking in Visual Studio, I can create desktop apps with features that are a real pain in the ass to replicate in web apps. And your version will be on its way to being a big cumbersome JavaScript hack that takes so long to load it feels like a bloated desktop app. Irony.

Nothing to install, you say. From the perspective of someone who makes old-fashioned intranet client-server apps during the day and codes in their spare time and stands to make $0 off the software they produce from this, I don’t give a shit. I only work on the things I like, which it turns out almost no one else likes. You may actually discover that your customers actually want to host the software themselves, even though it’s a web app, in which case you have to do terrible things to make your dorkus malorkus customers happy.

I like applications that are fast (they do my 2 GB Core 2 Quad machine justice), that are available whenever I’m at my computer, and give me as much storage space as I can stick hard drives into my machine (on the order of a terabyte or so).

Can you imagine any web service anywhere giving you a terabyte of hard drive space, and actually delivering it? Even GOOG only gives you 2 gigs.

Getting back to complex apps, there’s a certain fundamental attribute of applications you live in, like email clients, web browsers, spreadsheets, text editors, IDEs, and other things that a lot of professionals get paid good money to spend all day in: extensibility, at multiple levels. Firefox has GreaseMonkey, Firebug, AdBlock Plus, and other wonderful things. Excel has VBA as well as a C/C++ API. Investment bankers live in their macros from what I hear.

Where is the web app equivalent of this? It’s some smug Danish cunt telling you you don’t need those things. That’s a copout and it’s a bunch of bullshit.

But there are tons of boring data-driven business apps that really ought to be web apps, you say. You are absolutely correct. By all means, the web is the default destination for heavily data-driven apps that involve a lot of simple data interactions and don’t require extensibility, realtime responsiveness (Ajax/Comet are not realtime), keyboard shortcuts and other power user features, and other lovely desktop things.

My point is this: my desktop apps leave your web apps in the fucking dust when it comes to the things that make performance-minded nerds happy. I will never create the next MySpace or Google. I don’t give a shit; I’d rather create the next uTorrent.

January 29, 2008

Paul Graham to programming community: fuck non-English speakers and web standards

Filed under: Uncategorized — metacircular @ 5:53 pm

Arc is finally out.

Choice excerpts:

I don’t want to spend even one day dealing with character sets. Character sets are a black hole. I realize that supporting only Ascii is uninternational to a point that’s almost offensive, like calling Beijing Peking, or Roma Rome (hmm, wait a minute). But the kind of people who would be offended by that wouldn’t like Arc anyway.

Apparently the only people who like Arc are people who use toy software that only they and their friends use. And none of them speak a language requiring a non-Latin character set.

Because Arc is tuned for exploratory programming, and the W3C-approved way of doing things represents the opposite spirit.

Durrrr, designing like it’s 1997 is great, because that’s the last time I learned anything new!

One is always a bit sheepish about writing quick and dirty programs. And yet some, if not most, of the best programs began that way.

On the Internet, you can make whatever claims you want without the need to ever provide evidence or facts. And if you disagree, you’re a moron who doesn’t understand closures or exploratory programming.

Nevertheless, I enjoyed my time with SLIME and SBCL during college, so I’ll try to give Arc a look one of these days. Maybe when it’s not so racist and has a cool app implemented in it.

December 25, 2007

Working through Concepts, Techniques, and Models of Computer Programming

Filed under: Language pissing matches, Language snobbery, Politics — metacircular @ 12:05 am

I am working through the famous CTM book, which looks like it could be like SICP for grownups.

CTM uses a language and platform called Mozart/Oz, which is freely downloadable and easy to get started with.

The development environment includes an Emacs-based REPL. It’s very easy to get started.

15 minutes after installing the program, I was able to code up the classic tail-recursive factorial:


declare
fun {Fact N}
   fun {FactIter N Acc}
      if N == 0 then
	 Acc
      else
	 {FactIter N-1 Acc*N}
      end
   end in {FactIter N 1}
end

{Browse {Fact 23}}

The first part defines our factorial function, and the second evaluates 23! and displays the result in the browser, which will be familiar to anyone who use has used Common Lisp.

(Yes, Oz has arbitary-precision integer arithmetic built in, like any sane modern programming language. Yes, Oz is apparently lexically scoped.)

All in all, it looks like the CTM book should be quite enjoyable. I’ve heard it’s readable and its coverage of different programming paradigms — object-oriented, concurrent, logic, functional, imperative, constraint-based, declarative — is nearly comprehensive.

Let the holiday language snobbery commence!

December 11, 2007

The triumph of open source; or, Walt Mossberg is an annoying self-centered ignoramus

Filed under: Uncategorized — metacircular @ 7:43 pm

Nothing bothers me more than unchallenged ignorance.

For example, in a video interview with 37Signals’ Jason Fried, near the end Mossberg says the following:

How much time do we have left? About three? Let’s spend that three minutes talking about why open source is a failure.

It’s not a failure in the IT department of corporations where people from Mars run those IT departments … There is one huge open source success, called Firefox…

I’ve never seen something so wrong from someone so high-profile, except maybe our warmonger president lying yet again.

Let’s have a quick jaunt over to the download statistics on SourceForge to see the numbers on some of the most-downloaded open source applications. Keep in mind, this doesn’t include OpenOffice which has downloads in the tens of millions. There are quite a few other open source apps with millions of downloads, like WordPress, that are also not present.

The first thing to note about the list is that it’s dominated by P2P apps and utilities - people like downloading porn and utilities that help them unzip compressed porn files so they can enjoy the bounties of the evening’s copyright infringement. Because of the nature of the most popular applications, probably the users don’t give a rat’s ass that it’s open source.

But more importantly, the numbers are quite remarkable - three of the applications have over 100 million downloads!

Let’s do a quick calculation and add up the total downloads on the top 50 SourceForge projects as of December 11, 2007. Let’s see, 373,890,600 + 157,418,200 + 135,341,394 + … = 1,462,719,263. That’s 1.4 billion. Basecamp has something on the order of one million users. That’s three fucking orders of magnitude difference. Popular P2P apps are in a completely different league of popularity compared to all these stupid little web apps which you have absolutely no control over.

Put differently, compared to Azureus or eMule, Basecamp is an astounding failure.

Have Walt Mossberg’s columns been read 1.4 billion times? The Wall Street Journal’s circulation is only 2 million — not bloody likely.

Maybe proprietary software apologists like Mossberg and Jason Fried should shut their fucking pieholes before spouting off at the mouth with a bunch of patently incorrect bullshit.

November 28, 2007

Learning Lift – Step 0: Part a) Give a shit about the Java programming language

Filed under: Uncategorized — metacircular @ 11:39 pm

This is gonna be a doozy.

Holy shit Akismet sucks

Filed under: Politics, Pop culture — metacircular @ 10:12 pm

I was just looking through the comments on this blog after neglecting it for a while and I had no idea Akismet let through so much spam. What a piece of shit.

Learning Lift – Step 0: Learn the Java platform

Filed under: Java, RIAs, Scala — metacircular @ 9:57 pm

Lift is a Scala web framework. Its creator is none other than the mighty David Pollak, a man who was a mature programmer when I was a newborn infant.

It combines many of the best ideas from other web frameworks. It’s at the point where it’s small enough to be manageable but large enough to be featureful. Now is the perfect time to get in on it.

The problem is that it until about a week ago, my computer couldn’t even handle Lift, I didn’t have enough RAM. That problem has been solved.

But I still don’t have a clue about Maven and the other Java components Scala depends on which I don’t think David even realizes are nontrivial to learn. (They are trivial if you are David Pollak.)

And besides, Lucene is too awesome to pass up.

So, the first step is getting comfortable with Java web programming.

To do this, I am going to create a wiki/PIM type product that is more or less a Backpack ripoff. It will start as a trivial wiki, with Backpack-type features added later. Here are some features that are essential:

  • Fulltext search. This is an essential feature of all modern data-driven applications. Lucene will do the job.
  • Version control. I insist on knowing who changed what and when on pretty much any digital artifact I work on on computers these days, even binary assets like Photoshop files.
  • Simplicity. It must be beyond braindead simple to jot down quick notes, as simple as it is to type in a query to Google.
  • Responsiveness. I fucking hate slow software! Unfortunately we will have to dirty our hands with JavaScript in order to carry out nice Ajax stuff. I hate Ajax hype more than anyone I know, but it’s simply a fact that client-side scripting is the way to make excellent, responsive web applications.

In order to make this tractable, Internet Explorer compatibility is entirely optional, and I’m not going to waste my spare time on it.

Probably mobile access is important but I barely ever use cell phones.

The book I’m going to be working through is a recent release from APress: Beginning JSP, JSF and Tomcat Web Development: From Novice to Professional.

Let the games begin.

October 20, 2007

Generics in VB 2005

Filed under: The Dark Side — metacircular @ 5:19 pm

So, generics in .NET 2.0 let you make functions and classes generic over types.

They also let you maintain type safety by constraining the type, e.g. making it implements a certain interface.

For example, you could define a general function to find the minimum element in a list. In VB, the data structure of interest is System.Collections.Generic.List(Of T). Now, we have to be able to compare on these objects, and the .NET interface for this is IComparable. So, we can define the function as follows:


Imports System.Collections.Generic

Public Function FindMin(Of T As IComparable(Of T))(ByVal data As List(Of T)) As T
   Dim minval As T = data(0)

    For Each value As T In data
        If value.CompareTo(minval) < 0 Then
            minval = value
        End If
    Next

   Return minval
End Function

The As IComparable(Of T) bit constraints T to implement IComparable. Visual Studio complains with highlighted source code until we add this constraint about the call to CompareTo; it statically determines the type safety of what we’ve produced with respect to constraints and interfaces and tells us promptly, which is nice.

Then you can test this out as follows:


Dim numdata As New List(Of Integer)
numdata.Add(1) : numdata.Add(3) : numdata.Add(-5) : numdata.Add(4)
Console.WriteLine(FindMin(numdata))

Dim stringdata As New List(Of String)
stringdata.Add("first") : stringdata.Add("second") : stringdata.Add("last")
Console.WriteLine(FindMin(stringdata))

This outputs -5 and “first”, respectively, as you’d expect.

Pretty straightforward, really.

Whoda thought a BASIC dialect could be a respectable albeit underwhelming programming language?

Next Page »

Blog at WordPress.com.