36 ms·
God damn there's some good ideas here. pony: class Foo[A: Any val] c#: public class MyGenericArray<T> rust: fn foo<T>(T) { ... } golang: none, because existing
by jksmith 9y ago
God damn there's some good ideas here.
pony: class Foo[A: Any val]
c#: public class MyGenericArray<T>
rust: fn foo<T>(T) { ... }
golang: none, because existing examples (outside of pony) too complicated
Which most obviously suggests a generic func? Geez, took us this long to just reach some clarity? Nice job, Pony.
More:
1 + 2 * 3 // wont compile
1 + (2 * 3) // will compile
yes! I have devs with college degrees who don't understand operator precedence.
Liking what I see so far. Nice mix of low cognitive load/high expressiveness/safety. Keep at it.
- tomsmeding 9y ago> yes! I have devs with college degrees who don't understand operator precedence. Bitwise operators in C-like languages have precedences that make no sense at all; I can't remember those either. (Even though they sort-of make sense if you consider their historical heritage... no excuses though.) But do you really see software developers with a university degree that mess up the precedence of times and plus? I shudder when thinking about them working with my code. I would really appreciate to be able to write e.g. a + b == 0 || c * d - e > f / g without a misunderstanding of precedence. Why is that not a basic feature in the first programming course one gets? It certainly was in mine, two years ago. EDIT: is there any way to sanely embed an asterisk in normal text here?
- saghm 9y agoI think the Rust example isn't quite fair, as the Pony and Java examples you give are for types, not functions. The Rust equivalent would be `struct Foo<T>`, which I think is as clear as the Pony example.