• log
  • whoami
  • uses
  • code
  • feeds
  • $ Significant Whitespace

    Significant Whitespace

    by dweller - 2016-01-11


    Or more like significant pain in the rear

    Today I want to talk about something that is bugging me lately. As you might’ve guessed from the title, it’s significant whitespace in programming languages.

    While I was learning Python, I didn’t give it much of a thought. Now admittedly I do not know Python as much I’d wanted to, but I wrote enough scripts and small tools in it, that I feel comfortable. I haven’t thought of significant whitespace much, because it was new, and it seemed cool. (it makes me format my code (not that it ever was a problem)) But now that I tried Haskell, my opinion changed, and in a bad way.

    Okay, so you’re a programmer? You solve problems, you write the solution to it as such that the dumbest thing can understand it - computer. So most of the time programmers drink coffee and stare at the celling are problem solving, and writing the solution down. Therefore, does it seem like a good idea to make a developer think how to write it down, rather than what to write down. In my humble option, you can always refactor the code and/or prettify it later, after the task have been solved.

    When I just started to learn Haskell I got a bunch of errors that complained about indentations. That threw me off the track from solving problem on the hand a few times. I wrote possible solution down, tried it, and got errors that are not telling me what is wrong with my solution, but tell me that my code is misaligned. While I try to fix that, I lose my train of thought. (Also what is it about Haskell and tabs? :unset -fwarn-tabs anyone?)

    In the end, all I want to say is that in my opinion tools should help us solve the problems, not get in the way. And significant whitespace gets in the way, especially in the beginning.