4 ms·
Language Design: Stop Using Angle Brackets For Generics
- jasode 4y agoFyi... if you're getting a bounceback... It seems the author doesn't want this on Hacker News. The webpage html source: <!DOCTYPE html> <html lang="en"> ... <script async src="/assets/js/turnBack.js"></script> ... which has this code to bounce you back: const undesirables = [ "news.ycombinator.com/", // "lobste.rs/" // does not work due to rel="noreferrer" ] ; if (undesirables.find(site => document.referrer.includes(site))) { window.location.replace(document.referrer); } (The https://jwz.org https://jwz.org domain by Jamie Zawinski is another example of a redirect when referred by Hacker News.) EDIT to downvoters... I don't mind the downvotes but could you explain? If my information is inaccurate and doesn't contribute to the discussion, I'd like to learn what is wrong. Thank you.
- Ygg2 4y agoAs if HN people don't know how to copy a link... Or stop browser mid load... Also heavy disagree. [] for array access is better than array.get(0). I have list access like this in Java and it sucks.
- agumonkey 4y agoI was super confused by that, here's the network sequence https://imgur.com/E77sJj9.png https://imgur.com/E77sJj9.png
- Existenceblinks 4y agoTo simply stop it, just hit the browser's stop (refresh) button while it's firing network request. That will cancel it.
- stareatgoats 4y agoThe question is why: it won't stop the HN audience, all it does is add some piqued interest - which AFAICT goes unanswered.
- politelemon 4y agoTo be fair to them, we resemble that remark.
- deleted 4y ago[deleted]
- jimbob45 4y agoI specially don’t use Nim for this reason. I don’t want to dedicate any mental overhead to differentiating between array access and generics. I know it makes the compiler engineers unhappy but I like my <T> syntax just fine and it seems to work well enough for C#.
- Gibbon1 4y agoMy thought is start using emojis for stuff like this.
- smitty1e 4y agoI was thinking, with the advent of Unicode and LSP, why not just design a language from the font up having the syntax one craves?
- Gibbon1 4y agoI think I saw someone talking about parsing and they said parsing emoji's and most non latin characters was 'easy' One would assume a parser that recognized foobaz = 5 in place of foo->bas = 5 wouldn't be a problem. Likely be far easier.
- planetis 4y ago> differentiating between array access and generics It rarely comes up for a collection of proc pointers, when calling that element directly. But it compiles fine. I code in Nim regularly and it's the least of my concerns.
- Existenceblinks 4y agoAgreed. I used C++ template a lot, it's fine. But Typescript is worse to the point it's not tolerable.
- Rochus 4y ago> Unfortunately, using < and > for generics caused parsing problems in every language that tried use them for this purpose Not true. E.g. https://oberon-lang.github.io/ https://oberon-lang.github.io/ used them (before switching to generic modules) and the grammar was even LL(1). I do not find the other arguments convincing either.
- rurban 4y ago(2020) needs to be in the title
- albertopv 4y agoMaybe it's just me and the job I do (not really low level stuff), I use [] array access much more frequently than bitwise shift operations, so for me it's quite the opposite. Having worked with dozens of other developers doing similar things I guess it's the same for them. I know there are those who do bitwise shift everyday (my firmware devs coworker do a lot), but at least in my experience we are talking about 1 to 10 ratio.
- flohofwoe 4y agoHow weird: Clicking on the link immediately takes me back to HN unless I open the page in incognito mode (on macOS Chrome with uBlock Origin).
- valbaca 4y agoJS Bounceback is configured specifically for HN and lobster
- prirun 4y agoOne of the things I really like about Python is that it doesn't (or didn't) use a lot of punctuation marks, preferring keywords instead. Makes it a lot easier to digest at a glance IMO, especially as I've gotten older and my eyesight is not so great. In C, it's easy to recognize curly braces because of their positioning, but when something could be a curly or parenthesis, they can be hard to distinguish. And languages that combine multiple punctuation marks start to look like write-only APL - my opinion. Last, overusing punctuation marks makes it impossible for search engines to look for language-related things because most engines strip punctuation marks.