Hacker Newsnew | past | comments | ask | show | jobs | submit | onefiveone's commentslogin


> They’re typically, fairly young, fresh out of school

these same lowly colleagues were also incapable of wiping their asses at one point in their life but over the years and skidmarks, they all mastered that beautiful language and now make heated bidet money.


> Pike's "incapable" statement was baseless and insulting.

"incapable" != "never capable", especially when talking about fresh college graduates.


"Unwilling", "have no time", "can't be bothered" are all better than "incapable".


open up devtools, scroll to the bottom of the page and...

1229 requests

2.8 MB transferred


Thanks for letting me know, looks like NextJS is prefetching all the icon pages, will turn it off!


Fixed it, there shouldn't be that much requests now!


https://extensions.gnome.org/extension/5143/dashbar

if you just want quick launch, this is ~500 loc and gets updated on time for new gnome releases


except there's no smoke and mirrors for this character saving trick



> But still a work-in-progress is audio support, DP Alt-Mode, enabling the DSPs, USB-C power delivery, and GPU acceleration.

AKA still garbage.


type Something []string

ensure that the underlying type is a slice


Why do you need a tilda for `S ~[]E`, but not for `E comparable`?

Both are type-constraining annotations, so why two syntaxes?


Because when you define a "type Foo []int" you're definig a new type Foo that is not the same type as []int.

So if the type parameter said "[]E" where E is a comparable then "Foo" wouldn't be allowed because Foo is not the same type as "[]int" (for that you'd need a type alias i.e "type Foo = []int". This is by design since it allows you to define new types you don't want to get accidentally used where you don't want them to.

When defining library functions that are truly generic you may want instead to let them be used on the "underlying type". For example, Sort library authors decided that generally you want it to just work on the underlying type and that's why they added ~ in front of the generic type. Otherwise every invocation of Sort you'd need to convert the type e.g. "slices.Sort([]int(myfoo))".

The other type parameter "E comparable" doesn't need the tilde because "comparable" is not an actual type but a type constraint.

A type constraint is an interface that defines the set of permissible type arguments for the respective type parameter and controls the operations supported by values of that type parameter.

You don't need a tilde because any type that implements that constraint will be accepted. Also any type implementing a constraint that embeds that constraint also works


It is like S: where S = []E where E: comperable.

I like the way Rust has it a lot more but it is still imperfect and feels arbitrary in ways.

I find myself unsure where to put the templatization parameters and it doesn't feel perfectly symmetrical.

Unsure if impl MyType<T> where T: X

is comperable to impl MyType<T: X> Sometimes it needs impl<T> MyType<T> where T: X


Agreed, the Rust syntax is no golden standard either - but at least it's regular; this one really weirds me out.


Guessing that E is the element, so is not a slice (or more accurately we don’t care if it is a slice or not!)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: