Reputation
14,120
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
1 21 50
Newest
 Enlightened
Impact
~372k people reached

Aug
3
comment How do people get rid of conditional branches in Functional Programming?
@TimPote: Added explanation of what I mean by object-oriented. I also removed the mention Haskell lacks inheritance, because Rust also lacks class inheritance, yet it does have dynamic polymorphism. Yes, I equate OO with dynamic dispatch. I don't equate functional with static-dispatch though. That would make functional programming the opposite of object-oriented, but I explicitly state that most functional languages are also object-oriented. Functional means use of higher order functions and avoidance of side-effects.
Aug
3
revised How do people get rid of conditional branches in Functional Programming?
detail what I mean by object-oriented
Aug
3
comment How do people get rid of conditional branches in Functional Programming?
@TimPote: Java definitely dispatches on runtime value of the invocant (though not the other arguments). Haskell has a type-dispatch, but unless you use the ghc forall extension, it is completely compile-time.
Jul
30
comment How do people get rid of conditional branches in Functional Programming?
@Tim, ad point 3, the answer does not state that Haskell was only such language. Only that it is an important example of such language. Where did you see the word “only” in it?
Jul
30
comment How do people get rid of conditional branches in Functional Programming?
@Tim, as long as language has ability to define traits/interfaces for objects and can have trait-typed variable (including fully dynamic) with dispatch based on the actual value at runtime, I call it object-oriented. That's all of object orientation you'll get in many new languages (e.g. Go, Rust) and class inheritance is being discouraged in the languages that have it anyway. The inheritance scheme you linked is a trait-based inheritance, so I count it as object oriented.
Jun
14
comment Did C++11 address concerns passing std lib objects between dynamic/shared library boundaries? (ie dlls and so)?
@user877329: Or maybe ODR should be explicitly phrased in a way that implies that whenever the code refers to x, the same definition for what x means must be used. Then it does not apply to symbols that are only used by dlsym/GetProcAddress, so plugins don't have to break ODR. It still does apply to any other symbols in plugins and it better should, because having two instances of common class impedimenta is going to break stuff.
Jun
14
comment Did C++11 address concerns passing std lib objects between dynamic/shared library boundaries? (ie dlls and so)?
@user877329: A plugin indeed must. But most shared objects are not plugins (shared object == dynamic library). And even for plugins, the exception to ODR really only applies to symbols loaded via dlsym/GetProcAddress and it only applies because nothing ever expects them to be the same. If plugins cause multiple versions of some symbol that is used via direct code reference like virtual method table of shared class or operator new, things are likely to get very ugly.
Jun
7
awarded  Enlightened
Jun
7
awarded  Nice Answer
Apr
30
comment Copyright for collaborative group
@Toby: There will also likely exist quite a bit of general advice for voluntary associations (or whatever the basic type of non-profit is) which will deal with the membership and governance parts, so you only need to decide whom you grant the right to sublicense the managed works for third parties.
Apr
30
comment Copyright for collaborative group
@Toby: No, sorry. Besides, I am almost certainly in different jurisdiction and you need something in yours. Perhaps try looking for some software or research foundations; they may be having similar legal problems.
Apr
30
answered Copyright for collaborative group
Apr
21
revised Does using a database server make sense if the application only does things locally?
added 23 characters in body
Apr
21
answered Does using a database server make sense if the application only does things locally?
Apr
21
comment Does using a database server make sense if the application only does things locally?
SQLite does provide referential integrity (though it needs to be turned on) and basic constraints. It is also significantly faster than most server if used properly. It's main disadvantage compared to server is that it is single-writer.
Feb
27
comment How to avoid violating one definition rule in this case?
@ZijingWu: I've added suggestion how you can prevent linking against wrong library binary. It's slightly hackish, but should serve the purpose.
Feb
27
revised How to avoid violating one definition rule in this case?
mention solution for edit
Feb
27
revised How to avoid violating one definition rule in this case?
mention solution for edit
Feb
27
answered How to avoid violating one definition rule in this case?
Jan
27
comment Why does this algorithm work in O(n m)?
@DhruvMullick: Number of iterations means the number that the third clause in the for is executed. The point is that maximum for b is number of edges from a, which is O(m/n), not m.