Comment by noiv

11 years ago

The Python community has a proper response: https://pypi.python.org/pypi/left-pad/ /s

Then you can do variants.

A Java left pad implementing a Padder class instanciated by a PadderFactory that you can get by a PadderInjector from a PadderRegistry all that accepting an AbstractPaddingString.

Then one in Ruby where you monkey patch the string to that it pads, then add an AUTO_PAD settings set to True by default and a fluent API to chain padding.

Then one version PHP version containing pad_string, then real_pad_string that deals with unicode, then real_pad_string_i_swear_this_time that that call str() on parameters automatically.

Then a Haskell one with a monad and a trampolin and some |=> giberrish to mix it all.

Then a Go one that creates a string padding microservice. With a docker file, just in case.

And the last trend in Python, an aio_string_pad which gives you an asyncronous padding coroutine, but under the wood calling run_in_executor, and optionally auto start an event loop.

This is 99 bottles of beer all over again.