Live data from Hacker News

Pharo: A malleable and powerful platform

slideshare.net

21–30 of 51 posts

Re: Pharo: A malleable and powerful platform

#21
post #17

Earlier quoted context omitted.

AFAIK there's no keyboard shortcut that selects the whole block (taking block to mean a multi-line chunk of code, rather than a closure). What you can do is put empty (or even non-empty!) comments between chunks of code, double-click just after the comment and everything up to (but not including) the start of the next comment will be selected. "" myFoo do: [:each | each bar ] "" ... and so on. Many years ago someone…

you dont need to do that as I replied above. Using my approach will automagically select the whole block and evaluate it without having to touch the mouse.

Thanks.

Re: Pharo: A malleable and powerful platform

#22
post #8

Earlier quoted context omitted.

Seaside is one approach, there is also Aida-Web. Those are implemented in pharo. with Amber you can use also node.js if you want. And any server side node.js library you can get your hands on. Amber can use any js library. You could even mix amber, pharo , node.js and seaside / aida-web .Sky is the limit. Its up to you which specific approach you will choose. You definitely have loads of options.

I had a shot at Aida-Web, not my cup of tea. Does the job though. Amber is another beast, and is a very good option for single page web apps. Can do proxying of JavaScript objects, so you can harness whatever you like in your code and use the JS API the Smalltalk way. Which is kind of cool. With the Helios IDE, it is a killer. Needs a while to master but worth the time.

What you did not like about Aida-Web ? I am no web dev ( I prefer GUIs , graphics and sound) myself just curious.

Re: Pharo: A malleable and powerful platform

#23
post #19
post #15

Side-topic question: is anything from the Smalltalk OO model that hadn't made its way into Ruby? I know that Matz took lots of ideas from Smalltalk when he created Ruby, but I wonder if there are any good OO model related things he didn't adopt. I don't mean the whole image based and IDE in the program thing, I know this is something only Smalltalk has.

Does Ruby have traits ? http://pharo.gemtalksystems.com/book/LanguageAndLibraries/Tr...

Well, isn't the use case for traits the same as for mixins? (http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_module...)

Re: Pharo: A malleable and powerful platform

#24
post #15

Side-topic question: is anything from the Smalltalk OO model that hadn't made its way into Ruby? I know that Matz took lots of ideas from Smalltalk when he created Ruby, but I wonder if there are any good OO model related things he didn't adopt. I don't mean the whole image based and IDE in the program thing, I know this is something only Smalltalk has.

Less verbose syntax.

Indeed. But I would'n consider this a "feature" though: the easiest to read syntax I've seen is that of Python, with the "classic" (by classic I mean "C++/Java like") `.` and `(` clearly separating the message receiver, message name, and message parameters, plus indentation based syntax - nothing beats this combo for quickly scanning foreign code, even without syntax highlighting :)

Re: Pharo: A malleable and powerful platform

#25
post #23
post #19

Earlier quoted context omitted.

Does Ruby have traits ? http://pharo.gemtalksystems.com/book/LanguageAndLibraries/Tr...

Well, isn't the use case for traits the same as for mixins? ( http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_module... )

yeap definitely looks like it. I would not be surprised if Python has something similar too.

For me OO is not the big reason to use smalltalk. For me the biggest reason is the whole live coding environment which is a big plus for workflow and speed of development. But maybe other smalltalkers could chime in with features I am not aware of.

Also Pharo has Pooldictionaries , which are doing the same thing Traits are doing for methods , for instance variables. Probably Ruby has something similar too.

I really think highly of Ruby , its a really powerful language. The reason why I chose python instead is that I can't stand the "Pearl" syntax. All these weird symbols etc. Definitely not my thing and make code less readable to me.

But as a language Ruby looks great to me. So definitely would not recommend against learning it :)

Re: Pharo: A malleable and powerful platform

#26
post #24

Earlier quoted context omitted.

Less verbose syntax.

Indeed. But I would'n consider this a "feature" though: the easiest to read syntax I've seen is that of Python, with the "classic" (by classic I mean "C++/Java like") `.` and `(` clearly separating the message receiver, message name, and message parameters, plus indentation based syntax - nothing beats this combo for quickly scanning foreign code, even without syntax highlighting :)

I am python coder. Smalltalk is much more readable than Python and so is Lisp.

I dont know why you think dots and parentheses make things easier to read. Maybe its a matter of preferences , but even though I have grown up with this style , I dont find it more readable than smalltalk.

I dont see

Door.open(1,3,30)

