CamelCase issues

M

Michael Neumann

On Fri, 22 Oct 2004 07:36:12 +0900,


Who does all of this drawing? It looks like some unknown power is doing
(and knowing) way too much.

The component! For example the button component has to draw itself onto
the screen, for which it needs a canvas.

Well, my example above was not good choosen. Better would have been:

class Button < Component
# this one is called from 'outside'
def draw_on(canvas)
draw_frame(canvas)
draw_inner(canvas)
end

private

# helper method
def draw_frame(canvas)
if @pressed
canvas.color = :lightgray
canvas.line(x, y, x+w, y)
canvas.line(x+w, y, x+w, y+h)
...
else
...
end
end

# helper method
def draw_inner(canvas)
canvas.text(@caption)
end
end

Of course the canvas implements the drawing primitives.
Now think the same for the Web and Html generation.
If I were the renderer, I'd have a headache from all the knowledge that
you must have stuffed into my poor brain :) There must be a better way
to do this.

Hm, but somewhere you have to implement how the component looks like, no?
The above is equivalent to:

cgi.table {
cgi.tr {
cgi.td { ... } +
cgi.td { ... }
}
}

But in a more imperatively fashion, similar as for drawing a GUI on the
canvas, where you don't do this ('+'):

canvas.box(...) {
canvas.line(1, 1, 10, 10) +
canvas.line(...) +
...
}

Regards,

Michael
 
S

Stefan Schmiedl

The component! For example the button component has to draw itself onto
the screen, for which it needs a canvas.

Aha. I actually did not get this. Not only am I losing hair, I'm also
getting stupid. What a nice way to start into the weekend :-/
Hm, but somewhere you have to implement how the component looks like, no?
The above is equivalent to:

cgi.table {
cgi.tr {
cgi.td { ... } +
cgi.td { ... }
}
}

Well, I'm not happy with the way the cgi stuff is handled, either.
But maybe that's because my brain is in Forth mode currently.
But in a more imperatively fashion, similar as for drawing a GUI on the
canvas, where you don't do this ('+'):

canvas.box(...) {
canvas.line(1, 1, 10, 10) +
canvas.line(...) +
...
}

Not when you're drawing stuff. But if you're doing widget layout with a
layout manager, you are at least doing this in spirit, if not in fact.

But what's more important now, is to go get Alexander from the
kindergarten ... it's his 5th birthday, you know.

s.
 
E

Eivind Eklund

On Thursday 21 October 2004 08:28 pm, Gavin Sinclair wrote:
Understood. Consistency in whatever form is nice. I have a made a few
different suggestions in the past related to this. On one occasion someone
(and I can't recall who it was unfortunately) made a fair argument against
dependency on capitalization, as it also hampers progression into
internationalization. Perhaps that's too forward looking

I think the idea of programming in one's "native language" is a bad
meme. No matter what you program, the language is a set of specific
codes that you need to memorize. I learned programming "in english"
(ie, with english keywords) before I knew any english at all, from a
norwegian book. The difficulty wasn't the keywords - it was the
concepts, and learning to wrap my brain around programming.

I've seen various attempts to internationalizing the internals of
computer programs - these have always ended up worse than keeping
things in english *even for speakers of the language it is
internationalized for*.

The only case where I can think this could work is if ALL code in the
programming language is written in a non-english language, along with
the culture for that programming language.

And in that case, the language won't be Ruby.

Eivind.
 
T

trans. (T. Onoma)

56:34 +0900,
|
| > On one occasion someone (and I can't recall who it was unfortunately)
| > made a fair argument against dependency on capitalization, as it also
| > hampers progression into internationalization. Perhaps that's too
| > forward looking --maybe Ruby will never be coded in Bengali, for
| > instance, or any other language which have no capitalized forms. But I
| > would like to look in that direction at least.
|
| errrrr... what would I do with Bengali source code?

Probably nothing. But what would a non-English speaking Bengali do with yours?

OT. Actually this interests me. Is it fair to say that English is the defacto
universal language now? And, short of an apocalypse, just about everyone on
Earth will eventually know this language?

T.
 
F

Francis Hwang

OT. Actually this interests me. Is it fair to say that English is the
defacto
universal language now? And, short of an apocalypse, just about
everyone on
Earth will eventually know this language?

Actually, Wikipedia currently estimates English to be the 3rd most
commonly spoken native language, after Mandarin and Hindi.

http://en.wikipedia.org/wiki/List_of_languages_by_total_speakers

Note that this number doesn't include people who speak a language as a
second language, which would most likely give English a much higher
ranking. Most of the Mandarin speakers live in the PRC, which is full
of subsistence farmers who aren't involved with anything glamorous like
international finance.

English is the defacto language at this point in history, largely
because the world's most powerful country speaks it. Personally I like
English because its centuries as a colonial language has made it a
bizarre polyglot in itself: If we have to include Oxford English and
Hinglish and Jamaican patois and ebonics and creole under the umbrella
of English, then English itself barely looks like one single language
anyway.

But will this last forever? Hard to say. Once upon a time, everybody
had to learn Latin, but these days that language is pretty good and
dead. If you don't like the weather, wait a few years.

F.
 
E

Eivind Eklund

56:34 +0900,
| > On one occasion someone (and I can't recall who it was unfortunately)
| > made a fair argument against dependency on capitalization, as it also
| > hampers progression into internationalization. Perhaps that's too
| > forward looking --maybe Ruby will never be coded in Bengali, for
| > instance, or any other language which have no capitalized forms. But I
| > would like to look in that direction at least.
|
| errrrr... what would I do with Bengali source code?

Probably nothing. But what would a non-English speaking Bengali do with yours?

See separate reply to you under the "Re: CamelCase issues". Brief
recap: memorizing the keywords in a foreign language is fairly easy;
there are other sides of programming that are the difficult part. (I
learned programming before I learned english, and I've thought it to
people that didn't know english well.)

Of course, the alphabet might be an issue, but I think even this is
dwarfed by the difficulty inherent in programming.

Eivind.
 
S

Stefan Schmiedl

56:34 +0900,
|
| > On one occasion someone (and I can't recall who it was unfortunately)
| > made a fair argument against dependency on capitalization, as it also
| > hampers progression into internationalization. Perhaps that's too
| > forward looking --maybe Ruby will never be coded in Bengali, for
| > instance, or any other language which have no capitalized forms. But I
| > would like to look in that direction at least.
|
| errrrr... what would I do with Bengali source code?

Probably nothing. But what would a non-English speaking Bengali do with yours?

Do what i did some years ago: Learn what each sequence of characters
does. Oh. I see. Interesting point.

s.
 
M

Michael Neumann

Aha. I actually did not get this. Not only am I losing hair, I'm also
getting stupid. What a nice way to start into the weekend :-/

oooh, sorry ;)
Well, I'm not happy with the way the cgi stuff is handled, either.
But maybe that's because my brain is in Forth mode currently.

In Forth of course that looks pretty much like HTML:

: <HTML> ." <HTML>" ;
: </HTML> ." </HTML>" ;
: <TABLE> ." <TABLE>" ;
...
<HTML>
<TABLE> ." blah " </TABLE>
</HTML>

Enjoy: http://www.ntecs.de/old-hp/uu9r/lang/html/forth.en.html :)

Not when you're drawing stuff. But if you're doing widget layout with a
layout manager, you are at least doing this in spirit, if not in fact.

Yes. The layout manager will do that for you.
But what's more important now, is to go get Alexander from the
kindergarten ... it's his 5th birthday, you know.

happy happy birthday (does he speak forth, too? :)

Regards,

Michael
 

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,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top