rbandrews: (Default)
[personal profile] rbandrews
Usual meme rules still apply. Comment, or even think about commenting, and you get tagged.

What game that you like a lot do you think is the one you're the worst at, and why?
Werewolf I'm pretty bad at, but I'm not sure that's entirely my fault. I'm also not sure that it's even possible to consider yourself good at Zendo, which I also like a lot. I'm very bad at Tigris & Euphrates, but I'm not even sure I like it that much any more. I think I'll go with Modern Art, though. I love the game, never really get tired of it, but I am horrible at auction games. I am never really sure what a good price is.

Where do you most want to travel in the near future, and why?
NoVA is the place I want to go, because of seeing Kayla and Tucker (and everyone else), but I probably won't get up there any time soon. The next place I plan to travel is Blacksburg, for Technicon in a few months. Fewer months than you think, staff people!

What is the programming language feature you miss the most when working in languages which lack it?
This is a truly wonderful question because it allows me to lecture.
Obviously the feature I pick has to be something that's not in languages I use all the time, which is mostly Java any more (otherwise I say "variables" and I'm done). It should be something related to the way I think about programming. It should be something I have actually missed, not just something I think is cool but don't really need (so not call/cc).
I think I have to go with lambda here.
Lambda is a function that makes a function. It takes some code as an argument, and returns a function that, when you call it, runs that code. There are variations on it, like if the code can read variables from the declaring scope it's called a "closure", and if the code can be put together at runtime then functions are "first-class objects". Only Lisp has the second, really, and the first is handy but not required. Lambda itself is present in spirit in lots of different languages (even some JVM languages, like Nice) and is handy somewhat without those features, but really I guess I miss closures. Closures totally change the way you write code. Instead of accessing a data structure, the data structure gets told "do this to all your stuff" and it does (map). Or "combine all your things into one thing like this" (fold-left). Think about how often you do that in a procedural language. Here's a hint: everywhere you've typed for(int n=0;n<list.size();n++) is a call to map. Want to turn an array of things into a comma-separated list of things? It's a hassle in most languages, but it's not even worth making a function for in a language with closures:
fold-left(myList, lambda(a,b){return a+','+b;});

The fold-left function is nothing magic:
function fold-left(list, func){
  if(list.length == 2)return func(list[0], list[1]);
  else return func(list[0], fold-left(list.range(1, list.length), func));
}

where "range" returns a sublist.

Some languages support these, some fake it. Lisp completely does, Javascript has closures, as does Nice, Perl (with a hideous syntax), Ruby, and a lot of others. C has function pointers which are somewhat like it but harder to use (must declare a global function) and Java has classes. That's really all Java has. You can define an interface (like "Runnable") and make a class that implements it and pass an instance of that to your foldLeft method (which is in its own class, since Java can't do global functions), but what a pain, since each class needs its own file, with a bunch of crap in it, and there's still the scoping thing. What was 5 lines of my imaginary language is now what, three files of Java? No wonder it needs such a gigantic IDE when Lisp works fine from Emacs.


What is your favorite knot?
The sheet bend is a really beautiful knot, sort of recursive. Useful too, since you can use it to connect two pieces of rope very easily, even without having the end of one of them. You can tie small handholds on to a larger static line.

Pick one philosopher who you would most want to get the opportunity to punch in the nose (time travel is permitted), and explain why.
Ooh, the choices. Gandhi is the funniest answer, of course, and if I said Ayn Rand I'd probably get the most people agreeing with me. Since Bodhidharma would just kick my ass if I tried, I think I will go with Descartes. I am just ungrateful, I guess. After all, from his wacky notions of the creation of the universe ("swerve"?!) to his arrogant little "proof" of the existence of God, I can't think of anyone who put more amusement into my intro to philosophy class. Still, deserving of a nose-punch.

Profile

rbandrews: (Default)
rbandrews

July 2024

S M T W T F S
 123456
78910111213
14151617181920
212223242526 27
28293031   

Style Credit

Page generated Feb. 4th, 2026 04:43 am
Powered by Dreamwidth Studios

Expand Cut Tags

No cut tags