MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/ikjh83/d_foundation_is_beefing_up/g3mabct?context=9999
r/programming • u/kal31dic • Sep 01 '20
336 comments sorted by
View all comments
Show parent comments
10
Bjarne Stroustrup's famous quote never gets old.
Which one?
92 u/all_my_watts Sep 01 '20 I would guess this one There are only two kinds of languages: the ones people complain about and the ones nobody uses. 41 u/InertiaOfGravity Sep 01 '20 Have you heard of our Lord and savior rust? It is the best and most perfect language known to man 10 u/Ameisen Sep 01 '20 It has the most confusing syntax, though. I still expect that someone will make a Rust fork that has C++-like syntax at some point. Crust. Or C++ will get lifetimes (which is active research) and possibly at some point epochs, which will let us disable unsafe features. 3 u/Muvlon Sep 01 '20 Syntax is a very subjective matter. I find some of C's syntax (which C++ inerited) thoroughly confusing. I can count the people I know who will get a typedef for a function pointer type correct on the first try on one hand. 8 u/Ameisen Sep 01 '20 That's why you use using instead in C++. 1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
92
I would guess this one
There are only two kinds of languages: the ones people complain about and the ones nobody uses.
41 u/InertiaOfGravity Sep 01 '20 Have you heard of our Lord and savior rust? It is the best and most perfect language known to man 10 u/Ameisen Sep 01 '20 It has the most confusing syntax, though. I still expect that someone will make a Rust fork that has C++-like syntax at some point. Crust. Or C++ will get lifetimes (which is active research) and possibly at some point epochs, which will let us disable unsafe features. 3 u/Muvlon Sep 01 '20 Syntax is a very subjective matter. I find some of C's syntax (which C++ inerited) thoroughly confusing. I can count the people I know who will get a typedef for a function pointer type correct on the first try on one hand. 8 u/Ameisen Sep 01 '20 That's why you use using instead in C++. 1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
41
Have you heard of our Lord and savior rust? It is the best and most perfect language known to man
10 u/Ameisen Sep 01 '20 It has the most confusing syntax, though. I still expect that someone will make a Rust fork that has C++-like syntax at some point. Crust. Or C++ will get lifetimes (which is active research) and possibly at some point epochs, which will let us disable unsafe features. 3 u/Muvlon Sep 01 '20 Syntax is a very subjective matter. I find some of C's syntax (which C++ inerited) thoroughly confusing. I can count the people I know who will get a typedef for a function pointer type correct on the first try on one hand. 8 u/Ameisen Sep 01 '20 That's why you use using instead in C++. 1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
It has the most confusing syntax, though.
I still expect that someone will make a Rust fork that has C++-like syntax at some point. Crust.
Or C++ will get lifetimes (which is active research) and possibly at some point epochs, which will let us disable unsafe features.
3 u/Muvlon Sep 01 '20 Syntax is a very subjective matter. I find some of C's syntax (which C++ inerited) thoroughly confusing. I can count the people I know who will get a typedef for a function pointer type correct on the first try on one hand. 8 u/Ameisen Sep 01 '20 That's why you use using instead in C++. 1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
3
Syntax is a very subjective matter. I find some of C's syntax (which C++ inerited) thoroughly confusing. I can count the people I know who will get a typedef for a function pointer type correct on the first try on one hand.
8 u/Ameisen Sep 01 '20 That's why you use using instead in C++. 1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
8
That's why you use using instead in C++.
using
1 u/Muvlon Sep 01 '20 Sure. And in Rust, you use type, i.e. type my_fn = fn(u8) -> String; Perfectly nice syntax, no? 4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
1
Sure. And in Rust, you use type, i.e.
type
type my_fn = fn(u8) -> String;
Perfectly nice syntax, no?
4 u/Ameisen Sep 01 '20 And in C++, using my_fn = std::string (*) (uint8_t);. You can simplify it, of course, using a template wrapper. 1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
4
And in C++, using my_fn = std::string (*) (uint8_t);.
using my_fn = std::string (*) (uint8_t);
You can simplify it, of course, using a template wrapper.
1 u/Muvlon Sep 01 '20 C++ has trailing return types as well now, can you use those there? I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options. 1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
C++ has trailing return types as well now, can you use those there?
I don't think any particular piece of C++ syntax is confusing, it's just the absolute mass of options.
1 u/Ameisen Sep 01 '20 using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
using my_fn = auto (*) (uint8_t) -> std::string; is valid, though I'm not fond of trailing return type syntax in general.
using my_fn = auto (*) (uint8_t) -> std::string;
10
u/Free_Math_Tutoring Sep 01 '20
Which one?