as more readable to

Door open: 1 times: 3 andCloseAfterMilliseconds: 30

And this is exactly how python code works and how smalltalk works too. Also smalltalk culture is oriented towards clean code alot more than python world. You will rarely see methods in pharo more than a few lines long. And if you do , is most likely that code has not been cleaned up. And I find that a huge plus even more than the syntax itself.

Of course if I had to choose without smalltalk, then python would be my first choice for readability. But still nowhere near as to how easy I understand smalltalk , even though I am using it for less than a year.

Re: Pharo: A malleable and powerful platform

#27
post #26
post #24

Earlier quoted context omitted.

Indeed. But I would'n consider this a "feature" though: the easiest to read syntax I've seen is that of Python, with the "classic" (by classic I mean "C++/Java like") `.` and `(` clearly separating the message receiver, message name, and message parameters, plus indentation based syntax - nothing beats this combo for quickly scanning foreign code, even without syntax highlighting :)

I am python coder. Smalltalk is much more readable than Python and so is Lisp. I dont know why you think dots and parentheses make things easier to read. Maybe its a matter of preferences , but even though I have grown up with this style , I dont find it more readable than smalltalk. I dont see Door.open(1,3,30) as more readable to Door open: 1 times: 3 andCloseAfterMilliseconds: 30 And this is exactly how python cod…

Definitely a matter of taste then. The other think I like about Python and why I find it more readable is the usage of snake_case instead of camelCase. I'd take

    Door.open(1, times=3, close_after_ms=30)
over

    Door open: 1 times: 3 andCloseAfterMilliseconds: 30
anytime :)

Re: Pharo: A malleable and powerful platform

#28
post #25
post #23

Earlier quoted context omitted.

Well, isn't the use case for traits the same as for mixins? ( http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_module... )

yeap definitely looks like it. I would not be surprised if Python has something similar too. For me OO is not the big reason to use smalltalk. For me the biggest reason is the whole live coding environment which is a big plus for workflow and speed of development. But maybe other smalltalkers could chime in with features I am not aware of. Also Pharo has Pooldictionaries , which are doing the same thing Traits are do…

Python has good multiple inheritance and as far as I've seen most sane people just use it to "emulate" mixins and even name their secondary parent classes like Feature1Mixin or DoesYTrait.

Traits seem like a great idea, but the only other language where I've seen it under the Smalltalk name of "trait" is... brace yourself :) ...PHP 5.4+.

Re: Pharo: A malleable and powerful platform

#29
post #23
post #19

Earlier quoted context omitted.

Does Ruby have traits ? http://pharo.gemtalksystems.com/book/LanguageAndLibraries/Tr...

Well, isn't the use case for traits the same as for mixins? ( http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_module... )

There are a few subtle, important differences...

Check out the original paper and they should become apparent:

http://web.cecs.pdx.edu/~black/publications/TR_CSE_02-013.pd...

Re: Pharo: A malleable and powerful platform

#30
post #27
post #26

Earlier quoted context omitted.

I am python coder. Smalltalk is much more readable than Python and so is Lisp. I dont know why you think dots and parentheses make things easier to read. Maybe its a matter of preferences , but even though I have grown up with this style , I dont find it more readable than smalltalk. I dont see Door.open(1,3,30) as more readable to Door open: 1 times: 3 andCloseAfterMilliseconds: 30 And this is exactly how python cod…

Definitely a matter of taste then. The other think I like about Python and why I find it more readable is the usage of snake_case instead of camelCase. I'd take Door.open(1, times=3, close_after_ms=30) over Door open: 1 times: 3 andCloseAfterMilliseconds: 30 anytime :)

doable with smalltalk too

Door open: 1 times: 3 and_close_after_ms: 30

also please note here, that python does not usually use keyword arguments. Unless for cases of optional arguments.

So the python you wrote is completely doable of course, BUT not that used as often. So it will be Door.open(1,3,30) a lot more than Door.open(1, times=3, close_after_ms=30).

This is where smalltalk shines, its culture. Those code habits that make a difference. Especially when you have to read tons of code.

When you read message send, you can understand easily what that message sent is doing. While a Door.open(1,3,30) will not reveal exactly what the method is doing. Or what that arguments mean and you will have to look into the documentation to figure things out.

This emphasis on workflow is what set for me smalltalk apart from other programming languages and enviroments. Its not a preference thing, its actually 100% practical and easily measured as workflow enhancement. And keyword arguments based coding is just one of the enhancements that smalltalk offers.

Post reply on HN