News for hackers. Stuff that matters.

lumberjackstian

Ah right! I misread and assumed the course had happened before . Seems it was a small group in a prelaunch test.

Ask HN: Has anyone joined the growth.design UX course and has opinions?

Ref: https://members.growth.design/product-psychology-mastery/They have a really nice home page on biases and they do monthly case studies on various things (headpsace this month, a couple of months ago was tik tok) and they sounds pretty cool.Wondering if anyone here has used the actual course though and if there're any opinions on it?

( Read More... | 2 comments | 3 points | on HN )

Ask HN: Foursquare Pilgrim/Places vs Google Places APIs. Which to Use Today?

Hey! I'm currently in a travel-related startup (yeah I know, great timing :p ... anyway) and have gone with google places for place data.I tried the Foursquare places API initially but felt the results were crap in Oslo/Norway at least. But the restrictions on what to store are quite annoying, and I'm wondering if I should give Foursquare's Pilgrim APIs a good go again, or if my initial...

( Read More... | no comments | on HN )
Re:Hoare’s Rebuttal and Bubble Sort’s Comeback on Sunday May 31, 2020 @07:35AM (#23368881)
I'm not sure about much analysis and theory that explicitly captures branch prediction, but in last year's cppcon keynote Andrei offered a possible metric [0] where he takes into account the average "distance" between two subsequent array accesses.

It's basically, (C(n) + M(n) + kD(n)) / n

Where M is moves, C is comparisons, k is a some constant, and D is "distance".

[0]: https://youtu.be/FJJTYQYB1JQ?t=2943

Re:Better C – A subset of D Programming Language on Wednesday April 29, 2020 @09:48AM (#23019109)
Why is lazy a failure and what makes it so?

And are there any languages where lazy is not a failure in your opinion?

Edit: removed link to wrong swift feature proposal.

Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @04:22PM (#23011452)
Aye correct! I should've been more clear about that, sorry.

Template arguments need to be known at compile time, and the extra set of parens is how templates parameters are declared in D.

Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @04:20PM (#23011425)
Yeah I realise I could've explained a bit more about template arguments indeed! The point was that it can be hard to specify the return type.
Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @01:38PM (#23009569)
When it comes to templates it's not until instantiation time - when the compiler see the code being used. So this is just an issue during compilation.

The docs on static if may shed some more light: https://dlang.org/spec/version.html#staticif

Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @01:06PM (#23009089)
Depends on the value of the template parameter. If it's 0 the return type is an int, if it's not 0 the return type is a string.

There's a wanting implementation of a sumtype in the standard library (https://dlang.org/phobos/std_variant.html#.Algebraic), and a much better one as a package: https://code.dlang.org/packages/sumtype

Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @12:07PM (#23008391)
I've felt this as well, been using D for a couple years now, and this is the kind of thing that just makes me have to context switch more than I'd like. With the current implementation of the language it's hard to avoid, and function's return type can be quite complex, so writing it down can be hard.

Another reason is the (ironically) dynamic nature of a return type. E.g.

auto whatDoesItReturn(int i)() { static if (i == 0) { return int.init; } else { return string.init; } }

Template code can do that quite easily and then you don't have a choice but to write auto as the return value.

What would be fantastic if the documentation could be given access to the the compiler's return type inference, so that it could document the auto returns with a little more info.

Another way useful approach would be to implement protocols like in swift, or traits like in scala/rust/others, signatures in ml, etc. Then you would be able to define the interface of what a function returns.

Re:Better C – A subset of D Programming Language on Tuesday April 28, 2020 @07:28AM (#23005926)
Relevant post in a discussion thread that's related to the future of lazy in D: https://forum.dlang.org/post/[email protected]...

Ask HN: In hindsight, what would you do differently for a startup tech stack?

I'm mostly curious about the context of a startup (because I'm doing that now). And I'm wondering what kind of things people wish they did in hindsight given their situation.I for e.g. already wish I had spent a "bit" less time on ideating and a bit more time on getting in to flutter (as now I've gone in to an iOS mode and I know that's not scalable at the start since we won't have man power to...

( Read More... | 3 comments | on HN )
clicky link to online version: https://exploras.typeform.com/to/ohA5cU

Ask HN: What is difficult about submitting reviews today?

Hey HN!I'm doing some research in to current review systems (i.e. restaurants, bars, activities, etc), and I was hoping that some of you might take a few minutes of your precious time to answer a short questionnaire below regarding pain points when it comes to reviewing things online?1. Where do you submit reviews today? 2. What is difficult today about submitting reviews? 3. When in the past...

( Read More... | 1 comment | 2 points | on HN )
Re:Using D to Create the World’s Fastest File System on Wednesday December 05, 2018 @06:28PM (#18613825)
It seems this article is not accurate anymore? (the reference is from March). It's not far off though:

https://www.theregister.co.uk/2018/11/30/wekaio/

https://www.hpcwire.com/off-the-wire/wekaio-places-in-top-fi...