2,426 reputation
2617
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 3 years, 8 months
seen yesterday

May
7
comment What has research shown about the effectiveness of comments?
Why have an example code as comment instead of as actual executable code?
May
2
revised If null is bad, why do modern languages implement it?
added 419 characters in body
May
2
answered If null is bad, why do modern languages implement it?
Apr
20
comment Browser security and payments
Even with TLS you need to trust the server which delivers the javascript. This problem can only be solved by improving browsers and even then only in part. For example if a shop website embeds javascript from an ad server it trusts, but the ad server is actually malicious (perhaps it was hacked) that server can send a copy of the CC data to the hacker.
Apr
20
comment Browser security and payments
First one is about code style, second is just as bad for native code. Only the lack of secure erase is a real issue, and one with little relevance to credit cards since it this only matters when the client gets compromised later on. The biggest issue IMO is how common it is to embed external javascript instead of serving it from your own. SSL is good enough for low value targets like CC numbers, but might not be good enough for liberationtech.
Apr
20
comment Browser security and payments
The point of these posts is that javascript cryto doesn't add any security over https -- not that https is insecure. In particular javascript crypto without https is not secure, and javascript crypto over https doesn't protect you from a malicious server. There are people who claim they don't need https or that they're safe from malicious server, which is not true.
Apr
17
comment How to design an IDisposable that unconditionally needs to be disposed?
"Eventually" is "once the app domain is shut down" in this case. So it's a memory leak if you don't dispose it manually.
Apr
16
comment How would another popular language avoid having to use the factory pattern while managing similar complexity as in Java/Java EE?
The problem isn't the use of factories -- it's a perfectly fine pattern. It's the overuse of factories which is especially prevalent in the enterprisey java world.
Apr
7
comment Real time unit testing - or “how to mock now”
In many cases it's simpler to pass a value DateTime now to the code instead of a clock.
Apr
2
comment how are virtual methods slower in C#
Since the CPU doesn't execute IL, it doesn't matter what the IL uses, it matters what machine code the JIT produces. For virtual methods that's an indirect call, for non virtual methods it's a direct call or the callee even gets inlined into the caller.
Mar
31
comment Is there a Pattern or a Refactoring Method to pull data-loading out of existing Class
Usually an entity should not know how to load itself from the database. You also forgot to pass the database to your constructor/provider.
Mar
31
comment Why is CPU cache memory so fast?
You need to halve that number since you need a round-trip to retrieve memory. So it's just 5cm not 10cm per cycle of latency in vacuum.
Mar
21
comment Is better Show() + Hide() or SetVisible(bool visible)?
@ArlaudPierre Then I'd still need to use the awkward if(...)Show();else Hide(); pattern in outside code or write a SetVisible helper method.
Mar
7
comment How is the publish-subscribe pattern different from gotos?
It's closer to INTERCAL's "come from".
Feb
26
comment Suggest a best practice to create Constants class
Are your constants actually constants in the mathematical sense, or is this a form of configuration?
Feb
26
comment Suggest a best practice to create Constants class
I don't get your question. If a class has no instance members, you can mark it static. This is completely orthogonal to the presence or absence of a static constructor.
Feb
25
comment Was there ever a serious push for partial classes in java
While C# introduced it for code generating UI editors, they're not a good example IMO. They should use a declarative format instead of generating code.
Feb
25
comment An alternative to an array of functions?
Can somebody explain why those non working examples don't work? The answers focus on better solutions, but I don't understand why the original code does not work.
Feb
19
comment How do purely functional programming languages deal with fast changing data?
Many immutable data structures have O(log(n)) cost for operations. But there is no practical difference between O(log(n)) and O(1), constants (which the O notation neglects) are just as important as asymptotic logarithms.
Feb
17
comment Make a change that is ignored by future merges
That's why I said that you should isolate local configuration into a separate config file. All machine specific configuration should be put in that file.