3 ms·
I don't know why "->" should render as an arrow when we could just use an actual Unicode arrow. If need be, have macros for your editors that allow you to conve
by Pet_Ant 1y ago
I don't know why "->" should render as an arrow when we could just use an actual Unicode arrow. If need be, have macros for your editors that allow you to convert the "->" into an actual arrow.
- gmueckl 1y agoNot all code editing sessions are created equal. I dare you to deal with Unicode symbols in a vim session over SSH with a 1 second RTT, for example :).
- _piud 1y agoit is partially a matter of design and code philosophy. many like the simplicity of ASCII and consider ligatures distracting. but more than preference there is matter of availability and consistency. Unicode is not available for all possible glyph combinations and many times what we see in Unicode looks quite ugly in monospace because of the width constraint. ligatures are also not supported everywhere. that is one of the reason i designed this.
- vanderZwan 1y agoBecause there are programming languages where "->" and "=>" have semantic meaning, but the unicode arrows don't.
- sampo 1y ago> have macros for your editors that allow you to convert the "->" into an actual arrow. Or, as suggested here, use language macros: #define → -> https://lists.isocpp.org/std-proposals/2023/01/5485.php https://lists.isocpp.org/std-proposals/2023/01/5485.php
- teo_zero 1y agoThis is not valid C, though. The characters allowed for identifiers are defined in Unicode Standard Annex #31, and those easily understood as operators, like arrows, are not included.
- globular-toast 1y agoUsing Unicode would be awful. I have a button on my keyboard for every character I need. How do I type a unicode arrow? Oh, now I need editor macros? Or I need to get out a special keyboard per language? Unicode is not there for you to necessarily use the whole thing. It's there so that everyone in the world can encode their text the same way, despite having a completely different set of characters on their keyboards.
- eviks 1y ago> how do I type a unicode arrow? Same way you type everything else - by pressing a button combination that corresponds to the symbol in your layout. Or by using an app that does it without changing the layout. Like your editor could insert → when you type fn () -> {} Or you'd simply not type it and continue to use -> > Or I need to get out a special keyboard per language? No, your regular keyboard will work fine for any language. > Unicode is not there for you to necessarily use the whole thing The suggestion was about literally 1 char (maybe implicitly about a dozen more), why did you jump to the millions from "the whole thing"???
- globular-toast 1y agoBut I don't have a button that corresponds to "unicode arrow" and I don't particularly want one. I have only 10 digits and they're all accounted for with ubiquitous, regular keyboards that have been around for decades. Having to use some app that converts two characters inserted in sequence into the correct character is a terrible idea. It makes me think of the Dvorak trend among geeks. I very nearly learnt Dvorak myself, but then a wise elder dissuaded me, reminding me how amazing it is to be able to type fast on any keyboard you come across, even if it might only be 90% of your theoretical maximum on the perfect keyboard. Sometimes local optima are good enough. > The suggestion was about literally 1 char It's never "just one more".
- eviks 1y ago> But I don't have a button that corresponds to "unicode arrow" You mean the label: well, take out your favorite marker and draw one on the side! But also, you don't have labels that correspond to these standard Mac layout symbols https://i.sstatic.net/ht0Tg.png https://i.sstatic.net/ht0Tg.png So? Should it be removed? > ubiquitous, regular keyboards that have been around for decades. All poorly designed, most even acknowledge that by adding an extra set of numbers at the side because the default numeric (and symbolic) row is so bad. Why is the 'why bother improve the awfulness' a great attitude? > but then a wise elder dissuaded me, reminding me how amazing it is to be able to type fast on any keyboard you come across There is nothing wise here, it's a bog standard rejection of any improvement. First of, you could still train yourself to use both. Second, if you're only using your own keyboards 99.9% of the time, there is nothing amazing about not being slowed down in those tiny percent of typing cases. Also, it's of course not literally `any` keyboard you come, that's such a myopic view - plenty of countries have different non-qwerty default layouts, so you wouldn't be able to enjoy your qwerty speed there > only be 90% of your theoretical maximum on the perfect keyboard What if it's 10% that will make you disabled in 20 years? After all, "speed" isn't the only factor here. Any "wise" man could appreciate the broader ergonomic implications... > It's never "just one more". If only you didn't cut off the quote you could've read "implicitly about a dozen more", but the most important part is the last that you failed to address about the millions