Hacker News new | past | comments | ask | show | jobs | submit | trealira's comments login

By the same principle, these are exactly the same:

  arr[i][j]
  j[i[arr]]
These are the simplifications you'd do. You only need to know that a[x][y] is equivalent to (a[x])[y], and that a[x] is the same as x[a].

  arr[i][j]
  (arr[i])[j]
  (i[arr])[j]
  j[i[arr]]

> When you provide software that is widely used and that people rely on, you automatically created a community where fixing bugs is an obligation. Your software has become a corner stone in other people’s software stack/life and so those people and their issues with your software have become your problem, too. If you want it or not.

Maybe you believe they have a moral obligation, but under the most popular open source licenses, they have no legal obligation to fix bugs or be held responsible for the damages caused by their bugs, regardless of whether people rely on their software for critical software.

From the MIT license:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

From the GPL license:

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

If you rely on open source software, you do so at your own risk, as the authors have no obligations to those who use the software they made, and it's written out explicitly all the time; people just skip past it.


> and expect the judicial branch to inject their own favor when interpreting that vagueness. The judicial branch will once again do what it should have been doing all along: simply interpret the law.

No, with Chevron deference, they expected the executive branch agencies to interpret unspecified parts of certain laws, because they were the ones supposed to implement them, e.g., the definition of "source of air pollution" in the Clean Air Act of 1963. The judicial branch actually is "injecting its own behavior" in that this means they will interpret more laws than they otherwise would have.


I think they're saying that the point of each OS having different UI frameworks is so that all apps on that particular OS have a cohesive aesthetic and "feel native." That necessarily contradicts the desire to have the same UX across various OSes, however. (And I think "feeling native" is something no popular programs have done for a long time.)

"Feeling native" is overrated. Most users want a fast reponsive UI, THAT kind of "native".

They could not care less if this app is different from that app (they are 2 apps, duh).

They would feel annoyed though if the same app has different UIs because someone at Apple or Microsoft's has some opinion about UX


I don't know about that.

Cohesive is important but what's also important is playing nice with the respective OS's design guidelines. For example, take dialog boxes and the order and positioning of "OK, Cancel" buttons.


> "Feeling native" is overrated. Most users want a fast reponsive UI, THAT kind of "native".

We seem to have forgotten it now, but back in the day we had this idea that a platform should have a standard UI to which all applications conform, so that the user can transfer knowledge in using one application to all the others, and they don't have to memorize a dozen different ways of operating to use a dozen different applications.

To that end, dating all the way back to 1984, Apple developed user interface guidelines that specified things like how dialog boxes were to be laid out, what the various menus and options should be, and what were the keyboard shortcuts for common operations.

This was the revolution that enabled all sorts of creatives to integrate computers into their creative work, and for the longest time it was Apple's advantage in the marketplace. Mac users, many of whom were creatives in the print, graphic design, music, and film/television spaces, were very picky about their UIs because they spent so much professional time in them. If you did not conform exactly, down to the pixel, to Apple's user interface guidelines, the users would notice right away, and you would be one-moused so hard in MacWorld your business might never recover. (That's another quasi-lost thing about the Mac ecosystem: people liked paying for good quality software.)

Accordingly, it was accepted dogma to never, ever, ever use a "cross-platform UI framework" if you targeted Mac, because the cross-platform frameworks never got the fine details right, and the fine details mattered. It's called "polish", and it's something the open source world never got (thanks in no small part to fucking X windows and all its stupid "toolkits"), and now that open source and the web have eaten everything, the rest of the programming world has forgotten.


> Most people that are not trying to have children have chosen so either because they know they cannot afford to give a child a good life, or because they loathe to bring a new life into the quickly deteriorating world around them.

Or, maybe it's because raising children is hard, and expensive on top of that, both in revenue costs (which eats into your hobbies and indulgences) and opportunity costs (that time could be spent on your career, that money could be invested into your business or credentials, etc.)

I'm not trying to imply that people who don't want kids are selfish, because those are legitimate reasons. I just don't think everyone who's abstaining from having children is doing so purely because they think it's because the kid would be better off never having been born.


This tracks with what my mom says - that she didn't feel like a full-fledged adult until she had kids, whereas her life before had just been a continuation of her adolescence and young adulthood.

This isn't going to make Congress write more legislation. No politician that was extremist is going to start compromising and proposing legislation. This simply shifts power from the executive branch to the judicial branch. It just makes the question of which party appoints federal judges even more important in the outcome of senate/presidential elections.

> Marbury v. Madison was SCOTUS saying "we can overturn your executive and legislative choices" and no bothered to stop them.

Are you implying the establishment of judicial review was a mistake?


Hell no. I'm just taking issue with the claim that SCOTUS is just "following the constitution". They are actually governed by whatever they say they're governed by. The Roberts Court loves to act they're "textualist" interpreters, but only when it benefits them. They claim stare decisis to avoid overturning precedent, but only if said precedent is something they agree with.

Got it, that makes sense. I think I completely misinterpreted the comment due to the context.

The way judicial review was established is the mistake.

To be symmetric, the loops should read like this:

  for (i = 0; i < n; i++)
  for (i = n; --i >= 0; )
The second one could also be this:

  for (i = n - 1; i >= 0; i--)
I say this because your backwards loop accesses the inclusive range [0, n] while your forwards range accesses [0, n - 1].

  for (i = 0; i <= n-1; i++)
  for (i = n-1; i >= 0; i--)

Yeah, that way of writing them definitely makes them look more symmetric. You could also do this, though it's a bit less pretty:

  for (i = -1; ++i != n; )
  for (i = n; --i != -1; )

I also think that some algorithms can be expressed better using goto than with a combination of nested loops, break, and continue. For example, Donald Knuth talks about the "basic backtrack" algorithm in fascicle 5 [0], which he uses to implement a solution to the N-queens problem.

It's possible to express it as a set of while loops (which someone on Stack Overflow showed [1]), but it's, IMO, less readable than the goto version. Of course, the recursive solution is the most readable anyway.

Edit: Also, both the goto version and while loop version of that algorithm on the Stack Overflow post have an out of bounds index when col and row are both zero. That algorithm was meant for 1-indexed arrays and was not properly translated.

[0]: https://cs.stanford.edu/%7Eknuth/fasc5b.ps.gz

[1]: https://stackoverflow.com/questions/78614303/can-knuths-algo...


This is absolutely true. Even advanced loop syntax implies nesting; but control flow in general is not hierarchical. Simple loop syntax in C is even more limited, because it uses a fixed place for the loop condition test: either at the start or at the end of the body. As a result if we need to do something, then test the condition, then do something extra, we are stuck. For example, we may want to print a list of stings separated with commas:

    void printManyStrsWithCommas(char *s[], int n /* trusted to be positive */) 
    {
        int i = 0;

    a:  printOneStr(s[i]);
        ++i;
        if (i < n) {
            printOneStr(", ");
            goto a;
        }
    }
Here the loop condition is 'i < n', but when it is true, we need to do one more thing (print a comma) before resuming the loop. If we are to stick with non-'goto' syntax we have the following options:

- Somehow cram it into the loop expression with the comma operator. This is very limited because it is an expression. For example, what if 'printOneString' can err?

- Somehow use 'while(1)' with 'break'. It may even compile to the same code as with 'goto'. But why, then, we have to use an unbounded loop syntax with a clearly bounded sequence?

- Somehow add additional variables and tests and either lose efficiency or trust the compiler to lead us out.

With 'goto' the code does only what is necessary. What 'goto' does not do is that it does not immediately convey a clear idea that the code repeats certain steps.


In this particular case I think you could do one of the following (ignoring the "while (true)" + "break" combination):

1:

  while (printOneStr(s[i]), ++i < n)
      printOneStr(", ");
2:

  goto start;
  do {
      printOneStr(", ");
  start:
      printOneStr(s[i]);
      ++i;
  } while (i < n);
But for this kind of code in general, I have thought that the "do while" statement should be extended to take an extra statement after the "while (cond)" part. It could still be an empty statement, with just a semicolon, like "do ... while (cond);", exactly like it's already used; but in cases like yours, you would be able to write this:

  do {
      printOneStr(s[i]);
       ++i;
  } while (i < n) {
      printOneStr(", ");
  }
As a bonus, the current mandatory semicolon after do-while statements would stop being a special case for the grammar of C.

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

Search: