Reputation
18,090
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 73
Newest
 Nice Answer
Impact
~310k people reached

Apr
27
comment Why do most mainstream languages not support “x < y < z” syntax for 3-way Boolean comparisons?
I also contest the last paragraph. Python supports chains comparisons, and its parser is LL(1). It's not necessarily hard to define and implement the semantics either: Python just says that e1 op1 e2 op2 e3 op3 ... is equivalent to e1 op e2 and e2 op2 e3 and ... except that each expression is only evaluated once. (BTW this simple rule has the confusing side effect that statements like a == b is True no longer have the intended effect.)
Apr
22
comment Can I safely ignore byte order in networking?
You need to distinguish between the metadata that is required by the network protocol, and the payload which is just a bunch of uninterpreted bytes for everyone except your code. I hope you're not rolling your own networking stack. Consequently I assume the question is only about the payload, correct?
Apr
6
comment Is using a function inside a for loop bad practice?
I ... what ... how ... where did you read that? On The Onion?
Apr
5
comment Why Variables in Python Are Different from Other Programming Languages?
@JörgWMittag CPython is by far the most popular implementation, and it does no such thing. PyPy does, Jython may, but they're so far behind in popularity that I wouldn't count them as "popular". Perhaps you're confusing Python with other languages that are all-reference-types such as Ruby?
Apr
5
comment Why Variables in Python Are Different from Other Programming Languages?
This is not a matter of Python vs. all other languages. Countless other popular languages are very much like Python in this respect, with only some slight differences. Examples include Java, virtually all other JVM languages including e.g. Groovy and Scala, Ruby, C#, other .NET languages like VB.NET, etc.
Apr
3
comment If LYBL is faster than EAFP, why should I use try/except over hasattr?
You didn't benchmark the case where the attribute exists.
Mar
29
comment Should we “balance” the amount of codes between headers and cpp?
You enumerated some conditions where your reasons for not putting code in headers don't apply as much. But as far as I can see, you don't name any reasons why code should be in headers.
Mar
24
awarded  Nice Answer
Mar
22
comment What type of encoding does wikipedia use?
@RobertHarvey Now I'm curious: Did you read the earlier version as referring to the characters ë and ã? In restrospect could see it being ambiguous, which was really unfortunate because it's the opposite of what I meant. I hate these 8-bit encodings to a large degree because they gives English-only speakers who want to write Æ an excuse to not go straight to Unicode. Or is it politically incorrect to call antiquated inadequate character encodings "uncivilized" now? :P
Mar
22
comment What type of encoding does wikipedia use?
@RobertHarvey clearer now?
Mar
22
revised What type of encoding does wikipedia use?
added 59 characters in body
Mar
22
revised What type of encoding does wikipedia use?
added 569 characters in body
Mar
22
revised What type of encoding does wikipedia use?
added 569 characters in body
Mar
22
answered What type of encoding does wikipedia use?
Mar
18
comment python snippet optimization explanation
dis.dis(func(8)) doesn't do what you think it does. It executed func(8) and then interprets the resulting string as bytecode. The result is meaningless and in no way related to the bytecode of func. To disassembe func, just write dis.dis(func)
Mar
15
awarded  Nice Answer
Mar
11
revised Why does expressing calculations as matrix multiplications make them faster?
added 69 characters in body
Mar
11
revised Why does expressing calculations as matrix multiplications make them faster?
added 1532 characters in body
Mar
11
revised Why does expressing calculations as matrix multiplications make them faster?
added 1532 characters in body
Mar
11
answered Why does expressing calculations as matrix multiplications make them faster?