[HN Gopher] Exception Patterns (2013)
___________________________________________________________________
Exception Patterns (2013)
Author : martinlaz
Score : 28 points
Date : 2022-12-20 08:16 UTC (14 hours ago)
(HTM) web link (wiki.c2.com)
(TXT) w3m dump (wiki.c2.com)
| marginalia_nu wrote:
| As a random tangent, this is an "exception pattern" (Java).
| int foo() { int i; for (i =
| 0; i < 10; i++) { try { throw
| new RuntimeException(); } finally
| { if (i < 5) {
| continue; } else {
| break; } } }
| return i; }
|
| Compiles. Runs. Returns 5.
| gwbas1c wrote:
| I don't get the navigation pattern on the page. When I click on a
| link it opens a panel that I can't close, but then if I push
| refresh I'm taken to a page with a broken back button.
|
| IMO: Just do a normal site where links take you to pages. Don't
| be creative with the UI. Maybe you could use some bog-standard
| wiki software?
|
| The content itself looks very valuable, but because the UI is so
| bonkers, it's just too hard to use or link to.
| jiyuhtrfdrct wrote:
| > Just do a normal site
|
| It actually used to be normal HTML... the site is the first
| wiki. For some reason it was reimplemented as a broken JS app.
| marcosdumay wrote:
| Whoever designed this site spent a great deal of effort to make
| it behave like this.
|
| Adding my opinion, also let the text use the page width.
| Limiting it to 120 characters or whatever is fine, but what
| this site does is really not.
| marginalia_nu wrote:
| Seems to work if you right click and open in a new tab.
| Although I do agree it's a bit of an accomplishment to break an
| otherwise already working browser feature. Sadly not an
| uncommon one.
| codetrotter wrote:
| > When I click on a link it opens a panel that I can't close,
| but then if I push refresh I'm taken to a page with a broken
| back button.
|
| On mobile I just tap outside of the panel to close it. Probably
| on desktop it will close as well if you click outside of it?
| civopsec wrote:
| The cool thing with all these links is that I can pick whichever
| one I want to talk about!
|
| > Don't use assertions. BairsLaw applies - what will you do if
| the assertion fails? (Fix the bug, perhaps?) If you don't like
| the parameters you're given, throw an IllegalArgumentException.
| If you don't get a correct result, your UnitTest will tell you.
| There is no room left for assertions.
|
| Disagree. How does the "law" apply? Yes, I would like to fix the
| bug if the assertion uncovers it... not unlike a validation
| error.
|
| Assertions are only turned on in Java if `-ea`. Which means that
| you can fail fast for local development and maybe just log things
| in production.
___________________________________________________________________
(page generated 2022-12-20 23:00 UTC)