17 Mar, 2009, Tyche wrote in the 61st comment:
Votes: 0
shasarak said:
You should probably avoid using the word "singleton" in that context. What I guess you mean is a class method (roughly equivalent to a C# static method, only better :cool: ). "Singleton" is a term best reserved for the "Singleton Pattern" where it refers to an object rather than a method: that certainly wouldn't be appropriate, here, as there's no reason why you'd have a single object handling all commands of a certain type at one point in time, then remove that object and replace it with another of the same class doing the same job later. Those are the conditions where a "Singleton" is appropriate.


For good or ill, in Ruby, singleton method refers to class method.
17 Mar, 2009, shasarak wrote in the 62nd comment:
Votes: 0
Tyche said:
For good or ill, in Ruby, singleton method refers to class method.

Oh, right. :redface:

You'll have to forgive me, I don't have enough direct exposure to Ruby to know all the jargon. I feel able to discuss the language up to a point because I have a great deal of familiarity with Smalltalk and I'm assured (by people who are far wiser and more knowledgeable than I am) that Ruby and Smalltalk are essentially the same language; the syntax is different, but the underlying things being manipulated (messages, metaclasses, etc.) are the same. The only exception, of course, is that Smalltalk doesn't directly support mix-in inheritance.
17 Mar, 2009, shasarak wrote in the 63rd comment:
Votes: 0
David Haley said:
I can't swallow claims like this. I mean, seriously, there's a reason why people are still designing statically typed languages, right? They're not all stupid people who are completely missing the point, right?

It's certainly not a question of stupidity, but I think an awful lot of it comes down to creative inertia. People learn C, or some language with C-like syntax, because it's popular and they can get a job doing it. Once they get used to it, doing something different seems awkward and scary, and so people continue to use what they know, it remains popular, and keeps on offering job opportunities, and thus the next generation ends up repeating the cycle. There's really no good reason why most MUD codebases are written in C, other than that a lot of the codebases are 20 years old, and even the ones that aren't are mostly written by people who learned to programme on C-based MUDs.

If you've got used to working in a statically typed language then the thought of not being able to fall back on type-checking is quite scary, and one doesn't have any experience of the advantages of dynamic typing to counter-balance the scariness. Hell, even I was scared of dynamic typing when I first encountered it.

David Haley said:
But you're making it sound like static typing is never better than purely dynamic typing. It sounds like you're arguing that nobody should be working in statically typed languages.

That's pretty much my position, yeah. :biggrin:

As I said, I think the "safety" that comes from static typing is largely illusory: it's not a substitute for proper unit testing, but it sets a trap for people by appearing to be.

Okay, I'm exaggerating a bit: there are situations where static typing makes sense. But, on the whole (IMO) in those situations it's not spotting the errors in the code that is the justification for it, it's things like the inherent performance boost you get from not having to do dynamic method look-ups.

David Haley said:
(It's interesting that we've gone from object orientation in general to static vs. dynamic.)

I think the same "creative inertia" effect has had a massive influence on delaying the take-up of OO as well. It's such a shame that the people who created C++ never got the chance to see a Smalltalk system in action first. :sad: As it is, as you watch the progression from C to C++ and from there to Java or C# they're moving steadily closer to where Smalltalk was in about 1980, but they've still got quite a way to go. :thinking:

And, while we're on the subject, there are a few problems with .NET that really are just plain stupid. Why (for example) are Streams and StringBuilders in different parts of the class hierarchy when they do the same thing? Why aren't Arrays and Lists polymorphic? There's no excuse for things like that. :devil:
17 Mar, 2009, David Haley wrote in the 64th comment:
Votes: 0
shasarak said:
It's certainly not a question of stupidity, but I think an awful lot of it comes down to creative inertia. People learn C, or some language with C-like syntax, because it's popular and they can get a job doing it.

There's something interesting in hearing this analysis when you factor in that a lot of people designing new typed langauges have ML or oCaml backgrounds and have no interest in perpetuating C. It's even more interesting when you factor in that a lot of these new languages actually are not very "job opportunity friendly", which might explain why you think it's only C-ers working on them.

shasarak said:
Why aren't Arrays and Lists polymorphic? There's no excuse for things like that. :devil:

I'm not familiar with .NET's treatment of arrays and lists, so I can't speak to this. However containers in general pose some subtle type theory issues when you start talking about type covariance and contravariance.
17 Mar, 2009, elanthis wrote in the 65th comment:
Votes: 0
Keep in mind that Arrays and Lists were added to C# in the initial release, which was really just a Java clone at that point. C# 2.0 and 3.0 add a lot of powerful features, including generics, but the existing class library was already locked in at that point. Keep in mind that the modern .NET library also includes support for dynamic languages via the DLR.

You know the mantra: everything Microsoft makes sucks until version 3.0. :)
17 Mar, 2009, Vassi wrote in the 66th comment:
Votes: 0
C# 4.0 is introducing some new dynamic features, as well, where types are evaluated at runtime. It sounds kind of like duck typing, to me, but I haven't looked into it all that much.

To be honest, while I've grown to like LINQ and Lambda expressions (the biggest things from 3.0) as of 4.0 it's going to be almost a completely different language. I feel sorry for people developing in 2.0 that haven't been keeping up, when it comes time to go to 4 it will be a little painful. =\

elanthis said:
everything Microsoft makes sucks until version 3.0


Yeah, then it starts getting non-sensical upgrades and becomes bloated and unusable around, what, 7? =\
60.0/66