I’ve decided it’s probably not a good idea to make general Noda Time posts on my personal blog. I’ll still post anything that’s particularly interesting in a "general coding" kind of way here, even if I discover it in Noda Time, but I thought it would be good for the project to have a blog of its very own, which other team members can post to.
I still have plenty of things I want to blog about here. Next up is likely to be a request for help: I want someone to tell me why I should love the "dynamic" bit of dynamic languages. Stay tuned for more details :)
I was considering starting this project myself, oddly enough with the same name. I didn’t however because I don’t really consider myself quite skilled enough to pull it off. Glad to see a true expert is getting the ball rolling – if I can find a way to contribute without breaking anything I’d love to.
LikeLike
@Erik: When it comes to time, I’m no expert – but I am quite good at both Java and C#, which should help.
Do join us…
LikeLike
Regarding dynamic, consider this code (I’m writing pseudo-C# but imagine this is actually a dynamic language):
public dynamic Sum(dynamic[] items) {
// I assume items has at least one items
dynamic result = items[0];
for (dynamic i = 1; i < items.Length; i++)
result += items[i];
return result;
}
I wrote this for integers with my dynamic language – I can't define my variables to be of type integer, and I have no reason to do so anyway.
Now, if I want to sum decimal numbers what do I do?
Sum([1.5, 2.3]);
And if I want to 'sum' strings with concatenation?
Sum(["Hello. ", "My name", "is Inigo Montoya."]);
Now I have define my own numberic type:
struct complex {
dynamic real;
dynamic imaginary;
dynamic operator +(left, right);
}
How do I sum them?
That's the main beauty of dynamic languages. There is a static languages that can do that – I can only think of Go right now, but maybe there are others as well.
The power of Go is that it is a static language that has the most important feature of dynamic languages – implicit interfaces. But Go sucks because it doesn't have a decent BCL (it's good at what it's for, I think, but I prefer more generic languages).
LikeLike