5 ms·
There are use cases where you need the choice, but most people do not need the choice. Most programs written in the real world (enterprise-y Java apps) do not
by rtpg 12y ago
There are use cases where you need the choice, but most people do not need the choice.
Most programs written in the real world (enterprise-y Java apps) do not need strong control on GC, choice of integer types, or many other things offered to them. Reducing choice will increase code/tool quality.
I think that we should make the uncommon choice reallllly hard to put into place. Make it a pain to configure the GC, give specific integer types really long names. Just stop people from premature optimization and leave these tools to people who know what they're doing.
- danbruc 12y agoIf you are unable to make good decision between different number types you better don't write software, IMHO. How do you reason about the operations you apply to your data if you are ignorant of the possible values?
- rtpg 12y agoI write software, and the amount of times I even have to explicitly manipulate numbers in a given week is very close to zero. Even iteration is done through iterators instead of indexes, so writing a plus sign is done pretty sparingly. Data manipulation beyond "pull out of database" or "submit user input to database" is a lot rarer in enterprise software like this than in scientific computing. I'm not saying it's bad to be aware of it, but software is more than numbers.
- danbruc 12y agoI develop enterprise software, too, and I definitely think it matters there, too. You better make sure your database columns have the correct number type or you will get in trouble if your inventory numbers or monetary values start showing rounding errors.
- ionforce 12y agoYou are comparing two different types of numbers. What was originally compared was different sized integral types. What you are comparing is two numeric types that have a large semantic gulf (fractions vs integers). So your point is disingenuous in the context of the former.
- danbruc 12y agoI just wanted to address your point that enterprise software does usually not involve dealing with numbers. When it comes to integers you are right - signed and 32 bits is a viable choice in north of 90 % of all cases. And when I wrote you should be able to make good decision about the number type to use I was already thinking of all the number types, however I did not express this well. But then I really don't see a lot of difference between being able to choose between integer, floating point and decimal types on the one hand and various integer types on the other hand.
- rtpg 12y agoYeah, you're right, data types matter. Like sibling said, this was more in response to signed/unsigned or different bit sizes. We could get rid of minutiae while still allowing for broad choice when it actually matters. I do think that the difference between Integer/Fractional is important, but honestly if you're dealing with money you should be using some Money datatype that's smart about this instead of raw numbers.
- cbhl 12y agoEven if you abstract away the indexes, when working with datasets that large you have to worry about whether the standard implementation makes the same class of error. For example, using Java's binarySearch on arrays of length over 2^30 was broken until 2006[0][1]. [0]: http://googleresearch.blogspot.com/2006/06/extra-extra-read-all-about-it-nearly.html http://googleresearch.blogspot.com/2006/06/extra-extra-read-... [1]: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5045582 http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5045582
- coldtea 12y ago>If you are unable to make good decision between different number types you better don't write software, IMHO. Doesn't sound very humble, this "HO". Do you know how many programmers that run circles around you (and me) have done mistakes similar to what Doug describes?
- danbruc 12y agoBeing able to make good decisions does not guarantee you will never make a mistake. And he even explains his reasoning behind his choice and it was a justifiable decision when he made it. But I stand by what I said - if you are unable to decide between using 8 bit or 64 bit integers or a floating point type or a decimal type you should not be a professional software developer because it is really a very basic and fundamental skill.
- sysk 12y agoThen what do you propose we call the people who write Ruby, Python, Javascript, PHP, etc. code for a living? Have you heard of accidental complexity?
- danbruc 12y agoRuby, Python and PHP all support several types of numbers. But even if they did not this would not preclude people developing in those languages from being able of making such decisions.
- onion2k 12y agoIn the web industry, which is the biggest part of the software industry by people employed, most developers use dynamically typed languages and very happily never make this "fundamental" choice. Should they all resign?
- markokrajnc 12y agoNot only web industry: in Smalltalk every integer can have unlimited number of bits. On 32-bit systems internally 31 bit is used first and with overflow it automatically starts using variable size integers... There is no need to make a choice on the number of bits... Just use integers as they are in the nature...
- TeMPOraL 12y agoI guess that most programming languages, with possible exception of COBOL, were not created with boring stuff - like enterprise-y apps or webdev, that compose most of the programming today - in mind.