Hacker News new | ask | show | jobs
by leifg 1829 days ago
It seems like the colon is too ambiguous (is used as a protocol delimiter, delimiter for user/pass, delimiter for port).

Reminds a little bit of Java labels where you can do this:

  public class Labels {
    public static void main(String args[]){
        https://hn.ycombinator.com
        for(int i=0; i<10; i++){
            System.out.println("......."+i );
        }  
    }  
  }
the https: is a label named https and everything after the colon is a comment so this is valid code.
2 comments

> It seems like the colon is too ambiguous (is used as a protocol delimiter, delimiter for user/pass, delimiter for port).

and because that was still too boring they came up with ipv6

IIUC the IPv6 weirdness here is simply due to very unfortunate timing: IPv6 was being finalized at a time (first half of the 90s) when the Web (and with it URLs) was already nearly frozen but still not obviously important.
The colons also make IPv6 addresses unambiguous to IPv4 notation.
Not in URLs, but related:

    Larry's 1st Law of Language Redesign: Everyone wants the colon
    Larry's 2nd Law of Language Redesign: Larry gets the colon
https://thelackthereof.org/Perl6_Colons