Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

What's wrong with Ruby

 [1/22] from: Michael_Chean:msn at: 21-Mar-2007 14:04


Interesting article... http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby<http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby>

 [2/22] from: tim-johnsons:web at: 21-Mar-2007 14:42


On Wednesday 21 March 2007 21:04, Michael Chean wrote:
> Interesting article... > http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby<http://www.bitwisemag.co >m/2/What-s-Wrong-With-Ruby>
I'm more interested in what's right than what's wrong. :-) :-( and why wasn't rebol mentioned. I use rebol and python about 50/50. Despite what is said in that article, I find python impressively well and thoughtfully designed, but it takes more code than rebol to get things done. BTW the python 2.5 executable on linux is 4136308, compared to 332052 for rebol/core - that's 12.456* greater hit on system resources. tim -- Tim Johnson <tim-johnsons-web.com> Palmer, Alaska, USA

 [3/22] from: Michael_Chean:msn at: 21-Mar-2007 15:44


Yes that was my thought as well... why wasn't rebol mentioned or even on the raidar? Open source status is my guess.. But elegance is a big concern of mine. I'm looking for languages that are fun to work in, and part of that is how expressive they are. Mike ----- Original Message ----- From: Tim Johnson<mailto:tim-johnsons-web.com> To: rebolist-rebol.com<mailto:rebolist-rebol.com> Sent: Wednesday, March 21, 2007 7:42 AM Subject: [REBOL] Re: What's wrong with Ruby On Wednesday 21 March 2007 21:04, Michael Chean wrote:
> Interesting article... > http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby<http://www.bitwisemag.co<http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby%3Chttp://www.bitwisemag.co> >m/2/What-s-Wrong-With-Ruby>
I'm more interested in what's right than what's wrong. :-) :-( and why wasn't rebol mentioned. I use rebol and python about 50/50. Despite what is said in that article, I find python impressively well and thoughtfully designed, but it takes more code than rebol to get things done. BTW the python 2.5 executable on linux is 4136308, compared to 332052 for rebol/core - that's 12.456* greater hit on system resources. tim -- Tim Johnson <tim-johnsons-web.com<mailto:tim-johnsons-web.com>> Palmer, Alaska, USA -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.

 [4/22] from: moliad::gmail::com at: 21-Mar-2007 18:09


hi all, I had a little bit of time for my monthly rant ;-) ... so I decided to apply it to "reviewing languages". when I read the Article (and most comments to it) Its funny how people judge languages, based on their skill set and current knowledge rather than on the pros and cons of specific capabilities when paired to each other (or not). And most importantly, the language's intended style. the author of that article clearly has one skill set and specific uses for programming. For example, he is accademic first and foremost AFAICT, and didn't seem to adapt his programming "style" to ruby's paradigm. people who learn stuff, usually stick with the things they know as "right" and then by lack of learning ability, time or interest, will just position themselves along/against a language with their previous paradigm as the center of the right world. here we see one individual who (I do not try to undermine the skill and intelligence) clearly designs and maps his applications in a specific unchanging way. in what he explains, by flushing out functions and their argument datatypes. so if you allow types to change, he is distabilised in trying to clearly define anything. thus he views the lack of static typing as a con of ruby. he also has a clear cut definition of what an object is, does, and how one must be used. He is weary of self-modifying code. ahem. to me, he really comes accross like a person used to be workin in the bounds of compilation. I do give him credit for being thorough though and giving some explanations behind why he likes/dislikes the language. He also clearly has a lot of background in languages and all. so I value his opinion but I don't really value his evaluation of ruby itself. what I don't like is the fact that in almost every review of the kind, people do not adapt their programming style to the language. they try to program a square hole with a round peg. that obviously never works. For example, when coding in REBOL vs python, all the program flow will be different. each allows its own strenghts, so you must ply yourself to the language, otherwise, you're just waisting your time. Rebol is slender, agile and fast.. then you get hit by a branch, and you are KO. one blow and you're out then you have to find a way to plow through the branch. python and C are juggenaughts ... slowly but most definitely, there are no walls, they just plough thru. try to explain this single line to most non REBOLERS: a: if arg [red] which assigns none to 'a when arg has no value and most programmers of most language will wonder how 'a even gets assigned! then the natural review will be.. hell, rebol is not clean, you can put your assignment outside of your conditionals and statements, this is not proper! but they miss the fact that this scales... like so: color: any [ all [arg arg2 green] if arg [red] if arg2 [black] purple ] the above 6 lines are chaos to implement in most languages with a heavy dose of nested if then (maybe even case) statements and multiple lines of repetitive assignment code, add one arg and it just gets panicy. if someone tries out REBOL and isnt' instantly "impressed" by its syntax (or lack off) he will usually say it looks ugly and its unclear... yet, will they then really go further and ask why? did this fellow go further than say its not static typed, so that's bad? He said why he didn't like it, but he didn't give the reason WHY it isn't static typed ... so probably really didn't really try to change his programming habits in favor of ruby, there probably is a good reason why type is not static (which is most definitely not code looks). In REBOL, for example, this single detail is intrinsic of the concept of the universality of series manipulation and dialects. and is one of the main features of the language, one of the core elegances of its ease of use and simplicty... word type is as much meaning as word content or value. Dialects use type to infer meaning, many funcs use type to adapt their handling. The fact that each series type in python has its own interface of differently named methods and members drives me (and others) mad! but then, can I argue against the fact that any compiled C/C++ code is usable natively in minutes in python? so, this all being said, I think REBOL has made me (and many others) a lot more critic of the actual syntax of languages. Carl hasn't tried to build the purest language, but the most consistent sweetspot amongst many competing philosophies and concepts. every decision was weighed heavily and i don't think a lot of "fanatism" about any one paradigm has disturbed the overall vision. btw, I'm just having fun stiring all of you up ;-) -MAx On 3/21/07, Michael Chean <Michael_Chean-msn.com> wrote:

 [5/22] from: moliad:gmai:l at: 21-Mar-2007 18:14


but Tom, that is not fair... When you open up the core python, you don't even have string functions (v2.3) ! Every single application needs to open up quite a few libs for even very basic functionality. So if you add up all of those module's binaries on top of that... you'll get quite a higher figure. sockets, dates, files, tcl/tk, and the list goes on and on... -MAx On 3/21/07, Michael Chean <Michael_Chean-msn.com> wrote:

 [6/22] from: moliad:g:mail at: 21-Mar-2007 18:21


On 3/21/07, Tim Johnson <tim-johnsons-web.com> wrote:
> I use rebol and python about 50/50. Despite what is said in > that article, I find python impressively well and thoughtfully designed, > but it takes more code than rebol to get things done. >
hi tom, did you end up creating a few of the REBOL practical funcs within python like I did and reduce code size by a few steps? select, rejoin, all, any, view layout... come to mind as a few which simplified much of my python coding where I used to work. -MAx

 [7/22] from: Michael_Chean:msn at: 21-Mar-2007 16:23


Those would be nice to see. ----- Original Message ----- From: Maxim Olivier-Adlhoch<mailto:moliad-gmail.com> To: rebolist-rebol.com<mailto:rebolist-rebol.com> Sent: Wednesday, March 21, 2007 4:21 PM Subject: [REBOL] Re: What's wrong with Ruby On 3/21/07, Tim Johnson <tim-johnsons-web.com<mailto:tim-johnsons-web.com>> wrote:
> I use rebol and python about 50/50. Despite what is said in > that article, I find python impressively well and thoughtfully designed, > but it takes more code than rebol to get things done. > >
hi tom, did you end up creating a few of the REBOL practical funcs within python like I did and reduce code size by a few steps? select, rejoin, all, any, view layout... come to mind as a few which simplified much of my python coding where I used to work. -MAx -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.

 [8/22] from: Michael_Chean:msn at: 21-Mar-2007 16:25


Maybe so... but in his 2nd to last paragraph: Despite what I've written above, I didn't find Ruby horrible. If I needed to use a scripting language, it's the one I would now use. It's cleaner than Perl, and I like its syntax better than Python. ----- Original Message ----- From: Maxim Olivier-Adlhoch<mailto:moliad-gmail.com> To: rebolist-rebol.com<mailto:rebolist-rebol.com> Sent: Wednesday, March 21, 2007 4:09 PM Subject: [REBOL] Re: What's wrong with Ruby hi all, I had a little bit of time for my monthly rant ;-) ... so I decided to apply it to "reviewing languages". when I read the Article (and most comments to it) Its funny how people judge languages, based on their skill set and current knowledge rather than on the pros and cons of specific capabilities when paired to each other (or not). And most importantly, the language's intended style. the author of that article clearly has one skill set and specific uses for programming. For example, he is accademic first and foremost AFAICT, and didn't seem to adapt his programming "style" to ruby's paradigm. people who learn stuff, usually stick with the things they know as "right" and then by lack of learning ability, time or interest, will just position themselves along/against a language with their previous paradigm as the center of the "right" world. here we see one individual who (I do not try to undermine the skill and intelligence) clearly designs and maps his applications in a specific unchanging way. in what he explains, by flushing out functions and their argument datatypes. so if you allow types to change, he is distabilised in trying to clearly define anything. thus he views the lack of static typing as a con of ruby. he also has a clear cut definition of what an object is, does, and how one must be used. He is weary of self-modifying code. ahem. to me, he really comes accross like a person used to be workin in the bounds of compilation. I do give him credit for being thorough though and giving some explanations behind why he likes/dislikes the language. He also clearly has a lot of background in languages and all. so I value his opinion but I don't really value his evaluation of ruby itself. what I don't like is the fact that in almost every review of the kind, people do not adapt their programming style to the language. they try to program a square hole with a round peg. that obviously never works. For example, when coding in REBOL vs python, all the program flow will be different. each allows its own strenghts, so you must ply yourself to the language, otherwise, you're just waisting your time. Rebol is slender, agile and fast.. then you get hit by a branch, and you are KO. one blow and you're out then you have to find a way to plow through the branch. python and C are juggenaughts ... slowly but most definitely, there are no walls, they just plough thru. try to explain this single line to most non REBOLERS: a: if arg [red] which assigns none to 'a when arg has no value and most programmers of most language will wonder how 'a even gets assigned! then the natural review will be.. hell, rebol is not clean, you can put your assignment outside of your conditionals and statements, this is not proper! but they miss the fact that this scales... like so: color: any [ all [arg arg2 green] if arg [red] if arg2 [black] purple ] the above 6 lines are chaos to implement in most languages with a heavy dose of nested if then (maybe even case) statements and multiple lines of repetitive assignment code, add one arg and it just gets panicy. if someone tries out REBOL and isnt' instantly "impressed" by its syntax (or lack off) he will usually say it looks ugly and its unclear... yet, will they then really go further and ask why? did this fellow go further than say its not static typed, so that's bad? He said why he didn't like it, but he didn't give the reason WHY it isn't static typed ... so probably really didn't really try to change his programming habits in favor of ruby, there probably is a good reason why type is not static (which is most definitely not code looks). In REBOL, for example, this single detail is intrinsic of the concept of the universality of series manipulation and dialects. and is one of the main features of the language, one of the core elegances of its ease of use and simplicty... word type is as much meaning as word content or value. Dialects use type to infer meaning, many funcs use type to adapt their handling. The fact that each series type in python has its own interface of differently named methods and members drives me (and others) mad! but then, can I argue against the fact that any compiled C/C++ code is usable natively in minutes in python? so, this all being said, I think REBOL has made me (and many others) a lot more critic of the actual syntax of languages. Carl hasn't tried to build the purest language, but the most consistent sweetspot amongst many competing philosophies and concepts. every decision was weighed heavily and i don't think a lot of "fanatism" about any one paradigm has disturbed the overall vision. btw, I'm just having fun stiring all of you up ;-) -MAx On 3/21/07, Michael Chean <Michael_Chean-msn.com<mailto:Michael_Chean-msn.com>> wrote:
> Interesting article... > http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby<http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby>< > http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby<http://www.bitwisemag.com/2/What-s-Wrong-With-Ruby>> > -- > To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject. > >
-- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.

 [9/22] from: gregg:irwin::gmail at: 21-Mar-2007 17:37


Well said Max. I particularly like this bit: Rebol is slender, agile and fast.. then you get hit by a branch, and you are KO. one blow and you're out then you have to find a way to plow through the branch. python and C are juggenaughts ... slowly but most definitely, there are no walls, they just plough thru. I might have to borrow that sometime. :) --Gregg

 [10/22] from: moliad::gmail at: 21-Mar-2007 18:58


thanks! :-) But I think "plow through the branch" should be "cut through" or something ugly like that. -MAx On 3/21/07, Gregg Irwin <gregg.irwin-gmail.com> wrote:

 [11/22] from: gregg:irwin:gma:il at: 21-Mar-2007 18:02


