Wednesday, March 24, 2010
&OK
Why is there never a mnemonic on OK buttons in Windows? If my focus is on a different button, there's no way for me to push OK without tabbing around. Cancel doesn't need one, since it's almost always the same as Escape. Usually, all buttons have mnemonics except for OK and Cancel, making OK the MOST INACCESSIBLE BUTTON ON THE WINDOW. Whose idea was that!
Monday, March 8, 2010
Ruby and Apple Fans Need to Settle Down
Mac Users Need to Settle Down
Recently, a Mac user and I had to decide on the order of the "OK" and "Cancel" buttons on a dialog in an Android application. The facts are that Windows puts the "OK" button on the left, and Mac puts the "OK" button on the right. The Mac user actually called the Windows way "bad design". I believe the rationale behind the Mac way is that the right side of a screen should correspond to forward and the left side should correspond to backward (makes me think of Mac's placement of the close window button.). In the discussion, we didn't really have time to argue about it a lot, and he was in a somewhat authority-like position over me, so it's probably good that I didn't pursue my side further at the time, but I'd like to do that now.The text of a dialog box in all operating systems is either left-aligned or centered, and the two are indistinguishable for some lengths of text (since the dialog changes size to fit the text). The default position of your focus as you read the text starts at the left, averages in the center, and ends at the right. I'd argue that the center is really the main point of attention and so the button closest to the center is the first button the user sees and thinks about. Since buttons are right-aligned (at least in Windows), the closest button to the center is the button on the left, which should be the button the user wants to click. That's a good reason for Windows to put the "OK" button on the left instead of the right.
All that to say, Mac users seem to be a little too aggressive. They'll defend Mac to the death, which is just plain ridiculous. That much enthusiasm is really unhealthy for a topic like Windows vs Mac. Just look at the iPad. Any support for that at all is evidence of an unhealthy devotion to Mac products.
That being said, a counter example to my point is a very respectable Mac fan at the place where I work.
Ruby Developers Need to Settle Down
The same goes for Ruby developers (who seem to be the same people as Mac users. Hmmmmmm.). Ruby, just like Mac, is potentially beautiful, but completely non-standard. Ruby's syntax is not like any other languages' syntax. And I don't mean that it's hip and fresh; I mean that it's difficult to learn and nothing really that exciting. Here's an example of Ruby's syntax:file_contents = open("filename"){|f| f.read}I know what the line does: it opens a file, reads all of the text in it, and assigns the text into the variable
file_contents
. But how in the world does that curly-bracket lambda function fit into the semantics of the open()
thing?? Obviously, I could find out with some research, but I thought I knew Ruby's semantics pretty well, and this totally stumped me. For comparison, here's Python's equivalent:file_contents = open("filename").read()Seems a lot simpler; particularly, you know that
read()
is a function of the object returned from the open()
function. (It's possible that the Ruby code actually closes the file in some kind of with
-/using
-/try-finally
-like semantics, which makes python's code a bit more complex to match the functionality exactly.) One more argument against the Ruby language itself, is that it was designed by one guy, designed for himself, and designed with no regard for anyone else's preferences (see Wikipedia). But enough about Ruby, the point I'm trying to make here is that Ruby users need to settle down. The first search result for "C type casting parser" (as of the day of this post) is CAST -- Ruby's C parsing dog. Woof.. A couple things to note, one is how silly the title is, but that's fine. The second is that it's on a website called rubyforge.org. What's wrong with sourceforge.org? The third thing to notice is about 1 screen down the page in the section "The Parser".
Here's a quiz: what does "a * b;" do?Was the caricaturization really necessary? That bash on Java was completely unrelated. The real point the author is trying to make is actually a very good one, and was the reason I sought "C type casting parser" in the first place (has to do with parser state).
I bet you said "why you l4m3r n00b, that's a statement that multiplies a by b and throws away the answer -- now go take your meaningless snippetage to your computing 101 class and let me finish hurting this JavaTM programmer." Well, you'd be both mean and wrong. It was, of course, a trick question. I didn't say if any of a and b are types! If only a is a type, it's actually a declaration. And if b is a type, it's a syntax error.
Ruby on Rails developers are usually good examples of over-excited Ruby fans. Ruby on Rails is a FANTASTIC framework for website development compared to PHP, but there exists a framework comparable to Ruby on Rails that uses Python instead of Ruby, Django. Python, as I will eagerly argue to the death (wait a minute...), is a better programming language than Ruby. Everyone I know that knows both Rails and Django likes Django way better, but Rails developers will hear none of it. Python is arguably a much easier language to learn than Ruby, and, from what I hear, Django is a better framework than Rails. Why does Ruby on Rails maintain its popularity? Well, besides momentum, I'm sure there's some unhealthy fanaticism as well.
That being said, I am embracing a lot of the semantics of the Ruby programming language in my programming language Jax. However, I'm not acknowledging any causality or direct inspiration from Ruby; it's just the way programming languages should work.
In Conclusion
Mac sucks!! Up with Linux (and windows)!!Ruby sucks!! Up with Python (and java)!!
Monday, February 15, 2010
Java's Access Modifiers Suck
http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
I'm really sad that
I'm really sad that
protected
is also package visible.
Monday, February 1, 2010
An 'x' is not a '+'
Idk who thought that "cxx" was a good way to refer to C++, but all I can say is that an 'x' is not a '+'. 'x' is used as a variable (like DirectX), and an 'x' looks kinda like a '+' rotated 45°. So either, cxx means c-anything-anytyhing, or it means that it's ok to roteta randow letters whenever yon want.
Furthermore, why would you name something after the process that produced it? if you call the output of the C Pre Processor "cpp files", then you should probably call the original source files "vim files". Name things after what they are or where they're going, not how they got where they are. The ".o" file extension on object files is for "object" not for "output". The extension ".out" for executable files is a bad choice.
The reason for this rant is that cmake tells me it's compiling CXX objects. Why in the world would cmake use 'X's instead of '+'s? It's not like '+'s are special characters in status messages.
The C pre-processor (which is very similar to the C++ pre-processor) is also commonly referred to as CPP which might cause some confusion in certain circumstances (especially if you output the pre-processed files with .cpp as suffix), which might be one reason to use .cxx/.hxx.Ok, the C Pre Processor is a general purpose text processor that the C language depends on. It is not at all dependent on the C programming language, so the name C Pre Processor is an objectively bad name.
-- http://www.phwinfo.com/forum/comp-lang-cplus/329968-what-difference-between-cpp-h-vs-cxx-hxx.html
Furthermore, why would you name something after the process that produced it? if you call the output of the C Pre Processor "cpp files", then you should probably call the original source files "vim files". Name things after what they are or where they're going, not how they got where they are. The ".o" file extension on object files is for "object" not for "output". The extension ".out" for executable files is a bad choice.
The reason for this rant is that cmake tells me it's compiling CXX objects. Why in the world would cmake use 'X's instead of '+'s? It's not like '+'s are special characters in status messages.
Thursday, January 21, 2010
What Great Software
More software in the world needs to be like this:
http://whenisgood.net/
As they themselves say:
http://whenisgood.net/
As they themselves say:
No sign-up form. No password to choose. No fuss at all.Other sites that do this:Huzzah!!
Tuesday, January 12, 2010
Putty intercepts Alt+Space
There're only a few windows I can't minimize with Alt+Space,N. One of them is googletalk because it doesn't use actual windows or something. GoogleTalks's got all sorts of non-standard behavior.
But Putty I expected better from. They allow Alt+Tab but not Alt+Space.
This reminds of when I discovered that GLUT eats Alt+F4. I had to put handles in for GLUT_KEY_F4 when (glutGetModifiers() & GLUT_ACTIVE_ALT) and then exit(0).
dumb.
But Putty I expected better from. They allow Alt+Tab but not Alt+Space.
This reminds of when I discovered that GLUT eats Alt+F4. I had to put handles in for GLUT_KEY_F4 when (glutGetModifiers() & GLUT_ACTIVE_ALT) and then exit(0).
dumb.
Wednesday, December 30, 2009
"Python Trick" % locals()
I just learned this python trick for string formatting. Here's an example:
Example usage of the above function:
def compileCommand(sourcePath, outputPath):This trick uses the dict
switches = "-O0 -g"
return "gcc -c %(switches)s %(sourcePath)s -o %(outputPath)" % locals()
locals()
to supply the values for formatting the string with the '%
' signs in it. The names inside the parens are resolved with the local variable names in the function. Example usage of the above function:
cmd = compileCommand("hello.c", "hello.o")
assert cmd == "gcc -c -O0 -g hello.c -o hello.o"
Subscribe to:
Posts (Atom)