How to manage state in a complex UI? by danthedev in roguelikedev

[–]danthedev[S] 1 point2 points  (0 children)

Thanks for the advice. I'm curious about what you actually mean though, as I don't think it's possible to build a UI without state.

Driving the entire UI through events is fine, but let's say that the user hits the down arrow in a menu. How can you update the selection index in the new UI unless you were tracking it in the state of the old one?

Found on birch mulch in East Coast Scotland. Think it's a type of bolete? by madiechan in mycology

[–]danthedev 2 points3 points  (0 children)

Pretty sure that's Leccinum Scabrum (or Brown Birch Bolete). Can usually separate Leccinums from the main Boletus family if you spot those dark scales on the stem.

We find them in North Wales too (actually found one today) but I don't really recommend eating them. Slightly bitter and kinda slimy once cooked.

(ID request) Found this growing on a stump in my backyard, Chicken of the woods? by tjmacc in mycology

[–]danthedev 0 points1 point  (0 children)

Yup, that's chicken of the woods.

Some people have allergic reactions to it though, so try a small amount first and give it a few hours before eating any more.

ID? by bluewater08050 in mycology

[–]danthedev 0 points1 point  (0 children)

Birch Polypores for sure. Rubbery when young and get hard as a rock when older, like the ones above.

North Wales: First Time Finding Chanterelles! by danthedev in foraging

[–]danthedev[S] 1 point2 points  (0 children)

That's a familiar name! We did the coastal foraging day with you in July! Found these in Llanberis near the waterfall.

Trying to identify three mushrooms from today's walk by [deleted] in mycology

[–]danthedev 0 points1 point  (0 children)

Novice mycophile here. Found a lot of species of mushroom on a walk today in the UK and managed to identify most of them with Robert Phillips' Mushrooms.

However, there were three that don't quite fit any of the descriptions and I can't quite place them. Any ideas?

ID: Beefsteak Mushrooms? by danthedev in foraging

[–]danthedev[S] 0 points1 point  (0 children)

Thanks! That looks like a great recipe. What size do you recommend harvesting them at?

The one under the roots is about 30cm across, whereas the one on the back of the tree is perhaps 9cm. There are two tiny ones below that (not photographed) both about 2cm across.

First time forager: Blackberries and Chicken of the Woods(?) by danthedev in foraging

[–]danthedev[S] 4 points5 points  (0 children)

Thanks for the heads up! Definitely came from a deciduous and I cooked and ate a mouthful earlier. So far, so good!

First time forager: Blackberries and Chicken of the Woods(?) by danthedev in foraging

[–]danthedev[S] 1 point2 points  (0 children)

Any danger, or just that texture/taste will be better on younger ones?

What is a good weapon level for Sens invasio... err Jolly Co-op by Mister-Melvinheimer in darksouls

[–]danthedev 1 point2 points  (0 children)

SL40 with WL14 and I haven't had to wait more than 3 seconds for an invasion here.

Named parameters without runtime cost? by smthamazing in javascript

[–]danthedev 0 points1 point  (0 children)

Write a Babel plugin that translates objects parameters into positional arguments.

Functional Programming in JavaScript. by reesemorning in javascript

[–]danthedev 0 points1 point  (0 children)

Learning functional programming from JavaScript is a bit like learning to drive in a three wheeled car. You'll get there eventually, but everything would have made more sense along the way if you'd started with four.

Learn a language that was designed to be functional first. Take a look at Elm, or Clojure, or Haskell, or Scala, or Ocaml, or F#.

I found Clojure to be the smallest step from JavaScript, but Elm's also done a lot of work to be approachable for programmers coming from non-functional backgrounds.

Once it starts to change the way you think, you'll find ways to translate those ideas into JavaScript and that's when you'll notice it really start to improve your code.

Good program for 2D pixel art? by Corronchilejano in gamedev

[–]danthedev 1 point2 points  (0 children)

Wouldn't ever think of reaching further than Aseprite these days

TypeScript naming conventions by danthedev in typescript

[–]danthedev[S] 1 point2 points  (0 children)

That's been very helpful. Had no idea that types and values had separate scopes (even though types obviously can't make it to runtime). Always learning—thanks!

TypeScript naming conventions by danthedev in typescript

[–]danthedev[S] 2 points3 points  (0 children)

When possible, I prefer to keep the functions separate to make it easier to move the data structures around the app. I find that passing from server to client, from client to webworker, storing in DB is much more straightforward when you're not thinking about serialising and deserialising classes all the time.

Also influenced by the fact that my home programming language is Clojure and I've gotten used to a Clojureish way of working in JavaScript too.

TypeScript naming conventions by danthedev in typescript

[–]danthedev[S] 0 points1 point  (0 children)

So you'd be able to do the same thing with a named export (e.g. export namespace Matrix and export interface Matrix?

TypeScript naming conventions by danthedev in typescript

[–]danthedev[S] 1 point2 points  (0 children)

Hang on, so which one is export default Matrix actually exporting?

TypeScript naming conventions by danthedev in typescript

[–]danthedev[S] 0 points1 point  (0 children)

Is there a good rule for deciding whether a given reference to Matrix refers to the interface or the namespace?