News for hackers. Stuff that matters.
Re:Rust Bug Minimization Patterns by a1369209993 on Friday November 22, 2019 @04:44PM (#21610432)
> But it not always easy to toggle such comments on and off

Try:

  /*-* /
  non_pub_locally_unused_item(----) { ---- }
  //-*/
remove the space on the first line to re-enable it.
Re:Rust Bug Minimization Patterns by klyrs on Friday November 22, 2019 @05:11PM (#21610668)
For A/B testing, I use this in C++; it looks like it works in rust (according to my syntax highlighter):

  //* //add/delete the first slash to toggle these blocks
  fooA();
  /*/
  fooB();
  /**/
Re:Rust Bug Minimization Patterns by FartyMcFarter on Friday November 22, 2019 @07:59PM (#21611659)
I like this for C/C++:

  #if 1 // or 0
  A
  #else
  B
  #endif
This can even be nested.
Re:Rust Bug Minimization Patterns by ncmncm on Friday November 22, 2019 @08:48PM (#21611876)
This is so overwhelmingly better in every conceivable way that there is no excuse for ever using the other thing. (Unless you are using Rust and don't have it?)
Re:Rust Bug Minimization Patterns by klyrs on Friday November 22, 2019 @08:50PM (#21611880)
Yeah, that's good too. When I don't need nesting, I like toggleable comments because the inactive block gets grayed out.
Re:Rust Bug Minimization Patterns by FartyMcFarter on Saturday November 23, 2019 @06:57AM (#21613685)
Some editors like vim also grey out the text with "#if".