Better HN
topnewbestaskshowjobs
Log inSign up

jasonpriestley

7 karma · joined Jul 2, 2014 (12y ago) · 6 submissions

Submissions

comment 12y ago · link · parent

js_of_ocaml, fswatch to rebuild when source files change.

comment 12y ago · link · parent

My practice is to build the DOM programmatically with jQuery, and add styles to the elements directly

   $("<div>")
     .css({width: 100, height: 20, color: 'red'})
     .appendTo(container);
Then, since these are just values in normal javascript code, you can refactor as normal. Pull commonly used patterns out into functions (e.g. `importantText(16, "size 16 important text goes here")`).

Most styles in the applications I write tend to be inextricably linked to the layout and function of a component (e.g., tabs should be next to each other); in the rare case that a style needs to be customized in different locations or at different times, it becomes a parameter (e.g. `confirmDialog(textStyle, message, onOk, onCancel)`)

No extra tools are needed, beyond jQuery (building up the DOM without jQuery or something like it is awful).

comment 12y ago · link · parent

Writing your styles in javascript is a better option. You get variables, as well as functions and modules (e.g. with browserify), all with sane syntax and semantics (no "cascade").

Preprocessors are an inferior solution, limited by the semantics of CSS and leading, by the pervasive use of macros, to needlessly large CSS file sizes.

comment 12y ago · link · parent

Why do you think the real wage of low-end workers would decrease by 10% if paid vacation were mandatory?

If I try to reconstruct your reasoning, I guess it goes like this - correct me if I'm wrong:

1) Employers of these workers are paying the workers according to their marginal product, and will continue to do so.

2) The worker's marginal productivity is exactly proportional to days worked.

3) Therefore, if they work 90% as many days, they will be paid 90% as much as before.

The first problem here is premise 2 - better-rested, happier workers tend to be more productive, so increased vacation partly pays for itself.

But the more serious problem with this logic is that, even if premise 2 were true, most of these workers are probably in wage-goods industries. A reduction in productivity within the wage-goods industries as a whole will be offset in two ways - less production of wage goods, and increased real price of wage goods, i.e. decreased real wage in non-wage industries. So even in the idealized classical world you seem to be living in, most of the effect will be on the wages of people who already enjoy vacation time.

You also have to consider the macroeconomic demand effect. The economy is still running below capacity, so employing more people will have a multiplier effect.

comment 12y ago · link · parent

Startups aren't good in themselves, they're good if they bring about helpful innovations or good products etc.

Skirting regulations to privatize a public resource and make money off of it harms society as a whole, so it's better to have as few startups like that as possible.

Also, this article claims that this one, widely supported government action is indicative of a "broader trend", but it offers no further evidence and I'm having trouble thinking of many other cases. Arguably, SF has been rather forgiving of companies which skirt regulations without really harming the public - like AirBnB, Uber, or even Google buses.

comment 12y ago · link · parent

The author suggests that the enormous economic success of software suggests that the methods used are not "crap", but I don't think this is valid. In fact, it's somewhat the opposite - the strong economic growth in the software world (and the exponentially improving performance and reach of the underlying hardware) allow low-quality software to proliferate.

The economic argument for quality engineering is, "it may cost more upfront, but will deliver a more reliable product with lower total costs." But this argument is invalid in the current software world, where network effects and first-mover advantage are enormous, and a successful company can grow explosively. No one would follow the strategy of "build a quick bridge out of plywood, then when we have 10 million people using it and it starts falling down every other day, we'll have enough money to hire some people to build a real bridge." But that's what twitter did.

As software developers, a lot of our job is just putting up with the crap that the software world has been built on, because the people in charge have made the rational calculation that it's better to hire ten times more engineers and expand to Asia, expand to mobile, expand up market and down market and into different markets a little sooner.

I agree entirely though, that it's counterproductive for programmers to blame ourselves or to seek a technical fix to what is basically an economic and organizational problem.