A major ruby annoyance!

Edgardo H. wrote:

In Ruby, the naming convention states that you should use CamelCase
for classes and snake_case for method or variables, why would you then
confuse when to use an “a” or and “A”?

  1. Is that a Ruby naming convention or a Rails naming convention?
  2. If CamelCase comes from Perl and snake_case comes from Python, what
    do you call this convention: makeNextRecord?
  3. Should the Ruby conventions be called PickaxeCase? gem_case?

Yes … I’m bored … I should be programming … back to it now?


M. Edward (Ed) Borasky

On 5/9/06, Dave H. [email protected] wrote:

In point of fact, I do have a lot of problems with getting the name
wrong, especially since Ruby, like most primitive computer systems but
unlike the standard behavior of people, thinks that an “A” is
fundamentally different than an “a”. That one causes me constant
irritation.

An ‘a’ is certainly different from ‘A’, would you write “alex” or
“Alex”, “australian” or “Australian”, “april” or “April”?

In Ruby, the naming convention states that you should use CamelCase
for classes and snake_case for method or variables, why would you then
confuse when to use an “a” or and “A”?

Kind regards,
Ed

Encontrá a “Tu psicópata favorito” http://tuxmaniac.blogspot.com

Thou shalt study thy libraries and strive not to reinvent them without
cause,
that thy code may be short and readable and thy days pleasant and
productive.
– Seventh commandment for C programmers

Hi –

On Tue, 9 May 2006, Logan C. wrote:

private

obj.something

you know that you’ve called a method. There’s no other possibility,
so there’s no opportunity for divergence of the interface.

Well at least if you do it my way, you don’t get tripped up by typos, :wink:

Why not? :slight_smile:

class C
def initialize
self.contanier = []
end

 private
 attr_writer :container

end

That will blow up just as much as:

class C
def initialize
@contanier = []
end

 def insert(x)
   @container << x
 end

end

(It will happen at a slightly different point, of course.)

David

On May 9, 2006, at 8:14 AM, M. Edward (Ed) Borasky wrote:

Edgardo H. wrote:

In Ruby, the naming convention states that you should use CamelCase
for classes and snake_case for method or variables, why would you
then
confuse when to use an “a” or and “A”?

  1. Is that a Ruby naming convention or a Rails naming convention?

Ruby and even partially encouraged by the interpreter, since
constants are expected to begin with a capital letter.

James Edward G. II

Here's *my* major Ruby annoyance: all the time people that are new to Ruby come up with suggestions / requests in which way Ruby must / should be changed to be better / the ultimate language / more complete than C++ / cooler than Perl - apparently without bothering to learn and use the language for some time and gaining some experience. These suggestions are typically based on personal habit and theorization - both not really suited to yield usability improvements for a larger audience.

Cheers

robert

On May 9, 2006, at 12:21 PM, [email protected] wrote:

def initialize
@container = []
they’re

end

(It will happen at a slightly different point, of course.)

David

Ok, there’s less typo trip-ups.

On May 9, 2006, at 9:14 AM, M. Edward (Ed) Borasky wrote:

Edgardo H. wrote:

In Ruby, the naming convention states that you should use CamelCase
for classes and snake_case for method or variables, why would you
then
confuse when to use an “a” or and “A”?

  1. Is that a Ruby naming convention or a Rails naming convention?
  2. If CamelCase comes from Perl and snake_case comes from Python, what
    do you call this convention: makeNextRecord?

that’s smalltalkMethodCase: :wink:


Daryl

“Stress rarely has a positive impact on our ability to think.
Never, I’d guess.”

– Ron J., 2005

Eric H. wrote:

The fix he proposes for his problem (typoing variable names) tells
The biggest change writing tests has done for my coding is to give me
smaller more descriptive methods rather than large methods that do too
much. A method that is more than 10 lines long is probably wrong. A
method that is more than 25 is most definitely wrong.

Just to clarify: I was playing devils advocate for Talha. I do write
unit tests and have for many years. I don’t typo variable names
(often). It’s a non-issue for me. I was merely trying to re-express
his idea for him.

Roy