I started doing this and have never looked back. We also keep the next loaf in the freezer, so we always have bread.
I had a coworker who would sometimes not create a method as being static to the class and would therefore need to create a default instance to call said method. "It's domain-driven design."
There are a few different ways to solve this problem without using unsafe and I'm not sure what would be considered idiomatic. Another option is to ultimately encapsulate all of the nodes in a reference-counted box like Rc or Arc and specify the type of your parent/child/sibling references to the same reference-counted box type. With that, you just share cloned instances around as needed.
The primary drawback here is that for mutable access you end up having to perform a lock every time on an underlying Mutex (or something similar). You also no longer have direct access to the singular instance of the node.
There are pros and cons to every approach.
One way of solving this is to structure all of your nodes into a HashMap with the node ID as the key and the node type as the value. The underlying node type could have node IDs for referencing purposes. You lose the ability to reference the parent/child/sibling directly, but you avoid direct circular dependencies. That said, now you need to manage dangling references for when the node is removed from the main HashMap collection.
3000...
What did he whisper in her ear?
Do you happen to know of any good algorithms or numbers? Pi gets harder to calculate with each digit, so it's not a great candidate.
Oh, so this card isn't part of the usual Magic the Gathering? This is part of a different variation of that?
What is the command zone?
Yesterday doing a search using vim for a class that shared a lot of characters at the front with many other classes: /Bas.*Some I could have done a more precise search with better regex, but this was quick, easy, and worked.
I need to move away from using inheritance in my Python. I've been using Rust exclusively for the past year and it's definitely going to affect how I write code in other languages.
livingcoder
0 post score0 comment score
This is what I need, an explicit reason that makes one choice better than another. If hyphens make for a smoother experience, then I'll reconsider my default behavior.
Thanks for pointing out this benefit.