14,641 reputation
13460
bio website
location
age
visits member for 4 years, 6 months
seen 8 hours ago

Jun
12
comment What features should a programming language have to say it has good reusability?
"Composition over inheritance". That doesn't mean inheritance has no place (though some recent languages get along rather well without it), but it shouldn't be your go-to solution for code reuse.
Jun
5
comment How do you hide error handling?
Both are bad in that they silently mask errors, so the caller can't react to errors.
Jun
4
comment Unit tests and language-native function calls
Use a language where those functions aren't magic, or otherwise different from user-defined functions. Then you can just do whatever you do with your own stuff ;-)
Jun
1
comment What is early and late binding?
@tdammers C++ actually does need a run time library, though not for virtual calls. If you read carefully, you'll notice that this answer says the compiler "injects code to look up the address of the correct function [...] at runtime".
May
31
comment Is it useful to use encapsulation in dynamic typed, interpreted programming language?
This is unrelated to the question, but your Python example in 3. confuses me. I've never heard of such a feature in past, present or future versions. A leading _ is a convention and nothing special. A leading __ (double underscore) invokes name mangling, but that doesn't cause a warning when overriding, it's just a hack that makes accidental overwriting much less likely by incorporating the class name into the attribute name.
May
30
comment Using <= for every dependency in case of following semantic versioning idea
Technically, Lib (>= 2.x, < 3) where x is the minor version that introduced the latest feature you rely on (perhaps a patch version too if you depend on a recent bug fix) would be safer, as it rules out 2.(x-1) which your code wouldn't work with.
May
30
comment Making Simple IF Statements Shorter
As I have written under another answer, the difference in IL may not mean anything. The JIT compiler can and most likely will eliminate any difference. I'd also like to object to your last point: If the condition is that complex, it is hard to read regardless how what you do with it. Solving that problem by extracting subexpressions into aptly-named variables improves readability in either case.
May
30
comment Does Turing-complete implies possibility of malware?
There are perfectly definitions of malware. They are not even remotely formal enough to be mentioned in the same paragraph as turing completeness though. This is not a bad thing in general, but it is a problem if you wish to discover mathematical truths.
May
28
comment Is there a compliance test for C++ compilers?
Boost works in major C++ compilers. Perhaps not ancient versions of those compilers, and perhaps not in a comparatively obscure compilers your company is relying on, but just look at that huge list of tested compilers in the release notes. And that's just the ones the Boost guys tested themselves! Boost is in no sense of the word academic, and you don't need to to evaluate compilers to dismiss that statement.
May
26
comment Why don't computers come with specialized hardware such as sorting networks?
@WorldEngineer I don't see how that enters the picture. Your average user doesn't know what 80% of the things in a modern CPU are for, they're happy because they are told it makes their programs faster (and this has a kernel of truth). If sorting was indeed as common as OP supposes and could be optimized by dedicated hardware, they'd put it next to the branch predictor ("what's that, gardening?"), issue a press release saying they made applications X and Y 5% faster, and sell it.
May
26
comment Why don't computers come with specialized hardware such as sorting networks?
Hardware isn't magic. Many things can't be accelerated much (or at all) by specialized hardware, and even if it can, existing hardware often has to be adapted (or at least re-compiled). See yosefk.com/blog/its-done-in-hardware-so-its-cheap.html
May
25
comment Is the Javascript bet a loser or a winner one?
70% of the question appear to be a rant that should be removed. And while I'm here: Your characterization of asm.js is inaccurate, it's not limited to porting C and C++ code and is independent of LLVM, Mozilla, etc.
May
24
comment Is there a specific name for the “Square inherits from Rectangle” paradox?
@MarkCanlas The problem is unarguably a violation of the Liskov substitution principle. It may not be a violation of other principles, but nobody claimed that. When the problem does not occur because the contracts do not include any invariant that would be broken (though I fail to imagine a useful model where this is true), there may not be a violation of the LSP, but that doesn't mean the problem, when it occurs, isn't due to a LSP violation.
May
21
comment A programming language that allows you to define new limits for simple types
Given how the languages you name handle integer over- and underflow, such a range restriction on its own wouldn't be worth much if you keep the silent over/underflow.
May
20
comment Run Time Type Identification using Composition
The R does not stand for real. It stands for run. RTTI is runtime type information.
May
19
comment What makes OOP “good”?
Modularization is older than even structured programming; it is orthogonal of the paradigm. Same for abstraction, composability. Now, you may argue that OOP does these things better than other options, but that is an order of magnitude less convincing and still quite arguable. I've never heard 5 and 6 cited as advantages, but "Continuity" sounds like a consequence from modularization and abstraction, and "Hierarchy" sounds like it's paradigm-independent as well (in fact, it sounds so trivial that I can hardly imagine a scenario where it's not feasible). -1 to counter +1
May
18
comment foreach over multiple lists at once
Note that this particular feature (iterating over several things "in parallel") arises naturally from a simpler and more general-purpose features (tuple unpacking). There's no special syntax for this in particular (as OP seems to be expecting), and that's a good thing.
May
18
comment Researching the growth of functional languages
You get what you measure. As you can see on the website, TOIBE measures how many hits "<language> programming" has on various search engines. Whether that is a decent metric for your notion of popularity is a different (and very hard) question.
May
17
comment What's the best way to create a static utility class in python? Is using metaclasses code smell?
Why do you want a "utility class" to begin with? What's wrong with module-level functions and constants? I feel it is not idiomatic because it avoids a perfectly simple solution and adds a lot of complexity just to introduce a concept which reeks of another language, not because it uses metaclasses unconventionally (I do that myself).
May
15
answered Good practice -apply paradigm to a language that is not fit for it