Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

also, just to be clear. the macro only included open and close curlies?

if so that's silly, as it is literally 2x the work to type.

if they also included some sort of state that had to be managed, then it starts to verge towards reasonable.



I think that maybe the author felt like finding the end of a loop stood out much better that way, instead of trying to distinguish the ends of conditional blocks from the ends of loops. If you're used to poorly formatted code in an ML PhD program, it does make some sense. I've worked with a bit of academic Fortran code for my mechanical engineering degree and can sympathize. Also, D and O are shorter reaches on the keyboard than { and }.

Yes, "OD" was definitely just "}". DO might have been ") {" to allow

  while (a < b DO
     ...
  OD


That's hideous. The unbalanced parenthesis just grates.

The real answer is to just do something like

  }  // while
to show that it's the end of the loop rather than the end of an if, and not play ridiculous games trying to hide the curly braces.


> if so that's silly, as it is literally 2x the work to type.

True on a US keyboard, not true on many others.

I still find this kind of preprocessor abuse horrific; I’m just responding to your specific statement.


It would be sorta reasonable in a header that only your code uses and is unlikely to be transitively included from elsewhere.


You'd be surprised where your code ends up getting used in a monorepo when you have thousands of software engineers all working on it.


that's the downside. nobody owns anything, dependencies and deployments become opaque.

i once had a team lead in a quasi monorepo situation tell me straight up to copy-paste some functions i was interested in from their code. they made up some fishy story about deployments. was the story true? did they even know? did anyone know? who even owned it? would they even know?

or the guy who got up in arms because i touched his team's code and didn't write the unit tests that they didn't write when they originally wrote the code.

oh, monorepos.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: