[squeak-dev] String>expandMacros rules?

Tobias Pape Das.Linux at gmx.de
Mon Mar 6 08:02:12 UTC 2017


On 06.03.2017, at 01:58, tim Rowledge <tim at rowledge.org> wrote:

> 
>> On 05-03-2017, at 3:08 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>> 
>> We already have #format:, which is why #expandMacros* is not being used at all.
> 
> OK; then we should remove the redundant stuff some time.
> 
>> I don't think we need a third implementation unless it provides
>> something the other two doesn’t.
> 
> Oh, the printf stuff most definitely adds something; 
> 
>       ‘%-0.1e’ printf: x
> is a whole lot nicer than 
>      (x printShowingDecimalPlaces: 1) padded: #left to: 1 with: $0

I would really say the other way round. 
Really, frist is faster to write, but second is easier to read.
I don't have to memorize what character means left or right padding, what number means precision and what means overall length and such.

I think the first one is trying too hard (why, yes, C, I am looking at you)

Best regards
	-Tobias

> 
> .. and having all the other options provided nice and cleanly is a real bonus. It’s well worth quickly loading to take a look at. I suspect quite a bit of code could be cleaned up by using this instead of assorted ad hoc methods.
> 
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> Change is inevitable....except from vending machines.
> 
> 
> 



More information about the Squeak-dev mailing list