如何用"艺术风格""破解"C代码

puk*_*puk 10 c formatting astyle

使用Artistic Style代码格式化程序,我如何实现相反的目标--break-after-logical / -xL,如果我有......

if (thisVariable1 == thatVariable1
        || thisVariable2 == thatVariable2
        || thisVariable3 == thatVariable3)
    ...
Run Code Online (Sandbox Code Playgroud)

......我明白了......

if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3)
    ...
Run Code Online (Sandbox Code Playgroud)

Yve*_*reY 5

Artistic style 似乎没有使这成为可能.

这是非常明智的,因为它实际上混淆了代码:

  • 垂直对齐通过强调相同的图案和不同的图案来提高易读性(单个!=衬里中的单个将难以发现).
  • 它还简化了差异跟踪.

我实际上会写:

if  (  thisVariable1   == thatVariable1
    || thisVariable2   == thatVariable2
    || longerVariable3 == thatVariable3 )
    ...
Run Code Online (Sandbox Code Playgroud)