DEV Community

Discussion on: Six Things You Thought Senior Devs Did (But We Don't)

 
jmccabe profile image
John McCabe • Edited

I'm happy to bow to your superior knowledge of recent Java changes.

As for ranges etc, please check out the use of the range keyword and 'Range attribute in Ada. An array slice in Ada is a subsection of the array defined by a range.

Your suggestion of there being a 'standard' definition of a range in programming appears to be using references to languages that didn't exist when Ada had been using array slices and the range keyword and attribute for a number of years. Also, the suggestion of a 'standard' for loop makes no sense. The specific example you give is common to C, C++ and Java, at least, where array indices have not been abstracted away from machine representations. Even if you go back before Ada became an international standard, in 1983, it had introduced superior array handling that didn't rely on users managing (often badly) the mapping of array indices from the problem domain to the machine domain.

Thread Thread
 
codemouse92 profile image
Jason C. McDonald • Edited

Most of us in the Python world see the transition from GvR's BDFL tenure, as good as he was, to the formal Steering Committee as a good thing. It's certainly brought a lot of improvements to the language, its internal development processes, and the community as a whole.

(Mind you, GvR is still very much involved, just with a layer of removedness that frees him up to pursue new ideas in Python w/ Microsoft funding.)

Python 3 was weird by nature of improving on some mighty weird things in Python 2, that lead to some things needing to be broken. That's why Python 2 wasn't deprecated until Python 3 was on full feature parity.

Thread Thread
 
val_baca profile image
Valentin Baca

That's good to hear. Thanks for your perspective!

Thread Thread
 
jmccabe profile image
John McCabe • Edited

Sorry for the late reply (and possibly in a weird place; I'm not sure Dev's threading implementation is as optimal as it could be) but I've only just found out that Ruby, see ruby-doc.org/core-2.5.1/Range.html, treats a 'range' as Ada does; inclusively, if you use the simple s..e format. An extra dot is required if you want to use the exclusive (i.e. not including the end index) version, s...e. In addition, if you use ::new to create a range, you need to explicitly specify the 3rd, 'exclude_end', parameter if you want the non-default, exclusive, behaviour.