Reputation
17,760
Top tag
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
1 47 70
Newest
 Nice Answer
Impact
~288k people reached

Aug
25
comment Generic term for “objects” vs “fundamental types”?
@tp1 Only among people who take one (admittedly insightful) idea from type theory too far. Almost everyone else will stare at you blankly, even/especially those who are familiar with the more common use of "Cartesian product".
Aug
24
comment Why is float the default in the majority of languages?
@DaveHillier I didn't say "too hard", I said "hard". I can't judge whether it's exactly as hard to implement as a binary float (the naive, slow, inaccurate algorithms are probably more familiar as we're used to base 10), but it's nowhere as simple as a fixed-point format.
Aug
24
comment Why is float the default in the majority of languages?
@StevenBurnap Faking a fixed-point decimal number if easy with an int. But so is a fixed-point binary number, I'd wager. A decimal floating-point number (yes, that's a thing) is hard too. And in any case, this is only an argument for having a built-in implementation, not for making said implementation the default.
Aug
24
comment Why is float the default in the majority of languages?
No, not really. Perhaps I'm being dense, but all I see is reasons that floats are okay in some respects. But you don't seem to address OP's reasons to prefer decimal floats, and the downsides are not inherent but only due to the number of bits a particular implementation uses (consider arbitrary-precision decimals as in Python - they are potentially superior in range, accuracy and precision). You could argue that binary floats offer a greater range for the same number of bits, but the answer as of now doesn't and honestly that seems like a bad reason for many high-level languages.
Aug
24
comment Why is float the default in the majority of languages?
Those paragraphs explain why some languages get away without a separate integer type, not why both those languages and those with a separate int type default to binary floating point.
Aug
24
comment Why is float the default in the majority of languages?
So how does your answer address the question, as none of the facts you present disqualify base 10 floating point numbers as default data type?
Aug
24
comment Why is float the default in the majority of languages?
.NET's decimal is only one possible decimal type. I haven't implemented one myself but I really doubt this is inherent to base 10 - in other words, I think one could have a decimal floating point type with a range comparable to IEEE 754 (but the same issues at that magnitude, of course).
Aug
23
comment Should I be commiting code quickly and testing later?
Pray tell, how do you think this will help with the deadline?
Aug
23
comment What is the size of a reference variable in java. Can it be calculated?
With C, it also depends entirely on the implementation. You can compile for 32 bit (plain old x86) and get 4-byte pointers, or you can use 64 bit instructions and registers but 4-byte pointers (x32 ABI)!
Aug
19
comment How to handle divide by zero in a language that doesn't support exceptions?
@JanHudec They certainly still apply, and I can see reasons to say they apply just as strongly, but I don't see why they would apply even more for DSLs. The much smaller scope makes good design slightly less impossible than for general-purpose programming languages, and for many DSLs the implementation is much simpler than a fully-blown "real" programming language compiler or VM.
Aug
18
comment How to handle divide by zero in a language that doesn't support exceptions?
@MathewFoscarini Ah, for very restricted domain specific languages my criticism are less applicable (though language design and implementation is always hard to do well, no matter what the purpose).
Aug
18
comment How to handle divide by zero in a language that doesn't support exceptions?
I'm curious, what kind of stupid requirement would require you to create a whole new programming language? In my experience, every language ever created sucks (in design or in execution, often in both) and it took unreasonably much effort to even get that much. There are a few exceptions to the first, but not to the second, and as they're easily <0.01% of the cases, they're probably measurement errors ;-)
Aug
16
awarded  Enlightened
Aug
16
awarded  Nice Answer
Aug
15
comment Inner workings of the IF() function - why aren't expressions evaluated?
I wouldn't be surprised if IF() wasn't a regular function but special in this regard, perhaps a keyword which just mandates parentheses to look like a function. This isn't an answer I have no idea how to verify my hypothesis. If this question is about VB.NET and not earlier versions, there may be an ECMA spec somewhere.
Aug
15
comment What should be the sense to use strict comparison to this specific string: 'final'
I'm afraid I didn't understand your objection to using triple equals. I've run your coworkers's code and it outputs true. That would indicate he is right and a malicious or careless type could pass the condition despite not being a string.
Aug
14
comment Why are reference-counting smart pointers so popular?
@JanHudec Python (by which you mean CPython, I assume) hangs onto refcounting because every piece of code even slightly related to its API, including millions of lines of third party code, is completely dependent on refcounting and non-moving objects.
Aug
12
comment Is modifying an object's __dict__ to set its properties considered Pythonic?
Though SimpleNamespace is quite different from most types in that it doesn't have a fixed set of attributes.
Aug
12
comment Reusing open-source code that doesn’t specify a license
If it doesn't include a license, it's not open source. Maybe it's on Github in violation of their TOS.
Aug
9
comment Should I make a variable readonly when I modify it, but I don't actually set it outside of the constructor?
It's only confusing if you the difference between references and objects isn't deeply ingrained in your brain.