Hi Maxim, MOA> But I think "plow through the branch" should be "cut through" or MOA> something ugly like that. Yeah. I'm still not seeing my own posts from the ML though (in case you're watching, TomC :). --Gregg

 [12/22] from: moliad:gmai:l at: 21-Mar-2007 19:10


Hi Gregg, my bet is that you are mixed up by gmail's threading... I was pretty confused too. when you create a thread, it remains in your sent mail... gmail recognises your sent and received mail as one and the same by its headers! so the Mailing List reply never gets to your inbox. once someone replies, it becomes a conversation, so then it switches to the inbox. I am about to try deleting my sent mails to the ML so that the reply is properly received... if only we could apply filters to more than only incomming mails. :-( similarily, when you create the thread, the [REBOL] tag never gets applied to the subject, cause gmail's threading uses the first mail as the subject for any given conversation thread. When you pop up the "show details" then you might see the [REBOL] tag for that specific mail. is this what you have experienced? -MAx On 3/21/07, Gregg Irwin <gregg.irwin-gmail.com> wrote:

 [13/22] from: tim-johnsons:web at: 21-Mar-2007 16:54


On Wednesday 21 March 2007 23:21, Maxim Olivier-Adlhoch wrote:
> On 3/21/07, Tim Johnson <tim-johnsons-web.com> wrote: > > I use rebol and python about 50/50. Despite what is said in > > that article, I find python impressively well and thoughtfully designed, > > but it takes more code than rebol to get things done. > > hi tom, did you end up creating a few of the REBOL practical funcs within > python like I did and reduce code size by a few steps?
Tim here :-). I did where applicable, of course python doesn't work with symbols....
> select, rejoin, all, any, view layout... come to mind as a few which > simplified much of my python coding where I used to work.
And extract, first, second, third etc. <grin> but then I wrote slice functions for rebol.. And a 'yield function for rebol, which I use extensively. I've got several python books here. Some make glowing references to the influence of lisp on python. Personally, I think rebol is much more influenced by lisp than is python. I believe that what the writers refer to is the generic function approach, where the behavior of a python class instance can be modified by a special method which links to a python function. Example: __repr__ => print. tj
> -MAx
-- Tim Johnson <tim-johnsons-web.com> Palmer, Alaska, USA

 [14/22] from: pwawood::gmail at: 22-Mar-2007 8:55


Hi Gregg I'm pretty sure that it isn't the ML that doesn't return your own posts, its some cleverness at GMail. They obviously don't think we need the reassurance of seeing our own posts. I get exactly the same behaviour when using yahoogroups from gmail. Regards Peter On Thursday, March 22, 2007, at 08:02 am, Gregg Irwin wrote:

 [15/22] from: moliad:gmai:l at: 21-Mar-2007 20:02


On 3/21/07, Tim Johnson <tim-johnsons-web.com> wrote:
> On Wednesday 21 March 2007 23:21, Maxim Olivier-Adlhoch wrote: > > On 3/21/07, Tim Johnson <tim-johnsons-web.com> wrote:
<<quoted lines omitted: 8>>
> Tim here :-). I did where applicable, of course python doesn't work > with symbols....
oops ! :-)
> > select, rejoin, all, any, view layout... come to mind as a few which > > simplified much of my python coding where I used to work. > > And extract, first, second, third etc. > <grin> but then I wrote slice functions for rebol.. And a 'yield > function for rebol, which I use extensively.
I wish Carl would heed my notes on (any) slice notations for rebol... its about 1/2 of what is good in python ;-) I've got several python books here. Some make glowing references
> to the influence of lisp on python. Personally, I think rebol is much > more influenced by lisp than is python. I believe that what the > writers refer to is the generic function approach, where the behavior > of a python class instance can be modified by a special method which > links to a python function. Example: __repr__ => print.
that's the other half, ;-) accessors... yes.. you can implement any of the get/set/print/etc as you want virtually on any instance which is very nice since you integrate new classes paradigms directly within the language's natural workflow. Where I used to work, I had done tests which would set attributes of other objects (for statistics) when you'd do inst.member value usage of the of the instances was completely invisible in the code. this is VERY powerfull. Carl sort of hinted at some limited form of this for R3, but I wish we had access to ALL of REBOL's accessors. (first, insert, get, set, etc) -MAx

 [16/22] from: Izkata:Comcast at: 21-Mar-2007 20:39


