Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 8y ago · link · parent

They are absolutely inexcusable. Website developers should make simpler design rather than make everyone search for close button and consider every user an idiot.

Also it can make user feel uncomfortable, as if there is someone behind their back standing and looking what they are doing with the site.

This popup is also deceiving users. For example on the screenshot [1] we can see a human user thinking that a real person wrote a greeting to him and wasting time of his life replying to a bot.

[1] https://i.imgur.com/yEtgHbr.png?1

comment 8y ago · link · parent

I don't think it is beautiful. This fills program with lots of unnecessary `if`s for checking results of each call. Also, it prevents one from chaining functions like a(b(x)).

comment 8y ago · link · parent

> Nobody would expect that code to terminate a browser tab on error.

That is because browser environment catches all exceptions and displays them in console. So effectively they become handled exceptions.

comment 8y ago · link · parent

The difference is the default behaviour: whether errors are fatal or whether they are ignored by default.

comment 8y ago · link · parent

I don't think it is a good idea to expect some specific order in executing callbacks here unless it is described in some specification.

comment 8y ago · link · parent

Then the promises should have been advertised as a part of async/await syntax. But many articles promote using them by themselves.

comment 8y ago · link · parent

If you want to have a specific point to catch an exception, you could write something like this:

    def start_task():
        thread = Thread(do_task)
        thread.set_error_handler(SpecificErrorType, handler)
        thread.start()

comment 8y ago · link · parent

> otherwise there's no well defined place in your program for the exception to go.

I don't see the problem with that. Unhandled exceptions can occur at any place of your program.

I also don't see why the unhandled exception from the background thread cannot terminate main thread. Why not? That is how unhandled exceptions are supposed to work. Terminating the program is the optimal default behaviour for any error in my opinion. This way you won't miss them.

comment 8y ago · link · parent

Cancelling the promise can be useful in fact to prevent doing computations that won't be used anyway. I tried to explain it in this comment: https://news.ycombinator.com/item?id=16386454

comment 8y ago · link · parent

No, you won't get the result immediately anyway because then() callbacks are called only on next event loop iteration. This protects from overflowing the stack, but might have small impact on performance.

comment 8y ago · link · parent

Actually, cancellations can be useful to prevent wasting resources on useless computations. Imagine, if you have 2 threads doing some computations that will be later merged. If one thread fails, it makes no sense to continue executing other thread. That is where cancellation can help - but it should be thoroughly designed, not hacked like they usually do it in Node.JS.

comment 8y ago · link · parent

I have a feeling the author doesn't understand Promises well. In my opinion, they are in fact designed poorly, but I don't see any problems with points the author describes.

He doesn't like that the callback is called immediately - but Promises just represent a result that will be available later and do not guarantee (and should not) when the function will be called. If you want to delay some function call, do it explicitly or use a delay promise.

In my opinion, the main problem with promises is broken error handling. They don't play well with exceptions. For example:

    var p = Promise(function (res, rej) {
        throw new RuntimeError("System is broken");
    });
This code will just ignore the error. While it is expected that the runtime error would float up and terminate the program - that is what runtime errors are made for.

This also makes writing tests more difficult because tests often use exceptions to indicate failure.

I have some ideas how to fix it (neither is perfect), but the comment will become too long.

comment 8y ago · link · parent

It is interesting to note that there is no option to control or disable updates in new Skype RT for Windows. Opera browser also doesn't allow user to control updates.

comment 8y ago · link · parent

You don't need to delete personal information. Just replace all strings with XXX.

comment 8y ago · link · parent

Why do they enable such dangerous functions by default?

comment 8y ago · link · parent

It is interesting that when I use Chromium 46 (which is newer than Googlebot) I get warnings from Github and Google Docs about an outdated or unsupported browser, and I get plain HTML Github pages without JS. But Google uses even older browser than I. So even Google cannot cope with browser version race and keep their browsers updated although they require this from the users.

comment 8y ago · link · parent

I think that cloaking is very difficult to detect automatically without using humans. You have to distinguish for example between a paywall and real cloaking.

comment 8y ago · link · parent

You can detect Googlebot by IP address or User-Agent which is much easier.

comment 8y ago · link · parent

It is much easier to detect Googlebot by IP address or User-Agent though.

comment 8y ago · link · parent

Telegram also requires a phone number so it is not any better than Signal. Regarding cryptography, anything is good as long as three-letter agencies cannot break it.

comment 8y ago · link · parent

I am not trying to discuss who is the developer, I just wanted to say that you cannot require a phone number and talk about privacy at the same time. Phone number discloses your location and identity.

IP address is much easier to hide, for example by using a VPN.

comment 8y ago · link · parent

Sites like healthcare.gov or banks should not include third party ads or analytics scripts. Referrer is not the only way to leak information from the page.

comment 8y ago · link · parent

Signal requires to provide a phone number (read: disclose your identity to US Government) to use it.

comment 8y ago · link · parent

It requires you to provide a phone number (read disclose your identity) to use it. And its homepage has the word "privacy" repeated several times. It looks like a poor joke.

comment 8y ago · link · parent

The client-server protocol is published. What stops you from writing your own server implementation?

comment 8y ago · link · parent

That might be a mistake. Once Apple makes a deal with China, Russia will ask for the same deal. Russian government want to keep the data in their country too.

comment 8y ago · link · parent

The author mentions that Chrome Extensions are a bad distribution method. I think he is wrong. First, there are more users of Chrome Extensions than the users of npm, second, most of them don't care what those extensions send over the network. And I guess CSP doesn't apply to browser extensions.

So if you want to steal passwords, make some extension like "Mp3 Youtube Downloader" or "Ad Blocker" and get access to millions of happy users' browsers.

CSP looks like an ugly hack rather than a good solution. Why would you need to specify allowed sources for scripts if you control your HTML code? I don't understand why the author praises it. What a stupid time-wasting technology.

comment 8y ago · link · parent

Also owners could make an ambush.

comment 8y ago · link · parent

Don't people have car alarms in US? I cannot imagine how one can break a lot of windows without making noise and meeting angry car owners.
1
160161162
185