Reputation
16,586
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 42 66
Newest
 Good Answer
Impact
~235k people reached

Aug
4
comment Localizing an app whose data is tied to one language
I myself have only had one two-month work experience in another country, but I'd expect that a foreign student can handle the language of the country they visit well enough to get by, and furthermore that having to deal with it is part of the appeal. In other words, what's the point of localizing this app for foreign students?
Aug
2
comment Why are methods considered the class attributes in Python?
In Python 3 methods are even less special. There aren't any unbound methods any more. All functions are descriptors which create bound methods when looked up through the class (and as in Python 2, any custom callable class can add a three-line __get__ to get the same behavior, though I've never seen anyone do this).
Jul
28
comment Preventing password hashing algorithm from overloading CPU
@JamesSnell Then you don't gain any benefit from using bcrypt (i.e. might as well use MD5 exclusively) because in the case bcrypt would help - attacker having a copy of the database (or at least of the hashes) and running the attack offline - the attacker can just ignore the bcrypt'd passwords and attack the MD5'd passwords. Maybe there are other benefits but I can't imagine any and have never heard anyone claim any.
Jul
28
comment Preventing password hashing algorithm from overloading CPU
Performing the hash should be slow, so that reversing the hash is slow even if the attacker drastically shrinks the search space, for example by performing a dictionary attack rather than brute force collision search. Note that "slow" here means "slow for a single operation, compared to fast hash functions", i.e. taking something between a microsecond and a second to hash one password, not "infeasible" like trying 2^128 or more inputs.
Jul
27
comment Are closures sufficient to characterize functional programming?
Also, I'm a bit surprised by memoization. It's not like it's built into any major languages (not even Haskell, where it would be comparatively easy to do correctly). It's easier with functional code, but I don't think of it as a hallmark of functional programming. It's just one of many tools that fits the paradigm well, much like how in-place sorting fits imperative languages rather well.
Jul
23
comment Is PHP “list()” language construct a bad convention?
Well, even if "pythonic" makes sense applied to things which aren't Python, it isn't necessarily good in the context of the whole design. I say this despite liking Python very much and PHP not so much.
Jul
14
comment “every statement and declaration an expression that yields a value” why?
You mean why Bjarne would do that if he designed a language from scratch? You'll have to ask him.
Jul
12
comment Recommended Abstraction to transfer data over a nework than byte[] array?
UTF-8 is much more common on the web than UTF-32, and that's a good thing. For starters: UTF-32 is easily larger even if the content is primarily outside the BMP (as HTML etc. are still ASCII), and the ratio gets worse when it's primarily English text such as on this site.
Jul
12
comment Recommended Abstraction to transfer data over a nework than byte[] array?
@ScottWhitlock I'm not sure, but I believe for most common network protocols (TCP, UDP, and everything built on them) the smallest unit of data is a byte, not a bit. There is an abstraction over bits alright, but it's several levels below the API that accepts a byte array.
Jul
11
comment Why does OCaml's (and F#'s) type inference algorithm need tagging functions as recursive?
@Simon I disagree. This question is about type inference specifically, and neither that question nor its answers address that.
Jul
10
comment Building a tool to fix compiler errors automagically
See programmers.stackexchange.com/a/30242/7043
Jul
9
comment Creating a new file format: Write code or documentation first?
@user61852 I am perfectly aware of that. However, both in this question and in general, virtually all specs end up being implemented (and if not, they are not particular interesting for anything but learning, so we can stop considering them). Whoever implements it will have an easier time and happier users if the spec author spent some time learning how their ideas work out in practice (both implementation and use). And "while writing the first revision of the spec" is as good a time as "after writing the first revision of the spec" for that.
Jul
9
comment Creating a new file format: Write code or documentation first?
I didn't say you don't need a specification. I was referring to the "initial specification" you were talking about. I'm saying you don't need a specification to prototype a file format (or anything else that benefits from a specification), and that you can write a specification while you implement it (or vice versa, if you prefer this way to think about it).
Jul
9
comment Creating a new file format: Write code or documentation first?
Must? As in, nothing else is gonna work? I highly doubt that, developing spec and implementation from very early on seems to work just fine. Unless by "initial specification" you mean "a rough idea in the implementer's head".
Jul
9
comment Creating a new file format: Write code or documentation first?
... and one good reason for that is that it helps discover issues (unnecessary complexity, security issues, missing features, etc.) before the spec is finalized.
Jul
8
comment Can compilers and interpreters have bugs, and what can we (as users) do to deal with them?
This is a quite interesting topic, but not at all related to this question.
Jul
8
comment Can compilers and interpreters have bugs, and what can we (as users) do to deal with them?
@Gaius Because version numbers aren't only bumped when fixing bugs but also when adding and removing features. In fact, under semantic versioning, the part of the version number you notice (major and minor part) don't change at all for bug fixes. You could fix a thousand bugs over a hundred releases and still be at v1.0.
Jul
8
comment Hardware that accelerates pointer dereferencing?
Interesting related read: yosefk.com/blog/its-done-in-hardware-so-its-cheap.html
Jul
7
comment Shouldn't documentation be written together with tests rather than in the code?
That may make the implementation simpler (though I honestly doubt it, just getting the data out of there may require severe metaprogramming gymnastics), but I don't see it being better for the people who read and write the documentation. For starters, look at all the extra punctation and consider that many characters in string literals need escaping.
Jul
7
comment Shouldn't documentation be written together with tests rather than in the code?
And you think this is an improvement over existing markup languages for documentation (doxygen, reStructuredText, markdown)?