5 ms·
Is it somehow hip to misspell "class" as "klass", or is there a deeper meaning behind it?
by perlgeek 15y ago
Is it somehow hip to misspell "class" as "klass", or is there a deeper meaning behind it?
- DanielStraight 15y agoclass is a keyword.
- stefan1 15y agoI think perlgeek was referring to the use of user_klass and log_klass.
- sugerman 15y agoNot in the way its used in his samples.
- arctangent 15y agoThe word doesn't seem to be used by itself however - the code in the article contains "user_klass" and "log_klass", which can presumably be spelled correctly without causing an issue?
- oinksoft 15y agoI use `cls` in my ruby code, as I do in other langs; I think `klass` is unsightly.
- kyledr 15y agoThe author of the code must like German. He used "Matz" as a parameter, a German name, and klass = class in German.
- mnutt 15y agoMatz is short for Yukihiro Matsumoto, the creator of Ruby.
- eis 15y agoMatz is neither a common german name (I've never encountered it) nor is class "klass" in german. It's "Klasse". Maybe you just missed out an "e" on the name aswell? There is "Matze" which would be a short version of "Mathias".
- lightyrs 15y agoklass is used in meta programming as a way to control scope.
- raganwald 15y agoIt is a sound engineering practice to avoid using keywords as names even when the language’s parser will let you get away with it. For consistency, some developers (myself included) will avoid words like `class` and `module` even when embedded in a longer name, such as `user_class`. I don’t use `klass`, but that’s because I’m a Java Bigco cubicle-dweller fraudulently passing himself off as a Rubyist and Javascripter. I prefer `clazz` in keeping with Sun examples.