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

I, for one, can see what he posts and they aren't hidden in any way.


In vanilla C, exceptions do not exist. Thus goto is the standard (at least for the Linux kernel) statement for handling exceptions.


Oh, I see. Is that something like setjmp/longjmp?


No, it's just plain goto, to a named label which is (for this case) later in the function.

It's quite common in low-level code where you want to do a bunch of things that can all fail, and you need to rewind and undo the things that succeeded up to the point of failure.

See http://stackoverflow.com/questions/13001067/why-do-some-kern... and https://www.kernel.org/doc/Documentation/CodingStyle (chapter 7 but that's raw text so I can't link).


I wrote a simple set of c/++ macros to encapsulate this functionality, though it still relies on the dev to unwind in the correct order

#define HANDLE_ERROR(label) bool label = false; #define ENSURE(label, pred) if (!(pred)) { label = true; goto label; } #define RESOLVE(label) label: if (label)

HANDLE_ERROR statements go at the beginning of the block, RESOLVEs go at the end, in the reverse order to the ENSUREs, which go wherever they're required.

It's been working well for me so far.


Let me try that again with formatting this time:

    #define HANDLE_ERROR(label) bool label = false;
    #define ENSURE(label, pred) if (!(pred)) { label = true; goto label; }
    #define RESOLVE(label) label: if (label)


OK, then.

The OP mentioned "previously gained value instantly disappears". I do not see what exactly disappears with GOTO?


Inkscape is defiantly software where reading the manual is a good idea. I tried to use it with out doing so, and found it unusable.


Not all markets are superstar markets. Some places the 100th best worker is about just as good as the best worker, like for janitors.


First, I beg to differ your "like for janitors" statement. In almost every profession there is a large difference between the top performers and the average. But your statement "Not all markets are superstar markets" is exactly the point of my post - engineering is not a superstar market, and hence engineers will never have much compensation leverage.


Use boustrophedon for equality!


Many countries are irregular polygons like Chile. Thus a square is very close to a circle, relative to the other shapes.


Less well known languages like Japanese tend to have higher returns on investment than common ones like Spanish. IIRC Spanish has a return on investment of about 3%.


In my experience the Japanese translation market was very crowded and didn't pay well so my first plan went out the window.


I forget if it was Planet Money or Freakonomics, but there was a podcast about the ROI of learning a foreign language and according to the research they cited the only foreign language worth learning from a pure ROI perspective was English.


This only works when there are economies of scale. If there are significant dis-economies of scale smaller firms can out-compete the large firms.

The large firm can't just buy up all the small firms either because new firms are started all the time, and if every person who starts a small firm is rewarded with a buyout, the industry will attract more and more new firms until the large firm can no longer afford to buy out new firms. --------------- Examples of industries that not dominated by three or four large companies: mining, farming, house cleaning, and being a land lord.


It happens when large firms have a lot of extra liquidity and cheap debt. Look at FB and Google.


Job training by employers doesn't work great, because the worker can get training at an employer that gives training and then switch to one who pays more because that employer doesn't have to do training.

Though possibly that could be fixed with proper regulation.


The business owner also doesn't have the training to account for the actions of all the other businesses. The economics professor does.


Business people I deal with are highly aware Macro issues. If you ask them what they think of things like minimum wages or other regulatory costs their usual concern is that their' particular entity doesn't suffer an unfair burden.

Academic Economists know pretty much nothing of Macro.


Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: