HNHacker News
TopNewBestAskShowJobs

Xion

580 karma · joined October 1, 2011

Software developer with wits and passion.

http://xion.io http://twitter.com/Xion__

submissionscomments
Xion··on Why You Should Work From A Coffee Shop, Even When You Have An Office
I find coding in a public, somewhat noisy place - like a coffee shop - pretty effective if you have a mundane but necessary task to do. The combination of ambient sounds to keep my brain busy while going through the boring parts, coupled with implicit social pressure of sticking to them ("Someone might have a glance at my screen, they better not see me browsing Facebook") makes it much easier to accomplish the task, compared to cozy, distraction-free environment of typical (esp. home) workstation.
Xion··on Labels in input fields aren’t such a good idea
There is another point:

    * Don't make your label use the same style as user-entered text.
I remember encountering a website that failed to do this, while satisfying all the other points. It was super confusing to learn that the texts were just labels and not pre-filled values, since they had the exact same color as the text I entered (unlike HTML5 placeholders that are dimmed).
Xion··on I’m Tired Of Companies Ripping off our site, So I’m Calling Them Out
Even better: the `_files` part in directory name indicates that they simply used "Save website to file" option in IE, which puts the dependent assets in directory named using this pattern. I imagine they just edited the HTML markup afterwards, without even bothering to check what's inside that directory.
Xion··on Are Placebos Really Sugar Pills?
> (...) as if though drug trials aren't already expensive enough, retarding scientific progress and costing millions of lives from drugs that would have been otherwise developed.

Isn't testing a vital part of this development, and by extension a crucial part of what you call scientific progress? The fact that we need more and more sophisticated testing techniques is because we understand more about the intricacies of human body and the ways it can interfere with treatment process. Placebo is an obvious example of such interference.

To me, calling a scrupulous testing process a factor that's retarding scientific progress is like saying QA is retarding software progress.

Xion··on In Love with LÖVE
> A very common pattern in Scheme and JavaScript (...) is to use closures to encapsulate state. Thanks to Python's scoping model, this is at best a pain and certainly unnatural.

It is also unnecessary. Python has normal classes, so you can contain your state within objects rather than stackframes.

Xion··on Stupid Languages
This example clearly violates the principle of least surprise, but it doesn't necessarily mean that the language it comes from is bad. Rather, the code it's used in is.
Xion··on Secrets in the code
Even if #4 is possible (I rather doubt it), you shouldn't really do that. It breaks the barrier between code and configuration by making the former influence the latter.

Such approach is simply not scalable. I don't know what secret_token.rb is (I do Python) but if it's anything like an HMAC key for encrypting your session cookies, your app will break once deployed to more than one frontend because the cookies will suddenly become tied to specific dyno.

Xion··on Introducing Drake, a kind of ‘make for data’
There seems to be few differences between Drake and just rolling out Makefiles for data processing, but I definitely see this project has potential. Distributed processing over AWS/Compute Engine/etc. clusters would be one nice thing to have, as a kind of simpler alternative to Hadoop.

I really like the inline, multi-language scripting though.

Xion··on I Support the WebKit Monoculture
If one implementation becomes the de facto standard, it only means that the standard is written nowhere. Quirks, peculiarities or even bugs become reference points that web developers need to build upon. The pace of innovation may be greater this way (as it is evident now in Chrome especially) but the long term risk is making the whole notion of independent standard irrelevant.

And if that happens, then whoever has the biggest influence over the leading browsing engine will dictate the shape of the Web. Last time this was a single corporation; at least this time it might be two. I don't necessarily think this is very much better.

Xion··on What It's Like To Be Ridiculed For Open Sourcing A Project
I somehow feel the "Twitter culture" itself is partially to blame. A setting that rewards short, sharp, witty remarks that skirt over the surface is just few small steps away from endorsing sarcastic, bitter, passive-aggressive or even over-the-top spurts.

It's no wonder that no one who made those stingy tweets did respond to author's replies and questions. They didn't want to start a discussion in the first place.

Fortunately, the pendulum can also swing the other way here, as they are people who readily jump to defend against harassment.

Xion··on Why was '~' chosen to represent the home directory?
When starting vim (any editor, really) you usually begin at the top. So you want to go down first...

Oh, this `j` key has an inset to distinguish it from the rest. Surely this means I need to press this one!

(You can easily figure out the three other keys from there).

Xion··on Now Google is blocking Windows Phones from accessing maps.Google.com
Isn't it exactly what Google is refraining from? Since the Maps work crappily on non-WebKit mobile browsers, allowing them to be used is delivering bad experience.

I fail to see how this is different than e.g. not supporting Flash on iOS devices due to poor performance and battery drain - a then-controversial move which is now seen as reasonable even outside the circles of Apple fans.

Xion··on This mom gave her son an 18-point contract with his iPhone
And how on Earth is this rule enforced? I'm genuinely curious. Even if it's something like asking for SSN if IP addresses s from US, it would be bypassed easily by a simple proxy.
Xion··on Json ⊄ js
The other thing is that JSON scoffs at trailing comma (both in object and array literals), while JavaScript engines are perfectly happy to accept them.
Xion··on Ask HN: I’m not cut out to be a programmer. What are my alternatives?
Try product management. If you can understand both people AND tech aspects of making software products, you'll be golden there.
Xion··on Ask HN: Best Movies you saw in 2012?
Eh, my reaction to it was quite the opposite. There is even this scene when it's clearly proclaimed that the scriptwriter has simply given up on maintaining any consistency whatsover, resorting to "anything goes" approach instead.

And funnily enough, the movie isn't really about time travel.

Xion··on I hate comments
And how these particular flaws of Java are relevant to the comments-or-not discussion at hand?
Xion··on I hate comments
The reason you call Java annoying is exactly the one why Java code is so conducive to refactoring practices described in Clean Code: it mandates great verbosity.

Everything in Java is Big Deal, even something like a simple loop going through a collection and applying a one-liner to every element. In Java, you have to divide things aggressively for code to remain readable and maintainable. Otherwise it's way to easy to lose the big picture.

When methods are few lines tops, their names are descriptive, and you have explicit types of arguments and return values, it's no wonder you hardly ever need to comment anything.

Other languages can be very different in this regard. Take Python, ironically the language author's using in his examples.

Python is terse and expressive; does not specify types in code; has everything as first-order values; prefers short names due_to_naming_convention; and makes extracting code into functions a significantly bigger deal (everything is public, needs to have docstring, etc.). Those traits often need to be offset by a little more prose than you would put into code in other languages.

So while Clean Code certainly sounds convincing (I know I treated it almost like a revelation), it needs a little more perspective. Commenting practices are just one more tool that you need to match to the job - and language - at hand.

Xion··on A non-programmer’s solution to “Fizz Buzz”
I wouldn't be so quick in concluding that the long back arrow stands for recursive looping. I'd guess it's just a non-coder notation for "and then do that thing again", for which the closest equivalent in actual language would be the `while` loop (most likely infinite, as the author remarked). I don't see the meta-level of considering the algorithm/procedure as a whole here, a one that is needed for thinking in terms of recursive application.

Furthermore, the fact that non-programmer expects to be able to poll the state of everything around (like the numbers which were already printed) would indicate that in their mind, there is no separation between the program/algorithm and the environment it is executed in. (Ironically, this is completely accurate viewpoint if we're thinking at the level of actual machines, be it real ones or abstract models like Turing machines.)

Xion··on Google Casts a Big Shadow on Smaller Web Sites
> The government’s scrutiny of Google is the most exhaustive investigation of a major corporation since the pursuit of Microsoft in the late 1990s.

I can't help to notice that apparently in the last 15 years or so, a significant government interest was only focused on high-tech companies. Looks like more "traditional" branches of economy and companies working therein are generally behaving fine...

Companies like Lehman Brothers, for example.

Xion··on Nonsense Accusations of Spaghetti Code Considered Harmful
The author argues that callbacks do not necessarily impact code's readability in a negative way. However, he does so while presenting examples in CoffeeScript, a language where reduction of the usual JS callback boilerplate (`function() { ... }`) is one of the main perks.

In other words, he claims there is no issue by presenting a possible solution to it.

Xion··on Programming is a Pop Culture
Putting a 'Discuss on Hacker News' link instead of comments section is a common practice as of late. It's not just this particular author.
Xion··on Welcome to Polygon. It's a website (finally)
The website is absolute performance nightmare. It hanged my browser for 10+ seconds before I was able to do anything. Less Javascript, please.
Xion··on How a Google Headhunter’s E-Mail Unraveled a Massive Net Security Hole
Or paranoid. Or naive. Or narcissistic.

It might be somewhat feasible if they wanted him to be security engineer, not a devop. Still, he expected they have set up what essentially is an elaborate prank just to send a cold-call email to just one of probably numerous potential candidates.

How likely this is? What would be the risk-to-reward ratio for doing that, considering that many of unsolicited recruiting mails are not even read? Isn't it more feasible for it to be a genuine mistake on their part? Google's not infallible, omnipotent being after all.

Xion··on iPad mini
It is 0.6mm thicker and 50g heavier. That's a 6% and 7% increase, respectively. I wouldn't really call it 'significant'.
Xion··on Woman Posts Boyfriend Request on GitHub, Requires Access to His Server
> Maybe it's because I'm only 23 and I'm not that "desperate".

I'm 25 and I find this cute. That's assuming, of course, that the funny list of 'requirements' is mostly to spark discussion rather than actually weeding out people by following them to the letter.

"Sorry, you only meet 26 of the points, and that's counting your dubious credentials for the Peter Drucket one." -- Hopefully not. "Hey, that project X from your Github is pretty neat. Did you consider using technology Y for Z in it?" -- Maybe.

Xion··on Free Flag Icons
Eh, I don't think (s)he meant authors should do that. I suppose it's only an idea, shared here with hopes that maybe some HNer will pick it up.
Xion··on Free Flag Icons
How do you indicate a language in icon-like manner then? Is using the textual ISO codes the only safe option?
Xion··on Guido van Rossum's Performance tips for Python
It would seem that loop bookkeeping dominates execution time here. Without it, I get quite different results:

    >>> timeit.timeit("'%s' % i", setup="i = 42", number=1000000)
    0.31799793243408203
    >>> timeit.timeit("str(i)", setup="i = 42", number=1000000)
    0.4146881103515625
This is another argument for profiling everything.
Xion··on Guido van Rossum's Performance tips for Python
Python code optimization is actually tricky ground where analogies from other languages (like C/C++) don't necessarily apply.

One of the more surprising results (esp. for non-pythonists) is the fact that string formatting:

    s = "%s" % some_integer
is faster than "casting" to string:

    s = str(some_intenger)
That's solely because looking up the 'str' symbol requires finding an element in global symbols' hashtable. This turns out to be more expensive than parsing the format string and building the result of % operator.
← PreviousPage 2 of 4Next →