#init

T

trans. (T. Onoma)

The argument that #init should be available to end users like #id is very weak
b/c 'id' is very common, especially in DB work (where it is essentially
required). I have never had a need for my own #init, nor seen any other code
that required such --i.e. made things troubling for the lack of it.

The main point as to why #init is much better, is simply to do with saving
time. Add up all the time you save typing those extra 6 characters. Lets say
it takes you 1/2 second to type (give or take depending on how fast you
type). In a year I would guess that I type 'initialize' multiple thousands of
times, as I'm sure many Rubyists do. Well, for every 1200, that's nearly an
hour of my life. Between a 100 Rubyists, that's 100 man hours wasted! Worse
is when I've accidently mistyped it, which always happens somewhere in those
last six characters. I mistype it maybe 1-2% of the time (I've gotton better
at it over time). For each of those I waste a minute or two finding and
fixing the typo. There goes another hour of my life (and many more total man
hours for our Rubyists).

'initialize' is easily in the top 5 most typed ruby words, like 'def', 'if'
and 'class'. Such words really ought to be short for this simple reason.

T.

P.S. Not to mention all the time spent by people thinking the above and then
spending time to tell other people about it ;)
 
S

Stu

The main point as to why #init is much better, is simply to do with saving
time.
'initialize' is easily in the top 5 most typed ruby words, like 'def', 'if'
and 'class'. Such words really ought to be short for this simple reason.

ive spent the last 30 years of my life typing initialise. the ise/lise
pattern is ingrained into my fingers. it is SO hard to put the Z in.
it goes against everything I have ever been taught in school.

if we have def instead of define, why cant we have init eh?? :)

or at least alias initialise to initialize.


-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo.com/osfaq2
3x3 Eyes Fanfiction Archive
http://www.mega-tokyo.com/pai
 
I

Ivan Vodopiviz

ive spent the last 30 years of my life typing initialise. the ise/lise
pattern is ingrained into my fingers. it is SO hard to put the Z in.
it goes against everything I have ever been taught in school.

if we have def instead of define, why cant we have init eh?? :)

or at least alias initialise to initialize.
hi,
i don't know how's your keyboard, but in QWERTY, the S is really next
to the Z... not a big difference between initialize / initialise

but, #init would be great!

cya
 
J

James Edward Gray II

ive spent the last 30 years of my life typing initialise. the ise/lise
pattern is ingrained into my fingers. it is SO hard to put the Z in.
it goes against everything I have ever been taught in school.

But Ruby is a different language with different rules. Things like
def, elsif and __FILE__ probably aren't part of many native tongues,
eh?

James Edward Gray II
 
G

gabriele renzi

trans. (T. Onoma) ha scritto:
The argument that #init should be available to end users like #id is very weak
b/c 'id' is very common, especially in DB work (where it is essentially
required). I have never had a need for my own #init, nor seen any other code
that required such --i.e. made things troubling for the lack of it.

I may recall wrongly but ruby/SDL has it, ruby/GTK (ruby-gnome2), Fox
and qtruby too. And maybe the oracle driver. It seem that some kind of
libraries (i.e. those written in c/c++ with an OO mind) make some use of
it. I guess some more may have it.

The main point as to why #init is much better, is simply to do with saving
time. Add up all the time you save typing those extra 6 characters.

don't get me wrong, I'd like to save keystrokes, and actually I'd have
loved if matz designed #initialize as something shorter since the
beginning, but now I guess it breaks too much stuff.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top