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

Sep
25
comment Why is “tight coupling between functions and data” bad?
My impression is that most criticism of OOP is actually criticism of OOP as implemented in Java. Not because that's a deliberate straw man, but because it's what they associate with OOP. There are pretty similar issues with people complaining about static typing. Most of the issues aren't inherent in the concept, but just flaws in a popular implementation of that concept.
Sep
25
revised Why is “tight coupling between functions and data” bad?
added 41 characters in body
Sep
25
comment Why is “tight coupling between functions and data” bad?
@JörgWMittag My impression is that many who criticize OOP criticize the form of OOP used in Java and similar languages with its rigid class structure and focus in instance methods. My impression of that quote is that it criticizes the focus on instance methods and doesn't really apply to other flavours of OOP, like what golang uses.
Sep
25
comment Why is “tight coupling between functions and data” bad?
@GlenPeterson Because I originally wanted to write only a single sentence, and it kept growing
Sep
25
answered Why is “tight coupling between functions and data” bad?
Sep
25
comment Why is “tight coupling between functions and data” bad?
Instance methods (unlike free functions or extension methods) can can't be added from other modules. This becomes more of a restriction when you consider interfaces which can only be implemented by the instance methods. You can't define an interface and a class in different modules and then use code from a third module to bind them together. A more flexible approach, like haskell's type classes should be able to do that.
Sep
19
comment Are there any valid use-cases for eager boolean evaluation?
IMO the only advantage is that you clearly see the difference between short-circuiting && on bools and non short-circuiting & on integers.
Sep
19
comment Are there any valid use-cases for eager boolean evaluation?
&& vs & is only about observable behavior (side-effects), which doesn't include timing. So using & doesn't help in the crypto case, because the compiler is free to optimize it to && if it knows that the right hand side has no side-effects. You need to use code that sufficiently confused the compiler that it doesn't manage to optimize your code, which in practice involves using & on integers not on bools.
Sep
19
comment Is it appropriate for interviewers to ask candidates for their Stack Exchange user name?
Just keep in mind that old questions/answers might not match the current knowledge and abilities of somebody.
Sep
15
revised Why is this syntax convention?
Format code as code, so `<` and `>` don't get interpreted as html
Sep
15
suggested suggested edit on Why is this syntax convention?
Sep
14
comment What is the gain from 64-bit architecture?
The obvious answer is support for more than 4GB of memory in a single address space. But in my experience it speeds up the code itself by a lot as well. A lot of the code I'm working with is twice as fast when running as 64 bit process.
Sep
12
comment Why the question “give five things you hate about C#” is so difficult to answer during an interview?
I agree with your first two points, but I shudder at the idea of an extension implicit conversion.
Sep
12
comment Why would I ever use delegates if I'm not doing events?
Functional programming is a great application. C# programmers will mostly see it in the form of LINQ.
Sep
5
answered Finding an object on an infinite line
Aug
9
comment changing value of a private member of a class in c++ without using member or friend function
But the C# variant is a bit different since low trust code can't use it. C++ on the other hand only knows fully trusted code.
Aug
9
answered What is global mutable variable behaviour in dynamically-linked libraries?
Aug
1
comment How can I reverse engineer a hash code?
@Pieter Don't migrate to SHA-1 or even SHA-2. If you migrate, use a specialized password hash, like PBKDF2, bcrypt or scrypt. See How to securely hash passwords? on security.SE for details.
Aug
1
comment How can I reverse engineer a hash code?
I also consider using non standard, closed source crypto without spec extremely negligent. What if they use a cheap unsalted hash? Many people think SHA-2(password) is a good choice. Consider using a standard hash in the application, instead of relying on the database for this.
Aug
1
comment How can I reverse engineer a hash code?
First try to find a third party implementation of the hash. Perhaps somebody already did the work for you. If not, download a debugger/disassembler and get cracking. Good luck.