D15694: Make implicit fallthroughs a compiler error, remove unneeded breaks

René J.V. Bertin noreply at phabricator.kde.org
Mon Sep 24 08:48:46 BST 2018

rjvbb added a comment.

  >   When it comes to no `break;` after a `return;`, that also matches the idea to not have an `else` after an `return` in the branch before.
  Not directly related, but in general I really prefer having as few exit points per function as possible. Sometimes you need some extra code for that, but it makes reading easier in the sense that you only have to worry about if's and else's to know if a certain location can be reached. Experience from debugging optimised code (about the only kind of debugging I do these days) strongly suggests that compilers strive to do generate a single exit point anyway.
  Just to reflect on a remark made earlier: having "normal" colour vision (or colour printers/screens) shouldn't become a requirement for being able to read code.

  R32 KDevelop


To: aaronpuchert, #kdevelop
Cc: rjvbb, brauch, mssola, kossebau, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180924/54f5e8e0/attachment-0001.html>

More information about the KDevelop-devel mailing list