5 ms·
> PPS: I think the choice of ^ to handle pointers is one of the worst decision in the syntax. Funny that's my favourite aspect of Odin's syntax. p: ^int
by eterps 2y ago
> PPS: I think the choice of ^ to handle pointers is one of the worst decision in the syntax.
Funny that's my favourite aspect of Odin's syntax.
p: ^int
Easy on the eyes.
I also like the convention of the type on the left and its usage on the right:
p: ^int // ^ on the left
x := p^ // ^ on the right
Very similar to languages of the Pascal family, but less verbose.
And with structs:
p^.x // not necessary
p.x // this will do
- indulona 2y agothe main problem is keyboard layout and lack of easy access to ^ in most of them. not everyone uses US layout, it's actually minority of computer users. plus, the notion of whether the ^ goes before or after variable can cause a lot of programming and code reviewing issues. but it's just a personal opinion, obviously.
- fallingsquirrel 2y agoWhat layout specifically is a problem? Odin uses curly braces which (in QWERTY) are shifted and typed with your pinky—the worst possible combination. Are there layouts where ^ is worse than that?
- indulona 2y agothis could result in endless thread so all i will say is that you have * physically available as stand-alone key on the numerical side of every keyboard ever made(unless you are a weirdo(=micro minority) and use the variously mutilated physical keyboard layouts) and & is physically available as stand-alone key on iso 105 layout, for example, but most importantly it is a character widely used in most languages as actual character, whereas ^ is really not.
- fallingsquirrel 2y agoMoving your whole hand off home row to hit numpad * is even worse than shift-pinky.
- indulona 2y agotry using your right hand ʕ·͡ᴥ·ʔ
- fallingsquirrel 2y agoIf you think it's ergonomic to move your entire hand away from the letters to press a frequently used key, well... I guess now I understand why Odin's creator disagrees with you about keyboard layouts! ^_^
- flohofwoe 2y agoOTH accessing { and } on non US layouts is pretty much the worst case but people deal with it just fine.