Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: New instead of Make
Pages: [1] Print
Author Topic: New instead of Make  (Read 2783 times)
Edoc
Newbie
*
Offline Offline

Posts: 14


View Profile
New instead of Make
« on: January 10, 2004, 02:43:47 PM »

I've written a handful of utilities, each of which have gone over to an outside vendor for usage & maintenance.

In my code reviews with them, I noticed that the usage of the word 'make was perceived as odd to them (if they had ever used Logo, that wouldn't be the case).

input-str: make string! 100

I'll add that the rules of punctuation in general seemed odd to them (e.g., string!, length?, no punc in 'what-dir).

I've rewritten the 'make assignments as follows, since, as minor as this is, it makes more sense to them.

new: :make
name: new object! [fname: none lname: none]
fella: new name

Strange how coders can get hung up on such a minor thing. Any reason why I should avoid using the word 'new?

 
Logged
GedB
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
New instead of Make
« Reply #1 on: January 10, 2004, 04:42:18 PM »

Seems to me that its a nice feature of Rebol that you can easily play with the vocabulary like this.

I've no idea why make is used rather than new.  Does it really matter?

I've seen programmers do stuff like this, and it always strikes me as a poor cover for there ignorance.

I think if developers could be honest enought to say something like "I am having trouble understanding this unfamiliar syntax" this would be a much nicer field to work in.
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
New instead of Make
« Reply #2 on: January 11, 2004, 03:18:58 AM »

My guess would be that 'make is a verb, whereas 'new is not.
Logged

DideC
Newbie
*
Offline Offline

Posts: 26


View Profile
New instead of Make
« Reply #3 on: January 11, 2004, 08:37:59 AM »

In the philosophie of rebol, graham is right : action must be a verb.

Other reason could be that 'make act on all datatypes. 'new word looks restricted to object OMO  Tongue  
Logged
Gregg
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
New instead of Make
« Reply #4 on: January 11, 2004, 10:18:53 AM »

If you use NEW this way, just be aware that it is used as a word in VID. i.e. it may cause confusion, or issues, if you write styles and want to use it there.
Logged
carloslorenz
Newbie
*
Offline Offline

Posts: 9


View Profile
New instead of Make
« Reply #5 on: January 15, 2004, 06:48:34 AM »

Quote
If you use NEW this way, just be aware that it is used as a word in VID. i.e. it may cause confusion, or issues, if you write styles and want to use it there.
Gregg how do you use NEW word in /View ?
Logged
Gregg
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
New instead of Make
« Reply #6 on: January 16, 2004, 04:23:41 PM »

NEW is used inside VID (not View). If you look at the source for a style that uses custom facets (i.e. look in the words: block in the style def), you'll see NEW referenced. It refers to the face that is in the process of being constructed.
Logged
Gabriele
Full Member
***
Offline Offline

Posts: 182


View Profile WWW
New instead of Make
« Reply #7 on: January 17, 2004, 07:27:02 AM »

Gregg, note however that in face/words you have facets and functions; they're usually defined as func [new args] [...] but of course you could use any name.

As has already been said, the reason why "new" is not a good idea is that it is not a verb.
Logged
-jn-
Newbie
*
Offline Offline

Posts: 4


View Profile
New instead of Make
« Reply #8 on: January 17, 2004, 08:42:44 AM »

Please don't!  ;-)

Having worked with other extensible languages in the past, I strongly recommend that you NOT redefine the commonly-used words of the core language.  It doesn't really add any expressive power; more importantly, it means that your subsequent programs are now written in a "private personal language" which someone else will have more trouble reading!

You may only be writing REBOL for yourself (for personal projects, education, entertainment, etc.), but as soon as you:
    [li]need to ask another REBOL programmer for help
    [li]write something useful that you'd like to share
    [li]collaborate on a project with other REBOL programmers
you'll have to worry about whether you've used such personal language in your code that the other person won't know (or have the definitions for).

In the long run, it's just not worth it.  Learning a programming language is just like learning a natural language in the sense that, to do it well, you really need to know and observe the customs, conventions, and idioms of the existing language community, instead of immediately trying to change everyone else's habits.

Just my $0.02...
Logged
GedB
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
New instead of Make
« Reply #9 on: January 19, 2004, 04:23:44 AM »

As an asside, I've been reeading Betrand Meyer's OOSC2, which uses his language Eiffel.

In Eiffel make is used instead of new, so it isn't unique to REBOL.
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
New instead of Make
« Reply #10 on: January 22, 2004, 05:08:09 AM »

And the venerable and much older language Forth uses create ...
Logged

Edoc
Newbie
*
Offline Offline

Posts: 14


View Profile
New instead of Make
« Reply #11 on: January 26, 2004, 09:55:58 AM »

Good people, thanks to all for the replies.

I will withdraw that superficial construct from the code and tell the developers to "deal with it". It's not a major issue at all, just one that ocurred to me as this Forum was announced.

FYI, I did not redefine the behavior 'make in any way-- as you can tell from the example, I merely assigned an additional word to the value of 'make-- gave it another handle-- a synonym, if you will. 'make would of course be available and continue to function exactly as specified within the core language.

Seems to me that REBOL is designed to permit exactly this sort of (mostly) harmless word-play; some folks might even call it a dialect =^)

JN, I could interpret your argument to be anti-dialects.... not to mention the adoption of new languages (such as REBOL) in general. That's a good-natured troll, of course, so please reply only in "enlightenment mode."

Thanks again.
Logged
-jn-
Newbie
*
Offline Offline

Posts: 4


View Profile
New instead of Make
« Reply #12 on: January 26, 2004, 11:12:41 AM »

Re "anti-dialect" or (anti-new-language),  I very specifically limited my comments to *RE*-defining "the commonly-used words of the core language".  Creating a dialect (or just defining a function, for that matter) which *adds* functionality not built into the core language, is an entirely different matter (and I agree that being able to do so is one of the nicest aspects of the REBOL language).

FWIW, this is essentially the same issue as in the early days of c when lots of former Pascal programmers wanted to put

#define BEGIN {
#define END }

at the beginning of all of their c programs!  ;-)
Logged
Edoc
Newbie
*
Offline Offline

Posts: 14


View Profile
New instead of Make
« Reply #13 on: January 26, 2004, 12:06:01 PM »

JN--
Thanks for the clarification. I couldn't resist poking that into the conversation.

REBOL is a language that let's you break so many rules. It often strikes me as funny when people say: "code like this" or "style like that" because REBOL seems to so willfully bend away from convention.

For this reason I often think of REBOL as a personal programming language. It's not really designed for working with teams of programmers and besides, a single programmer can command such a broad perimeter of functionality.

Maybe this says something about REBOL programmers: those who are attracted to it (thus far) are rugged individualists & non-conformists. Perhaps this is why REBOL seems to be a cloistered community.
Logged
Gregg
Newbie
*
Offline Offline

Posts: 26


View Profile WWW
New instead of Make
« Reply #14 on: January 26, 2004, 05:54:53 PM »

Quote
For this reason I often think of REBOL as a personal programming language. It's not really designed for working with teams of programmers and besides...

I agree, and I disagree. :-) It's definitely a great personal language, but I think--once we get the hang of it--we'll see it used by teams in the same way, bent to their will and style. It's all about communication after all.
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Code Examples, Tips & Advice  |  Topic: New instead of Make
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 05, 2008, 11:35:53 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2233 Posts in 581 Topics by 1854 Members
Latest Member: Vqxykkpz

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc