101 reputation
2
bio website
location
age
visits member for 1 year, 2 months
seen Aug 14 '13 at 13:02

May
27
awarded  Commentator
May
27
comment Why are there so many numeric types (bit, int, float, double, long)?
@COMEFROM: It's true that an N-bit floats don't magically store any more information than an N-bit integer. However, in practice people mostly do not bother with mapping an N-bit piece of data to anything -- they just use the conventional 'float' or 'integer' types, or 'decimal' types, except for very small N(which are usually enumerations). It's in deciding between these that the aleph-X-infinity measure is relevant.
May
26
comment Why are there so many numeric types (bit, int, float, double, long)?
@JörgWMittag: However, that's questioner clearly is talking about static languages, not dynamic languages like Python, for example. CPython itself implements the 'unlimited range' integer as an array of 32bit ints, with the final bit in each int used to indicate if there are more bits to go. Also, integers can store any whole number only. That means that a float with infinite storage can store values to the precision (infinity aleph one), while integers can store values only to precision (infinity aleph zero).
May
25
comment Why are there so many numeric types (bit, int, float, double, long)?
In addition to HorusKol's answer: 'float' and 'integer' types are inherently different. Floats can hold very large numbers, but as the size of the number goes up, the precision goes down. This imprecision is because of the way floats are stored. By contrast, the range of values you can store in an integer is quite limited, but the value is always exact, so you can compare values much easier. Also, there are two different types of behaviour with division -- integers 'truncate' to the nearest whole number automatically, floats do not. Each of these behaviours are useful for different situations.
May
20
comment Passing an object between different handlers or a Superclass that contains most of the logic
Well, I didn't mean writing the lookup table by hand, I meant generating one with an algorithm. That way, you can separate those messy calculations of how to transition from basically everything else.
May
20
comment Passing an object between different handlers or a Superclass that contains most of the logic
So you have to make 3 tests and then 3 moves simultaneously in order to update the object. If the number of possible input locations and number of possible output locations is limited, does that mean that you could precalculate a lookup table with object-positions as keys and lists of possible-output-locations as values?
May
20
comment Passing an object between different handlers or a Superclass that contains most of the logic
Yeah, a nondeterministic finite state machine seems simple enough, but it doesn't seem to have the concept of being in multiple states at once; rather, for any given input symbol, the resulting state chosen may be one of several. This may be due to my limited knowledge of nondeterministic FSA, but I just don't see how a single object 'being in more than one state / at more than one node' at once is even logically possible, excepting if that state is actually made up of sub-states. .. Thanks for the interesting link, BTW :)
May
20
comment Passing an object between different handlers or a Superclass that contains most of the logic
So really your object has one state, but you classify that state along 3 different axes? If that's not it, I definitely don't understand.
May
20
comment Why do people consider Python a weak language?
@Nathan2055: Exactly how did "a few of your friends" become "so many people"?. None of the 'popular' languages like Python, Perl, Lua, Ruby, C, C++, or Java are commonly regarded as weak (even if some of them arguably should be.). Quite simply, this question seems like an exemplary demonstration of the Availability heuristic at work.
May
20
comment Passing an object between different handlers or a Superclass that contains most of the logic
"The Object can be in different states at the same time" -- this is a very vague statement that suggests that your program is based on quantum physics. To get a clear answer you will need to clarify at least what you mean by that.
May
19
comment What makes OOP “good”?
I suggest reading this summary of the philosophical and strategical differences between functional and OOP styles, for a start. It begins to get at what I want to say, which is the less state you need to track, the better functional-style is; and conversely, the more state you need to track, the better OOP is. In general OOP helps you not blow your foot off as system complexity goes up. (this assumes a sane OOP system -- eg. like Python, unlike C++.) As complexity goes up, you do more stupid things, and the safety provided by OOP is more valuable.
May
19
awarded  Supporter