← Back to context

Comment by akkartik

10 years ago

If you're so sensitive to superficial syntactic issues you're gonna miss out on a lot of reading/learning pleasure in this life. (It's one of my pet peeves: http://akkartik.name/post/readable-bad)

I was taking about the ability to debug code. Various IDEs/compilers have sometimes issues and bugs on multistatement lines in DWARF/etc. I've worked on a low level debugger, so it was a big problem, even few years back.

  • Fair enough. But where do you see multistatement lines in the link?

    • For example: https://github.com/martanne/vis/blob/master/buffer.c

      bool buffer_prepend0(Buffer buf, const char data) { return buffer_prepend(buf, data, strlen(data) + (buf->len == 0)); }

      Two function calls plus arithmetics plus step-return.

      Depending on the debugger interface(eclipse with gdb, vs, etc), one will have to press some form of Step 1 to 4 times to advance the line. Depending on the complier that was supposed to provide correct debug info (GCC vs msvcc vs xlc) and bugs, these steps may or may not work.

      It is short, but when you do multi platform code, a real pain to deal with.

      Consider aix and Linux multiplatform code for one of my past projects. My choice would have been: 1. Step and maybe hit a bug, msg the complier team, proceed writing register values on paper. 2. Break up the line, recompile. Few minutes on Linux, over half an hour on aix.

      8 replies →