Better HN
topnewbestaskshowjobs
Log inSign up

devit

4,235 karma · joined Sep 10, 2015 (11y ago) · 1,525 submissions

Submissions

comment 8y ago · link · parent

This "functional CSS" approach is obviously wrong.

It causes repetition that would be avoided by defining a single CSS class (this can and probably should be done inside in the file defining the component), and also prevents making appearance changes outside of the component (e.g. in non-component JavaScript or with a CSS-changing browser extension).

If you want to obfuscate the semantics, then "minimized" class names are a better solution.

If you don't care about repetition, then inline styles are just as good, and actually better since you can for instance use any of the 2^24 sRGB colors.

None of the "downsides" listed in the document are reasonable arguments:

> Inline styles don't respect media queries, which basically rules out responsive design

"Utility classes" also don't, unless you define one for each possible media query and style (that's > 2^16 possible widths, > 2^16 possible heights, > 2^8 attributes...).

> Inline styles aren't limited to pre-defined options, meaning you can still end up with 90 different shades of blue

That's a downside, and also CSS has built-in color names.

> Inline styles cause specificity issues, since they trump separate stylesheets.

Use !important.

> Inline styles don't support print-specific styles.

True I suppose, but nobody cares about printing webpages nowadays, and those who are meticulous enough to care probably aren't choosing between inline styles and utility classes since they are both bad approaches.

> Inline styles can't address pseudo-elements (such as ::before and ::after)

You can just put the content in the HTML itself if you are explicitly specifying the appearance.

> Inline styles can't apply to multiple elements. Utility classes can define .bg-blue once and have it apply to many things, which leads to shorter markup and quicker rendering speed.

class="bg-blue" has to be repeated just as much as the equivalent background style...

> Inline styles are a pain to type. Compare class="f-sm bg-blue" to style="font-size: 10px; background-color: #0000ff;".

You should use IDEs with autocomplete, and then they are going to be easier to type, and most importantly developers already know them and can thus easily read and write them without consulting any documentation or CSS file.

comment 8y ago · link · parent

I think the explanation for Linus' behavior is this: when he looks at works that he believes are technically wrong, he's probably displeased, frustrated and afraid that other contributions with the same technical issues might go through unnoticed.

As a result, he sometimes insults the code and the person, probably because that relieves those negative emotions, "compensates" for the pain he had to endure reviewing the technically wrong work and makes his opinion as loud as possible so that the likelihood that other contributions have the same issues is minimized.

The solution is for him to be more emotionally accepting of the fact that some people are technically less skilled and some contributions are not well done and just accept the negative feelings without having to insult others to compensate, while also expressing better when he feels that a mistake should be carefully avoided in the future as it might otherwise happen again.

comment 8y ago · link · parent

Anyone can trivially contribute with a false identity to most projects, so it makes no sense to try to "prevent Hitler from contributing".

comment 8y ago · link · parent

Another possible explanation is that unmarried people are likely to spend more time and effort pursuing new relationships instead of making money.

comment 8y ago · link · parent

Assuming UBI is feasible and denominated in goods (i.e. you get an house, food, clothes, etc. rather than X dollars that may inflate), then I assume most or all people would not choose to work in an Amazon warehouse at the conditions described.

comment 8y ago · link · parent

I don't think people should be entitled to the freedom of having children no matter what, since having children forces significant externalities on society, especially if there's an agreement that everyone should have a good standard of living (as implied by this article) or even just that there's a right to healthcare; and even without those, since the children may become criminals and harm others.

The root causes of poverty and violent crime are people who have children but are not able or willing to properly educate them and support them financially, so the simplest fix is to prevent that from happening (by forcing them to have an abortion).

That said, an alternate solution is for the state to step in if parents can't or unconditionally, although some sort of population control might be required anyway.

comment 8y ago · link · parent

The problem is caused by society/government, due to the lack of universal basic income, or alternatively a ban on having children if the parents can't provide an equivalent payment.

If everyone had access to the basic necessities of life without having to work, then nobody would accept jobs like those, and Amazon would be forced to either automate everything or substantially improve working conditions (much less hours, higher pay, ways to make the work more fun).

Even if you were to force Amazon and the like to "treat workers better", what about those who can't find work?

comment 8y ago · link · parent

Tried to remove an elephant in an hard instance (what to do with the woman on top?), and a bicycle in an easy instance (lone bicycle), both found from Google Image Search .

http://deepangel.media.mit.edu/showcase/Works%20terribly

http://deepangel.media.mit.edu/showcase/Another%20greyish%20...

Terrible results in both. It looks like it just works on their examples and doesn't do any better than object detection + paint a solid rectangle on others (arguably, it does worse than that).

comment 8y ago · link · parent

I find a solid black wallpaper (also known as "no wallpaper") to be the best choice, especially on OLED screens.

comment 8y ago · link · parent

There are only 3 possible simple designs for separable chocolate bars (trapezoidal, rounded and rectangles with a gap), so allowing to trademark any of them would be bad.

comment 8y ago · link · parent

Yeah, it feels like gradually transitioning to English as the primary language would be the one of the best ways to improve the economy in most EU countries (as well as non-EU countries to some extent) since it would dramatically boost skilled immigration, and also make their citizens more educated and make communication with foreigner easier.

comment 8y ago · link · parent

The real problem here is that after this stunt I'd like to completely stop using Whatsapp and switch to something else instead, but I can't because other people use Whatsapp and communicating with other people is essential to me.

The problem is there no laws to stop whoever becomes the lucky recipient of such a network effect from doing whatever they want.

Instead antitrust law needs to be expanded to consider network effect platforms like social network as monopolies on ways of interacting with their users, and restrict them from several behaviors like this one.

comment 8y ago · link · parent

I think the next step would be to have a tool that can convert C into safe Rust with a combination of static analysis and framework/program-specific user-written rules to translate specific C framework constructs into Rust equivalents.

An eventual goal could be for instance to automatically translate the Linux kernel with the aid of a lot of custom rules to handle its constructs.

comment 8y ago · link · parent

Perhaps they should have better security measures?

If I understand correctly, Tesla cars can be updated OTA including critical functions, so someone who manages to insert a malicious software update might be able to kill everyone driving a Tesla at some moment, plus numerous bystanders.

comment 8y ago · link · parent

If you make it clear that you are already have friends with benefits (or in fact just that you are only interested in that kind of arrangement), that that's your lifestyle choice and that holding to your values is the most important thing to you, "stealing" is not really an option.

comment 8y ago · link · parent

> he's honest with potential partners about being in an existing open relationship then the pool of women willing to date him evaporates

I believe already having one or more lovers makes you much more attractive since the fact that those people chose you (among others) means you are probably a good choice.

Also, it helps you be outcome-independent (i.e. you don't care as much about whether a girl you are talking to wants to have sex with you, since you already have other girls for that), which is thought to be at least part of what makes males attractive.

Of course you won't be able to have fulfilling and honest relationships with people that insist on monogamy, but the opposite is true as well.

comment 8y ago · link · parent

Cities are essential for social life since an abundance of social events, potential friends and sexual partners means that you'll be able to choose ones that you like more (or even have some as opposed to none).

The effect of remote work is instead that it no longer matters as much in which city you live, as long as it is large enough.

comment 8y ago · link · parent

My suggestion was to have Firefox support both Gecko (with uplifted component) and a pure Rust renderer, with the latter to be used in the Tor mode where security (to preserve anonymity against resourceful adversaries) matters over compatibility.

For security, instead of a JIT, a simple JavaScript bytecode interpreter written in Rust to be used exclusively in the Tor mode would be ideal, for maximum security at the cost of worse performance.

Another option is a JIT that generates code that is easily proven to be safe (e.g. because it does a bounds check on all memory accesses and only does indirect jumps using a jump table, or because it's the only thing running in a process and jumps are still constrained with a read only jump table and read only code).

comment 8y ago · link · parent

I think Mozilla should look at using Servo instead of Gecko in this mode along with a new JavaScript interpreter written in Rust, at least optionally, since perfect security is essential when using a Tor browser without a dedicated VM.

comment 8y ago · link · parent

Seems insane to allow non-swimmers to use floating tubes that can flip over without also wearing personal flotation devices.

Even with a lifeguard, what if multiple people need saving at the same time, or the lifeguard just doesn't notice it after a long time with no interventions require.

comment 8y ago · link · parent

How so?

Pretty much everything that Google offers has good alternatives, and there are little or no network effects except for YouTube.

E.g. you can use Bing Search, OpenStreetMap/Bing Maps, Office365, Fastmail, LineageOS, AWS/Azure, Vimeo instead of the Google products.

In fact, the search engine is the only product that might be significantly better than alternatives.

comment 8y ago · link · parent

This is the best way to categorize programming languages, but applying it only to relatively unpopular languages seems a strange choice.

I'd categorize the popular ones like this:

- One sparse byte array: C, C++

- GC heap with class instances with fields: Java, C#, etc.

- Affine structs and enums on the stack, plus library support for heap and other models: Rust

- Dictionaries and primitives: JavaScript, Python, Ruby, etc.

- Immutable structs and enums on the heap: (safe) Haskell

- Textual/array/dictionary variables, global and local: bash and other shells

comment 8y ago · link · parent

How does that solve the incentive problem? (everyone wants to keep supporting IPv4 so it continues to work fine and there's no incentive to upgrade)

comment 8y ago · link · parent

Is there any alternative approach that would be more effective?

comment 8y ago · link · parent

> The one exception to the network policy, for now, is the X11 protocol which is used to display graphics and receive keyboard/mouse input

Well, this makes everything else moot, since you can just inject keystrokes and thus trivially take over the system... (in addition to probably many other vulnerabilities in the X11 server)

They should try to do a proper isolation job (meaning no I/O other than shared memory and pipes to another Firefox process), not this apparently useless effort.

comment 8y ago · link · parent

Probably not the best idea to give Bitcoin to someone to keep in their vault.

comment 8y ago · link · parent

They gain lower prices or better service for consumers, obviously.

comment 8y ago · link · parent

This is one of the problems with making decisions based on "data".

Obviously, the benefit of having users is not only in the profit from ads, but rather from having your site be popular, recommended to friends, posted in links in discussions, training Google's algorithms by people clicking on their search results, having people willing to subscribe to future paid services or buy future products, etc.

But since those things aren't measurable in the short term, they get completely discounted by naive businesspeople, with bad results like this.

comment 8y ago · link · parent

Letting users choose passwords is the default behavior of websites, but it's incredibly dumb.

Just generate a random password on the server side and tell the user to store it in their password manager or in a plain text file.

Do not let users enter their own password under any circumstance.

All password issues solved instantly (yeah, if the client is compromised the password is too, but the attacker can install a keylogger and accomplish the same task anyway).

Plus it's much more user friendly, since the user just needs to follow instructions and is not required to somehow "invent" a password.

1
373839
51