Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
einaregilsson
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
einaregilsson
15y ago
For http://www.hearts-cardgame.com/ I wait until you are into your second game and then I slide down a little, uh, top banner (what are those things called?) which has the text "Hi there! Looks like you're enjoying the game. That's great!
62.
▲
by
einaregilsson
15y ago
The site is a simple tech blog which doesn't get much traffic at all. The particular page they wanted to use is about a card game I created, and ranks well for the phrase "idiot card game" but pretty much nothing else. I would have taken 20
63.
▲
Ask HN: Have you been offered money for a disguised ad on your website?
13 points
by
einaregilsson
15y ago
|
20 comments
64.
▲
by
einaregilsson
15y ago
It wasn't visible for me on that one comment. I don't know why, I thought it was too deply nested or something, but now I see it. Weird.
65.
▲
by
einaregilsson
15y ago
Well, at least we agree that 'return i++' is terrible practice (although it has nothing to do with semicolons) :) But when you write Python code, do you then end every line with a ; ? To make it more readable for yourself?
66.
▲
by
einaregilsson
15y ago
@eropple: So you put semicolons after every line? Even after block statements {} ? Why not, if the goal is to be consistent?
67.
▲
by
einaregilsson
15y ago
Exactly! The semicolon prefix can be put even more simply: Prefix any line that starts with punctuation with a ; There, you've just fixed all the cases that are likely to go wrong.
68.
▲
by
einaregilsson
15y ago
I don't think that's comparable. Maybe it would be if every new English sentence started on a new line ;) The capital letter in English is a strong visual indicator that a new sentence is starting. In code I think the line break does that m
69.
▲
by
einaregilsson
15y ago
There are two possibilities: 1. Prefix lines that start with punctuation, specifically [(-+/ with a ;. Then omit them everywhere else. Lines that start with punctuation are a tiny subset of all lines generally. 2. Postfix every line with a
70.
▲
by
einaregilsson
15y ago
Yes, you could just add a semicolon in front of lines that start with punctuation (tiny percentage of all lines) or you could just stick them at the end of every single line...
71.
▲
by
einaregilsson
15y ago
return i++ is not ambigous. It will return the current value of i, e.g. if i was 2 it will return 2, not 3. But that's just how the post increment operator works (in every language that I know of), that has nothing to do with semicolon inse
72.
▲
by
einaregilsson
15y ago
Yes, the two cases where I actually think I could run into that are that and var x = i (function() {...})() where it wil think i( is a function call.
73.
▲
by
einaregilsson
15y ago
Well, I think it's more readable without semicolons. Less linenoise. And after reading about exactly how it works I'd rather omit them where I can. The cases where it behaves differently than expected are almost all cases where I think "I w
74.
▲
by
einaregilsson
15y ago
Ahem, maybe not as clear as I thought, since I found a few other edge cases I didn't know of in this excellent article: Best article I've read on the subject: http://inimino.org/~inimino/blog/javascript_semicolons
75.
▲
by
einaregilsson
15y ago
But isn't that part of learning any language? There are plenty of weird edge cases in other languages but we get used to them. Basically this boils down to: "When you have a single statement, that stretches out over more than one line, but
76.
▲
Why are programmers afraid of not using semicolons in JavaScript?
(programmers.stackexchange.com)
36 points
by
einaregilsson
15y ago
|
69 comments
77.
▲
by
einaregilsson
15y ago
Basically just posted about them on Facebook. Two of them also have links on the Wikipedia article for that game. And they all link to each other. The biggest referer is Facebook, with Google coming in second. Ive also created all of them a
78.
▲
by
einaregilsson
15y ago
My current hobby is writing simple cardgames in javascript. Currently I have Hearts - http://www.hearts-cardgame.com , Idiot/Shithead http://www.shithead-cardgame.com and Crazy Eights http://crazyeights-cardgame.com . Am getting my fi
79.
▲
Show HN: Online Guitar Chord Image Generator
(chords.einaregilsson.com)
2 points
by
einaregilsson
15y ago
|
0 comments
80.
▲
by
einaregilsson
16y ago
I try to automate as much as I can. I also use these little programs/scripts as opportunities to learn something new. Examples: 1. We had a support portal at work which I had to check regularly during the day. I wrote a small program that m
81.
▲
Show HN: Idiot/Shithead cardgame in html. 2 player games require FB login
(idiot-cardgame.com)
1 points
by
einaregilsson
16y ago
|
0 comments