You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using Julia to look at strings, I noticed the ordering for arguments is different for looking at collections/elements vs string/substring. For example, contains uses haystack, needle while in uses item, collection. This behavior is inconsistent and unintuitive. While it makes most sense to me personally to always use smaller, larger, I think it's more important to just be consistent.
I realize this is a big and breaking change but if it's going to be done, sooner is better than later. Perhaps there's some reason for doing it that I'm not aware of, but for reference Python's small in large syntax is very intuitive and consistent; you can use item in collection and string in largerstring, exactly what one would expect, even without looking at the language reference (which one currently has to do with Julia).
This is related to #19186, #10593, #5664. It seems like an overhaul to make argument ordering more intuitive and establishing a Julian guideline for doing so would help adoption of the language by making it easier to learn.
The text was updated successfully, but these errors were encountered:
You can use in as an infix operator in Julia, too: item in collection works just as you'd expect. That's not true for contains, but when I use it I always read it in infix order to help me remember which argument goes where:
Hi,
While using Julia to look at strings, I noticed the ordering for arguments is different for looking at collections/elements vs string/substring. For example,
contains
useshaystack, needle
whilein
usesitem, collection
. This behavior is inconsistent and unintuitive. While it makes most sense to me personally to always usesmaller, larger
, I think it's more important to just be consistent.I realize this is a big and breaking change but if it's going to be done, sooner is better than later. Perhaps there's some reason for doing it that I'm not aware of, but for reference Python's
small in large
syntax is very intuitive and consistent; you can useitem in collection
andstring in largerstring
, exactly what one would expect, even without looking at the language reference (which one currently has to do with Julia).This is related to #19186, #10593, #5664. It seems like an overhaul to make argument ordering more intuitive and establishing a Julian guideline for doing so would help adoption of the language by making it easier to learn.
The text was updated successfully, but these errors were encountered: