CamelCase issues

[...]
> It's similar as in the following example (where render_table_header_on =~ draw_line_on):
>
> def draw_line_on(canvas, x, y, w, h)
> ...
> end
>
> def draw_box_on(canvas, x, y, w, h)
> ...
> end
>
> def draw_on(canvas)
> draw_line_on(canvas, ....)
> draw_box_on(canvas, ...)
> end

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.

> Of course I'd removed the "_on" in the GUI case.
> The actual "drawing" is done this way (inside render_xxxx_on):
>
> renderer.table {
> renderer.row {
> ...

If I were the renderer, I'd have a headache from all the knowledge that
you must have stuffed into my poor brain :slight_smile: 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

···

On Fri, Oct 22, 2004 at 04:49:18PM +0900, Stefan Schmiedl wrote:

On Fri, 22 Oct 2004 07:36:12 +0900, > Michael Neumann <mneumann@ntecs.de> wrote:

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.

···

On Fri, 22 Oct 2004 10:56:34 +0900, trans. (T. Onoma) <transami@runbox.com> wrote:

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

--
Hazzle free packages for Ruby?
RPA is available from http://www.rubyarchive.org/

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.

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.

···

On Fri, 22 Oct 2004 18:13:24 +0900, Michael Neumann <mneumann@ntecs.de> wrote:

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.

···

On Friday 22 October 2004 04:49 am, Stefan Schmiedl wrote:

On Fri, 22 Oct 2004 10:56:34 +0900, > > trans. (T. Onoma) <transami@runbox.com> wrote:
> 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?

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

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.

···

On Oct 22, 2004, at 9:10 AM, trans. (T. Onoma) wrote:

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?

Keep in mind that Microsoft miserably failed with localized versions of
Basic. That somehow makes a discussion void.

In my eyes, every "real" programmer need to be able to read English (books!)
and at least write english keywords of the programming language of his
choice. Remember we are talking about a programming language, not one for
talking. Imagine the code would depend on the locale... What if you want to
pass code on to someone else?

Or am I missing the topic here?

What I would really prefer is that I can enter the code in a UTF16 file, so
that I don't need UTF8 strings to be able to use the RegEx features
correctly. RegEx does not find Umlaut chars using '\w', for example, unless
$KCODE is set to UTF8, and the strings are entered in UTF8 (which my
favorite proogramming editor can not write). Same might apply to Japanese
and Chinese, I don't know how they do enter their MBCS codes in Ruby code.

Christian

"trans. (T. Onoma)" <transami@runbox.com> schrieb im Newsbeitrag
news:200410220910.37792.transami@runbox.com...

> > 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

···

On Friday 22 October 2004 04:49 am, Stefan Schmiedl wrote:
> On Fri, 22 Oct 2004 10:56:34 +0900, > > > > trans. (T. Onoma) <transami@runbox.com> wrote:
Earth will eventually know this language?

T.

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.

···

On Fri, 22 Oct 2004 22:10:41 +0900, trans. (T. Onoma) <transami@runbox.com> wrote:

On Friday 22 October 2004 04:49 am, Stefan Schmiedl wrote:
> On Fri, 22 Oct 2004 10:56:34 +0900, > > trans. (T. Onoma) <transami@runbox.com> wrote:
> > 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?

--
Hazzle free packages for Ruby?
RPA is available from http://www.rubyarchive.org/

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

s.

···

On Fri, 22 Oct 2004 22:10:41 +0900, trans. (T. Onoma) <transami@runbox.com> wrote:

On Friday 22 October 2004 04:49 am, Stefan Schmiedl wrote:

On Fri, 22 Oct 2004 10:56:34 +0900, >> >> trans. (T. Onoma) <transami@runbox.com> wrote:
> 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?

>>
>> 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.

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 :wink:

> 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.

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 :slight_smile:

> 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.

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? :slight_smile:

Regards,

  Michael

···

On Fri, Oct 22, 2004 at 07:49:18PM +0900, Stefan Schmiedl wrote:

On Fri, 22 Oct 2004 18:13:24 +0900, > Michael Neumann <mneumann@ntecs.de> wrote:

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

mine is more convenient:

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? :slight_smile:

not yet ... I can't decide between a custom built minimal system
and forth or a full fledged notebook and squeak :slight_smile:

s.

···

On Sun, 24 Oct 2004 01:11:46 +0900, Michael Neumann <mneumann@ntecs.de> wrote: