Arquivo da categoria: Smalltalk

Pharo By Example 5

Book Updated

Pharo By Example 5 is a new, updated version of Pharo By Example for Pharo 5. This book is the ideal introduction for anyone starting with Pharo, as well as a very useful reference for more experienced developers. The print version of this important community resource is still under work but the PDF is fully stable and released.

http://files.pharo.org/books/updated-pharo-by-example/

Pharo MOOC downloads e portal

s70kf

Links:

Live Twitter Analysis and Visualization

Get list names from a Trello board with Pharo

trello3pharo-pic

English | Français | Español

Tenho um board no Trello denominado GTD. Veio a necessidade de listar os nomes das listas (lists) que tenho lá. No Trello não se consegue obter esta lista a não ser que se use a sua API. Resolvi então combinar a capacidade do Pharo e sua biblioteca Zinc com a API do Trello para criar um exemplo de como obter esta lista. O resultado deste pequeno esforço está no file out publicado em Shared Smalltalk Workspace M8PL4EBD9HXC.

Os valores hard coded para a API Key e Token do Trello são fakes. Substitua os seguindo as instruções em How to create Trello Cards from the Command Line. Para obter os nomes das listas no board desejado usamos a documentação na seção GET /1/boards/[board_id]/lists da API.

SmallBDD announcement

cucumber

SmallBDD.png

SmallBDD é um nascente framework implementado em Smalltalk inspirado no Cucumber.

Smalltalk é uma linguagem onde a expressividade de uma DSL interna dispensa a complicação associada ao desenvolvimento de DSL externas envolvendo o uso de parsers.

Para executar os cenários descritos acima o desenvolvedor implementa as definições (step definitions no jargão do Cucumber) como abaixo:

SmallBDD2SmallBDD3

O projeto está publicado no Smalltalkhub.

Nota: Estou me baseando principalmente na edição de 2012 do The Cucumber Book.

hwcuc_xlargecover

Meu retorno ao BDD (Veja outros posts meus sobre o BDD), cujo valor para equipes interagindo com usuários do negócio me parece inegável, vem também de ver algum valor para organizar o trabalho mesmo quando temos que simular os interesses de usuários abstratos, na Internet por exemplo.

O Akita escreveu um artigo interessante e crítico sobre BDD. Na época fiquei um pouco influenciado em uma espécie de  Cargo Cult. Afinal era o Akita e o DHH! Mas acho que o artigo do Akita está datado e um tanto equivocado. Para criticar ele mostra códigos da step definitions, que são ilegíveis para o negócio realmente. Mas no livro citado acima a parte em que o negócio deve participar da redação é bem mais legível e este é um dos objetivos principais: legibilidade, clareza e simplicidade.

Dentro deste meu novo convencimento resolvi implementar BDD na minha linguagem preferida.

Links relacionados:

  • Writing Maintainable Automated Acceptance Tests, Dale H. Emery
    • Test automation is software development . This principle implies that much of what we know about writing software also applies to test automation. And some of the things we know may not be apparent to people with little or no experience writing software.
    • Much of the cost of software development is maintenance—changing the software after it is written. This single fact accounts for much of the difference between successful and unsuccessful test automation efforts. I’ve talked to people in many organizations that attempted test automation only to abandon the effort within a few months. When I ask what led them to abandon test automation, the most common answer is that the tests quickly became brittle and too costly to maintain. The slightest change in the implementation of the system—for example, renaming a button—breaks swarms of tests, and fixing the tests is too time consuming.
    • But some organizations succeed with test automation. Don’t they experience maintenance costs, too? Of course they do. An important difference is that where unsuccessful organizations are surprised by the maintenance costs, successful organizations expect them. The difference between success and failure is not the maintenance costs per se, but whether the organization expects them. Successful organizations understand that test automation is software development, that it involves significant maintenance costs, and that they can and must make deliberate, vigilant effort to keep maintenance costs low.

RenoirSt – A DSL enabling programmatic cascading style sheet generation

renoirst-a-dsl-enabling-programmatic-cascading-style-sheet-generation-1-638

Related:

 

Elegant Pharo Code

1mc27f4wegs4vzkezbw-tug

Beautiful & Powerful One-liners, Expressions and Snippets

Writing computer software remains difficult and hard. Most computer code is hard to read and quite intimidating. This does not have to be the case.

Simple things should be simple, complex things should be possible — Alan Kay

Our software development environments should be designed in such a way that they make it easy to read and to write code for day to day tasks, for those problems that are solved.

Studying a list of example tasks — one-liners, expressions and snippets — is an excellent way to check out candidate programming languages. Here is a list with solutions implemented in Pharo — an immersive, live environment including a pure, object-oriented programming language focused on simplicity and immediate feedback.

Elegant Pharo Code