Coding pearl of the day
Hi when cleaning a system sometimes you find some coding pearls. And I want to share one I found. currentSlide := 0 + self configuration slideInTemplateForDeckJS. Stef (we got a good laugh with guille).
On 21 Mar 2018, at 21:47, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi
when cleaning a system sometimes you find some coding pearls. And I want to share one I found.
currentSlide := 0 + self configuration slideInTemplateForDeckJS.
Stef (we got a good laugh with guille).
Haha, that should clearly be currentSlide := (0 + self configuration slideInTemplateForDeckJS) * 1. And after that you definitively have to do currentSlide := [ currentSlide ] value.
:) Yes it probably even more intention revealing. On Wed, Mar 21, 2018 at 9:58 PM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 21 Mar 2018, at 21:47, Stephane Ducasse <stepharo.self@gmail.com> wrote:
Hi
when cleaning a system sometimes you find some coding pearls. And I want to share one I found.
currentSlide := 0 + self configuration slideInTemplateForDeckJS.
Stef (we got a good laugh with guille).
Haha, that should clearly be
currentSlide := (0 + self configuration slideInTemplateForDeckJS) * 1.
And after that you definitively have to do
currentSlide := [ currentSlide ] value.
Stephane Ducasse-3 wrote
Hi
when cleaning a system sometimes you find some coding pearls. And I want to share one I found.
currentSlide := 0 + self configuration slideInTemplateForDeckJS.
Stef (we got a good laugh with guille).
TBH, I found A := 0 + N to be the least confusing part of that code... ;) Cheers, Henry -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
participants (3)
-
Henrik Sperre Johansen -
Stephane Ducasse -
Sven Van Caekenberghe