Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ajanuary
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
24 ms
·
211.
▲
by
ajanuary
12y ago
> gl branch name switches to branch name and it creates that branch if it doesn't exist This seems like it would be annoying when you misspell a branch name. Maybe something like "gl branch -c/--create"?
212.
▲
by
ajanuary
12y ago
Thank you for clarifying.
213.
▲
by
ajanuary
12y ago
Wasn't the heartbleed issue that you could trick it into reading past the memory it had allocated? That's different to explicitly reusing memory you've allocated without clearing it in between. The original claim was that rus
214.
▲
by
ajanuary
12y ago
It's a trade off. For the trouble of exceptions I get nice benefits like stack traces (though there are proposals to add stack traces to Rusts error handling). There are times when I really like exceptions, and times (such as trying to
215.
▲
by
ajanuary
12y ago
Thank you, you've managed to nicely express my feelings on Rust. For coming up with a polished end product that works, Rust is easier, but for bashing on your keyboard to get out your ideas it can be a little frustrating compared to ev
216.
▲
by
ajanuary
12y ago
The issue is it makes it difficult to notice that a function might return when scanning through a function. Especially as it's in places that are looking for a value (e.g. assignment). At the moment it's just return and try!, but
217.
▲
by
ajanuary
12y ago
Just because someone doesn't have a javascript heavy blog (which is designed to be mostly text) in no way means they think must think the whole web should be kept JS-light, or that JS isn't a worthwhile technology to build interac
218.
▲
by
ajanuary
12y ago
It sounds like the goal is to get people programming. That means a combination of teaching them, and getting them excited. Being able to show the thing you created to your friends is a powerful motivator.
219.
▲
by
ajanuary
12y ago
That's not a lack of code review, that's a lack of QA.
220.
▲
by
ajanuary
12y ago
> ... before, if I wanted to know if `x` is defined, i could write `typeof x !== "undefined"`. In all cases. And the result of that statement would never be a throw. Now, if I want to know if x is defined, there are at least t
221.
▲
by
ajanuary
12y ago
In pretty much every case, if changing 'var' to 'let' would trigger this issue, the original code isn't doing what the author thought it was.
222.
▲
by
ajanuary
12y ago
> Now, sometimes it will throw. No, typeof /isn't/ throwing. let x = 1; function some_random_function(y) { } (function() { some_random_function(x); let x = 2; })(); This will throw the same exception for e
223.
▲
by
ajanuary
12y ago
Objective-C does this. I've not used Objective-C enough in the wild to say how often it causes issues.
224.
▲
by
ajanuary
12y ago
let x = 0; function typeof_wrapper(y) { return typeof y; } (function() { typeof_wrapper(x); // throws an error let x = 1; })(); (function() { typeof_wrapper(x); // returns
225.
▲
by
ajanuary
12y ago
typeof isn't raising the exception, the runtime is raising it before typeof is even evaluated.
226.
▲
by
ajanuary
12y ago
They are in the same lexical scope. Inside a lexical scope, all matching variable names refer to the same variable. Because they are in the same lexical scope, all instances of the variable name "x" refer to the same variable. Sep
227.
▲
Let and variable hoisting
(gist.github.com)
1 points
by
ajanuary
12y ago
|
0 comments
228.
▲
by
ajanuary
12y ago
typeof is never being invoked, so it can't return anything. The rules of let are that any reference to the variable before the let declaration (the "temporal dead zone"), it's a reference error. So the reference error is
229.
▲
by
ajanuary
12y ago
It's not having an effect outside of its lexical scope. You introduce the let into the same lexical scope as the console.log. It will also throw an exception every single time. So unless you're adding a variable, and then never te
230.
▲
by
ajanuary
12y ago
Remember, it's not the function that's throwing the exception, it's the runtime. In order to make it not throw an exception, we'd have to special case typeof to make the runtime behave differently just for it. /That
231.
▲
by
ajanuary
12y ago
That part of the article isn't particularly clear. The intended behavior of let is great. The unintended behavior - that it can cause typeof to fail - is bad.
232.
▲
by
ajanuary
12y ago
> This means that typeof can now throw >>> def f(): ... type(x) ... x = 10 ... >>> f() Traceback (most recent call last): File "<stdin>", line 1, in <module>
233.
▲
by
ajanuary
12y ago
That part of the article isn't particularly clear. The intended behavior of let is great. The unintended behavior - that it can cause typeof to fail - is bad.
234.
▲
by
ajanuary
12y ago
var foo = [1, 2, 3, 4]; foo.bar = "I exist"; console.log(foo.bar); foo.baz = function() { return "So do I"; } console.log(foo.baz()); Arrays are, to most practical purposes, just special objects
235.
▲
by
ajanuary
12y ago
Eiffel also uses square brackets.
236.
▲
by
ajanuary
12y ago
Declining the app's pre-permissions dialog means they can request it again. Accepting the app's dialog, then denying it at the OS level means that, at least with the library they link to in the post, the pre-permissions dialog won
237.
▲
by
ajanuary
12y ago
I run a Plex media server on my laptop, which is already serving up content to my local network over http. It would be very simple for them to host their Chromecast app on the same local server and for the cast button to send that URL. The
238.
▲
by
ajanuary
12y ago
A local network is more than capable of serving up the chromecast app. It's a restriction they've added to the device that it won't load it from a local network.
239.
▲
by
ajanuary
12y ago
To nitpick your nitpick (and not to imply your ultimate conclusion is wrong): "originally devised" -> "Devise" implies originality. The word original in the original text is used in the sense of "from or
240.
▲
by
ajanuary
12y ago
Newbies can be complacent. Plus it has the flattering word "expert" in it.
More ›