Hacker News new | ask | show | jobs
by qweqwe14 984 days ago
Rust is not a prototyping language. If you need something done quick&dirty, pick e.g. Python. Personally I don't feel like writing something in Rust would take significantly more time than any other language, provided you know Rust pretty well already.
1 comments

I prototype with Python despite being fairly familiar with rust. Arguably less familiar with Python. I really abuse Python, like a kid cramming plato together and shoving toothpicks and googly eyes on it. If someone asked me to make something well with Python I’d need to take a breather and really think about it.

I can do the same thing with rust, but making changes to that monstrosity would be relatively hard. With Python I can rip something out and replace it without a whole lot of fuss. After doing that for a few days or weeks, I might know what I should actually build.

At this point, building with rust is pretty quick but it’s only because I’ve got a clear target and a somewhat sensible design to follow, if I squint at it. Then I can drop kick the Python part and pretend it never happened.

But I’ve never worked with anyone who works at the same speed in Rust from the start. It doesn’t seem to happen. On the other hand, I’ve watched people struggle with it for days and weeks on end over things that seem trivial.

Yeah, I'd say that if you haven't already planned your application's structure in advance, writing it in Rust would be harder than in e.g. Python. One piece of advice that I can give is to always start with data structures and design stuff around them first. After this it will usually be easier to move forward.
100%, I agree. This was a game changer for me when I was learning to manage state better back when I was learning React. I realized most state management issues emerged as data structures would evolve and get shoehorned into components. Taking a step back and designing the state’s structure appropriately and then the components accordingly tended to yield far better results. Of course the data structure is informed by a rough idea of future components, but it doesn’t need to follow the UI precisely. It’s a good practice
Personally it is better to prototype with es6 above or /typescript. Python is great, but don't like the indentation format. Sometime I just want a line of code to be in certain level indentation if I'm just prototyping. At this day and age just skip node use Deno for prototyping.
I love typescript for prototypes. If I’m picking Python it’s because I’ve got loads of data to pipe around and its multitudes of awesome tools for those tasks are too hard to turn down. Otherwise I find typescript a lot more expressive, and I prefer having type “scaffolding” at the end which I can kind of finesse and finalize in a type system like Go or Rust’s without much effort.