Author Topic: Shlemiel the painter’s algorithm  (Read 281 times)

jj2007

  • Member
  • *****
  • Posts: 8435
  • Assembler is fun ;-)
    • MasmBasic
Shlemiel the painter’s algorithm
« on: April 27, 2018, 05:29:24 PM »
Quote
Shlemiel gets a job as a street painter, painting the dotted lines down the middle of the road. On the first day he takes a can of paint out to the road and finishes 300 yards of the road. “That’s pretty good!” says his boss, “you’re a fast worker!” and pays him a kopeck.

The next day Shlemiel only gets 150 yards done. “Well, that’s not nearly as good as yesterday, but you’re still a fast worker. 150 yards is respectable,” and pays him a kopeck.

The next day Shlemiel paints 30 yards of the road. “Only 30!” shouts his boss. “That’s unacceptable! On the first day you did ten times that much work! What’s going on?”

“I can’t help it,” says Shlemiel. “Every day I get farther and farther away from the paint can!”

Credits to Joel CEO of SOF. Also a nice read: a cardinal, fundamental law of programming: It’s harder to read code than to write it

I've searched the old and new forums, but it seems we never had a thread on optimising string concatenation... strange ::)

K_F

  • Member
  • *****
  • Posts: 1372
  • Anybody out there?
Re: Shlemiel the painter’s algorithm
« Reply #1 on: April 28, 2018, 08:59:56 AM »
Shlemiel has never heard of Binary Trees,  or Sorting and Searching algorithms  ;)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5426
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Shlemiel the painter’s algorithm
« Reply #2 on: April 28, 2018, 10:48:55 AM »
> we never had a thread on optimising string concatenation

Hmmmm, I may be able to help you here as I have just finished a technique in 32 bit code.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: