From: Alex Young Date: 2007-11-27T05:56:05+09:00 Subject: Re: False positives in editing data RichardOnRails wrote: > Hi Alex, > >> abbreviation prefix to denote a semantic difference within a >> type, then that's (potentially) useful, in both Ruby and C: >> us_username = read_unsafe_input() >> s_username = sanitise(us_username) > > I like that. > >> If it's denoting a class, >> then it's not something I can see as useful > > I like to know merely by inspection whether a referent denotes an > integer, a string, a hash or an array of such things. I'd like to > avoid "Syntax error" simply because I failed to include a to_s, to_i, > [] or whatever. You'll tend to find that types are much less relevant in Ruby than in C. The actual class of an object is much less important than the methods it responds to, and you won't get a syntax error unless the syntax is actually wrong; this won't be a problem with variables because of the lack of compile-time type checking. I've tried the method you're espousing myself, and it didn't actually help me at all. I found it just wasn't worth the effort. However, I'm more than willing to accept that it's a difference between your coding style and mine rather than any fundamental problem with the concept that made the difference. In terms of posting code here, the most important thing is to make it readable. Most people won't know what your hungarian prefixes mean, so they're just line noise to them. -- Alex