Skip to content
loading...

re: Code for Humans VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Very good list. However I have to disagree with the statement that "white-spaces are code". White space is critical to properly formatting code, ...
 

it's only human to ignore what is not core.
Language keywords, data-structures, statements and expressions clearly are code and would never be compromised on.
I agree this is not syntax, and would be different for every language.
My point is let's start treating white-spaces as code too. Let the style guides reflect this, let there be a mention somewhere for the teams to refer.

Example:
Ruby

object.chained_medthod1.chained_medthod2.chained_medthod3
object
  .chained_medthod1
  .chained_medthod2
  .chained_medthod3

Elixir

object |> chained_medthod1() |> chained_medthod2() |> chained_medthod1()
object
  |> chained_medthod1()
  |> chained_medthod2()
  |> chained_medthod1()

I started learning Go a few months back, the language has first class support for this with the gofmt utility. The only purpose it serves is formatting the code, because it's necessary and important.

All across the team, members should follow same scheme when it comes to using white-spaces.
Scenario: Don't have half the team using spaces and other half using tabs for indents. This is only possible if team views the white spaces in the same light as the actual code.

 
code of conduct - report abuse