Might also be the mailing list itself acting a bit strange that's adding to gmail's confusion - I didn't get the post that started this thread until about 6 hours 20 minutes after I got one of the replies. On Wed, 2007-03-21 at 19:10 -0500, Maxim Olivier-Adlhoch wrote:

 [17/22] from: moliad:gma:il at: 21-Mar-2007 20:43


Hi Izkata, I think that is smtp network latency (maybe localised at your end), as I am receiving most of the posts in a few seconds on my other ML account these days. I've had mails sent to people that arrived 2 days later out of sync (sent directly, not on a ML). -MAx On 3/21/07, Izkata <Izkata-comcast.net> wrote:

 [18/22] from: btiffin:rogers at: 22-Mar-2007 0:23


Well stirred Max, My counter to any lang vs lang discussions is the same answer I use for people. I've never met a programming language I didn't like...until it was too late. To be honest, I have yet to meet a programming language I don't "like", or at least respect. If you can't write it in awk, try COBOL. COBOL too suity? Well the cool kids write C. Pants hanging down too far for your liking? Try BASIC... and on the story goes. Sorry for wasting your time, while I waste mine. btiffin On Wednesday 21 March 2007 19:09, Maxim Olivier-Adlhoch wrote:

 [19/22] from: Paavo:Nevalainen:saunalahti:fi at: 26-Mar-2007 15:58


I taught students some basic principles of programming, including concepts of algorithm, function, and such. One result of the course was list of small programing tasks implemented in various languages. An example was to pseudonymize one's name with these rules: 1) invert all words 2) initial letters to capitals 3) sort the shortest ones first As you see, Perl equivalent is not done. You can add it and post to me, if you wish. The codes do not have exactly same behaviour when input is completely odd (more than one capital letter per word, too short words and such). ;---------------------- Rebol equivalent --------------- do load %aids.r pseudonymize: function [ fullname [string!] ][ names ][ names: parse lowercase reverse copy fullname "" names: map func [x][ return uppercase/part x 1 ] names sort/compare names func [x y][(length? x) < length? y] return rejoin fill-in-between names " " ] ; fill-in-between left as an exercise to the reader ;) test: does [ print pseudonymize ask "Your name: " ; An example: pseudonymize "Masutatsu Oyjama bin Laden" ; --> "Nib Nedal Amajyo Ustatusam" ] -- Lua equivalent -------------------------------- function pseudonymize(name) name0= string.reverse(string.lower(name)) words= {} for w in string.gmatch(name0, "%a+") do words[#words + 1]= string.upper(string.sub(w,1,-#w)) .. string.sub(w,2,-1) end table.sort(words, function(w1,w2) return #w1 < #w2 end) return table.concat(words, " ") end -- test: print( pseudonymize("Veronica von Wassenshaft")) -- result: "Nov Acinerov Tfahsnessav" # Ruby: ----------------------------------------- def pseudonymize(name) names= Array.[] name.reverse.downcase.each(' ') { |s| names << s.chomp(" ").capitalize } names.sort {|x,y| x.length <=> y.length} names= names.reverse out= "" names.each {|x| out << x << " "} out.chomp(" ") end p pseudonymize("Abu Baba Imaam") # Python equivalent ------------------------------------ def pseudonymize(name): name= string.join(list(name.lower()).reverse())) Words= [] for word in string.split(name): word= word[1:1].upper() + word[2:] return string.join(words) Perl -------------------------------- ?? not done yet, do it yourself please ??

 [20/22] from: Michael_Chean:msn at: 26-Mar-2007 10:13


