News for hackers. Stuff that matters.
Re:Apple's SSL/TLS bug by danieljh on Saturday February 22, 2014 @09:14AM (#7282091)
Emerging tools such as gofmt and clang-format are able to automatically re-format your code based on the language rules rather than the human behind the monitor. Using those tools this specific category of issues should at least be visible in the formating diff.

Interesting. Never thought about it that way before.

Re:Apple's SSL/TLS bug by Pacabel on Saturday February 22, 2014 @09:30AM (#7282123)
Those kinds of tools aren't new or emerging. The "indent" utility for C has been around for decades. I first remember using it on 4.3BSD, but it may have been around before that.
Re:Apple's SSL/TLS bug by tobiasu on Saturday February 22, 2014 @09:39AM (#7282145)

    indent - indent and format C program source

    HISTORY
        The indent command appeared in 4.2BSD.
And for context, 4.2BSD was released in 1983.
Re:Apple's SSL/TLS bug by kps on Saturday February 22, 2014 @11:40AM (#7282574)
cb(1) was in Seventh Edition (1979).

  NAME
    cb - C program beautifier

  SYNOPSIS
    cb

  DESCRIPTION
    Cb  places a copy of the C program from the standard input on the stan-
    dard output with spacing and indentation that displays the structure of
    the program.
Re:Apple's SSL/TLS bug by pjmlp on Saturday February 22, 2014 @10:05AM (#7282227)
Worse, lint was part of the original C toolchain, but very few people cared to use it, because they couldn't be bored to tune the tool to their projects.

This is the type of error that any static analysis tool would easily pick.

Re:Apple's SSL/TLS bug by danieljh on Saturday February 22, 2014 @10:04AM (#7282221)
Sure, the idea is not new. Using the compilers libraries and internal representation to re-format your code is new, though.

You want the compilers knowledge of the code for this, e.g. while formating C++ template mess.

There's a tight integration into the actual toolchains, which is a good thing.

Re:Apple's SSL/TLS bug by spiralpolitik on Saturday February 22, 2014 @10:04AM (#7282222)
Trying to get teams to agree on the code style is the hard part when using such tools. `gofmt` somewhat avoids that by defining one true way and only giving minor customization options.
Re:Apple's SSL/TLS bug by thrownaway2424 on Saturday February 22, 2014 @12:34PM (#7282772)
clang-format has the same property. You just have to tell off a bunch of neckbeards and/or fire them if they can't agree to its formatting rules.

Having cast-in-stone formatting rules makes code review easier and shorter and avoids lots of arguments. For ultra-dangerous languages like C++, automatic formatting is indispensable.