DEV Community

Discussion on: Code for Humans

Collapse
 
spidergears profile image
Deepak Singh

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.

Collapse
 
mjb2kmn profile image
MN Mark

Fully agree