4 ms·
Function names and parameter order matter. That is the difference between having to look something up in the documentation and not. Back in those days most text
by mantap 7y ago
Function names and parameter order matter. That is the difference between having to look something up in the documentation and not. Back in those days most text editors didn't have fancy autocompletion with parameter documentation, if you weren't sure about the order you might have to look it up in the documentation. Having a self-consistent API that was easy to remember was essential. Especially in a language with dynamic types!
When I switched from PHP to Python it was an amazing, liberating feeling for me that I will never forget.
- stef25 7y agoIt takes 10 sec to google "str_replace" and have the params presented to you. Using a manual is an integral part of development. I don't think there's many people who can memorize all the methods and their params, including optional ones, nor should they.
- cultus 7y agoThat sounds like it takes a lot more time and mental energy than if the API were consistent.
- Piskvorrr 7y agoWe have machines to do that for us. As in, "press Ctrl+Q, IDE shows relevant help." I don't value encyclopedic knowledge of every API out there any more...especially since those I do recall are of rather, um, limited use nowadays. Like with any language, the point isn't to cram a dictionary into your brain, it's to communicate.
- mantap 7y agoIt's a red flag if the basic operations (like string and array functions) are so inconsistent and weird so as to require use of an IDE or constant use of the docs.
- innocenat 7y agoBack in the day everyone has the PHP manual downloaded in CHM format (that was before broadband was common). Searching in CHM was just 1.5 seconds away.
- dep_b 7y agoStrongly typed languages have better autocomplete since ages, so in Java you would simply type "Str" in Netbeans and you would get all of the ways to create a String or StringBuilder including the parameters right at your fingertip without context switch. No memorizing except the vague notion of "sometimes you want to use a StringBuilder instead of String". Just keep typing code.
- slikts 7y agoYou mean statically, not strongly typed. Strong typing roughly means avoiding implicit type coercion.
- out_of_protocol 7y ago10 sec every single damn time, for like 4 years, until i switched to other language (ruby). And like google once or twice to remember params in %sanelanguage%
- sethammons 7y agoI kept the php docs open all the time. Alt can over, type the function name. But, honestly, you just start to remember all the different little gotchas (at least back in the v3 days).
- ransom1538 7y agoPython???! Python2 vs python3 is probably the worst thing I have ever seen a language do. Now teams are stuck supporting both versions, new devs are always confused, teams can't upgrade, or if they do upgrade much of their python2 code is useless. The language is now filled with hacky crap: urllib, urllib2, urllib3 and ... AND python is slow. "That is the difference between having to look something up" PHP (for 15 years?) has had IDEs that fill it in for you.
- bildung 7y agoI am honestly confused how anyone could code themselve up into that python2 only corner. With the release of python2.6 and python3 in 2006, it was clearly described what one had to do to write upwards-compatible python2 code. 2006. https://www.python.org/dev/peps/pep-3000/ https://www.python.org/dev/peps/pep-3000/ No one had to have any problems with the transition. If they did, they had to willingly ignore the in-your-face documentation on the migration process.
- sinni800 7y agoBut they did, and they will always do at every turn... I am not against making something not backwards-compatible. I am in favor of throwing old, bad things away even at the risk of having to rework some stuff... But how crazy legacy is at every damn company is just making it so frustrating. They will happily just wait it out for 14 years and then complain about their Python2 being desupported