It would be interesting to see some of the other examples ----- Original Message ----- From: Paavo Nevalainen<mailto:Paavo.Nevalainen-saunalahti.fi> To: rebolist-rebol.com<mailto:rebolist-rebol.com> Sent: Monday, March 26, 2007 5:58 AM Subject: [REBOL] Re: What's wrong with Ruby I taught students some basic principles of programming, including concepts of algorithm, function, and such. One result of the course was list of small programing tasks implemented in various languages. An example was to pseudonymize one's name with these rules: 1) invert all words 2) initial letters to capitals 3) sort the shortest ones first As you see, Perl equivalent is not done. You can add it and post to me, if you wish. The codes do not have exactly same behaviour when input is completely odd (more than one capital letter per word, too short words and such). ;---------------------- Rebol equivalent --------------- do load %aids.r pseudonymize: function [ fullname [string!] ][ names ][ names: parse lowercase reverse copy fullname "" names: map func [x][ return uppercase/part x 1 ] names sort/compare names func [x y][(length? x) < length? y] return rejoin fill-in-between names " " ] ; fill-in-between left as an exercise to the reader ;) test: does [ print pseudonymize ask "Your name: " ; An example: pseudonymize "Masutatsu Oyjama bin Laden" ; --> "Nib Nedal Amajyo Ustatusam" ] -- Lua equivalent -------------------------------- function pseudonymize(name) name0= string.reverse(string.lower(name)) words= {} for w in string.gmatch(name0, "%a+") do words[#words + 1]= string.upper(string.sub(w,1,-#w)) .. string.sub(w,2,-1) end table.sort(words, function(w1,w2) return #w1 < #w2 end) return table.concat(words, " ") end -- test: print( pseudonymize("Veronica von Wassenshaft")) -- result: "Nov Acinerov Tfahsnessav" # Ruby: ----------------------------------------- def pseudonymize(name) names= Array.[] name.reverse.downcase.each(' ') { |s| names << s.chomp(" ").capitalize } names.sort {|x,y| x.length <=> y.length} names= names.reverse out= "" names.each {|x| out << x << " "} out.chomp(" ") end p pseudonymize("Abu Baba Imaam") # Python equivalent ------------------------------------ def pseudonymize(name): name= string.join(list(name.lower()).reverse())) Words= [] for word in string.split(name): word= word[1:1].upper() + word[2:] return string.join(words) Perl -------------------------------- ?? not done yet, do it yourself please ?? -- To unsubscribe from the list, just send an email to lists at rebol.com with unsubscribe as the subject.

 [21/22] from: gregg:pointillistic at: 26-Mar-2007 10:21


Hi Paavo, PN> I taught students some basic principles of programming, PN> including concepts of algorithm, function, and such. One PN> result of the course was list of small programing tasks PN> implemented in various languages. That's great! When discussing REBOL, particularly if you want to touch on Forth, discuss vocabularies. This is applicable to all languages of course, and leads into API and language design. The concept of building up a vocabulary, then using that to write the program is central to Forth, and works very well in REBOL. e.g. split: func [string /with dlm] [parse string dlm] sort-by-length: func [series] [ sort/compare series func [x y] [(length? x) < length? y] ] capitalize: func [string] [uppercase/part string 1] cap-all: func [series] [foreach val series [capitalize val] series] pseudonymize: func [full-name [string!]] [ reform sort-by-length cap-all split reverse lowercase full-name ] The point is not that these common functions should be built in, but that maybe they're left out because you're going to need slight variations on them in different programs. So it's not about code reuse, but about writing new code that is designed specifically for a given program, in order to make that program clearer and more elegant in the end. Another topic this can lead to is functional programming, and the execution order of code. Being able to re-order code is often helpful, and can aid readability; and sometimes a process just makes more sense when you see it done in a certain order. e.g. I can reorder some calls without changing the result and, with a one-line solution like this my brain might say (with my verbose switch on) "Ah! The result is a string because REFORM is first, and a string coming in...oh, there's a SPLIT in the middle, so left of that are block ops, and right of it are string ops." pseudonymize: func [full-name [string!]] [ reform cap-all sort-by-length split lowercase reverse full-name ] OTOH, I can say in all honesty that there are times one-liners like this can be so dense with functionality that it takes a bit of effort to tease them apart and really understand them. :) -- Gregg

 [22/22] from: w_a_x_man:yah:oo at: 27-Mar-2007 13:31


--- Paavo Nevalainen <Paavo.Nevalainen-saunalahti.fi> wrote:
> I taught students some basic principles of programming, > including concepts of algorithm, function, and such. One
<<quoted lines omitted: 21>>
> end > p pseudonymize("Abu Baba Imaam")
def pseudonymize(name) name.split.map{|s| s.reverse.capitalize}. sort_by{|s| s.size}.join(' ') end puts pseudonymize( "Veronica von Wassenshaft" ) ____________________________________________________________________________________ Don't get soaked. Take a quick peek at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted