Hands-on Rust: Presentation order in map_builder section

Title: Hands-On Rust (??? ePub)

Just finished the map_builder section. Just a suggestion here (others may disagree). This felt like the order was more from the perspective of someone who “just knew” from the start what all functionality he would need (perhaps, from having implemented it already?? :slight_smile: ).

It means that you’re putting a lot of pieces out there as a reader without really understanding why. As a developer, I think it’s probably more common that you build out the high level structure, determining what functionality you’ll need as you go. And then drill down fleshing out the functionality.

Suggested order:

  • build
  • build_random_rooms
  • build_corridors
  • apply_horizontal_tunnel && apply_vertical_tunnel

This way, as you build out functionality, you understand it’s context and aren’t waiting until the end for things to all come together. (It’s not quite so problematic to defer hooking things into main until the end.)

1 Like