2014-07-09 16:13 GMT+02:00 Sven Van Caekenberghe <s...@stfx.eu>:

> Hi Hernán,
>
> On 09 Jul 2014, at 09:11, Hernán Morales Durand <hernan.mora...@gmail.com>
> wrote:
>
> > Hello Sven,
> >
> > I will try to give some feedback for you.
>
> It is good to talk about the contents, the essence.
>
> > My major issue is that the objects you use are pretty basic. There is no
> reason to put limits with so many contributed packages.
>
> Well, I tried to stick with stock Pharo (except for the very last example
> that needs JSON parsing). Yes, some examples make little sense, but they
> each do show something powerful, something that is missing in many
> languages.
>
> I was kind of hoping to get some discussion going with people submitting
> their favourites/alternatives, so that the list of examples could be
> improved/extended. But I am a hard judge ;-)
>
> > Visualizations have impact and you could use Roassal, GraphViz,
> CodeCity, GraphET. SQL is also of interest for many developers. Or Big Data
> which is a requirement now. An example with Spec and DynamicLayout would be
> cool. For reverse engineering there is Moose and you could show an overview
> pyramid maybe? A one-liner with #linesOfCode would be magic :)
>
> Like others said, there could/should be other articles doing something
> similar (giving a couple of cool examples as an overview/introduction),
> focused on the areas/libraries/frameworks you mention. Please feel inspired.
>
> > About the article: When writing sample code with random, don't forget to
> add a paragraph explaining the random source. It is /dev/urandom? To
> randomize a String I write this:
> >
> > (UUID new asString reject: #isDigit) copyWithoutAll: '-'.
>
> Talking about the random source would lead a bit far, no ?
> I don't like your random string example, it is too contrived.
> The one I used is not perfect either, I would probably write it myself as
>
> String
>   new: 256
>   streamContents: [ :string |
>     256 timesRepeat: [ string nextPut: 'abcdef' atRandom ]  ].
>
> But having to write 256 twice is not cool, hence the my other choice.
>
> > To count digits (doesn't work for 1 digit but I like it):
> >
> > 42 factorial log ceiling.
>
> That is cool indeed.
>
> What I wanted to show is that, not only are Pharo numbers real objects
> that can be mixed freely, without thinking about them, but that they are
> more than that: real normal objects that you can add lots of useful methods
> too.
>
> > I don't know how this could be useful besides doing many things: "Split
> a string on dashes, reverse the order of the elements and join them using
> slashes". If you could find a example with some real application would be
> nice too.
>
> Yes indeed, it does not make enough sense. Any ideas ?
>

split - reverse - join

$: join: ($: split:'0A:0B:0C:0D' ) reverse.

convert hex address host/network.


Btw, do we have a single message like split, but split at every nt element?
3 split '123456789' -> '123' '456' '789'








>
> > For Collection messages people is often interested in speed comparisons.
> Because audience already knows how to do that in R, Python or other
> language.
>
> Speed is not the subject of the article. Sure, some operations can
> certainly be done in some other languages but certainly not in all of them,
> out of the box. I would really like to see the standard deviation one (17)
> done in other languages, for example.
>
> > Hope you could find them useful.
>
> Yes ;-)
>
> Sven
>
> > Hernán
> >
> >
> >
> >
> > 2014-07-07 19:21 GMT-03:00 Sven Van Caekenberghe <s...@stfx.eu>:
> > Hi,
> >
> > I have written a new article presenting Pharo using a list of 23 short
> examples.
> >
> >   Elegant Pharo Code
> >
> >   Beautiful & Powerful One-liners, Expressions and Snippets
> >
> >   https://medium.com/@svenvc/elegant-pharo-code-bb590f0856d0
> >
> > As mentioned at the end of the article, I welcome feedback, remarks,
> comments, alternative solutions and other examples. The idea is to create
> yet another way to lure people into exploring Pharo while explaining by
> example why we like Pharo.
> >
> > Enjoy!
> >
> > Sven
> >
> > --
> > Sven Van Caekenberghe
> > Proudly supporting Pharo
> > http://pharo.org
> > http://association.pharo.org
> > http://consortium.pharo.org
> >
> >
> >
> >
> >
> >
>
>
>

Reply via email to