Just a thought came to my mind, like to hear feedbacks/comments about it.
Is there any pro/con (simplifications or more difficulties) could be generated of building a rust app in a way close to prototype programming, something like:
// Defining structs to be used
#[derive(Debug, Clone, Default)]
struct NAME<'a> {first: &'a str, last: &'a str}
Impl<`a> NAME<`a> {
.
.
}
// Define types aliases
type Name<'a> = NAME<'a>;
// Define `App` struct to hold all the variables and structs of the program
#[derive(Debug, Clone, Default)]
struct App<'a>{
age: u32,
name: Name<'a>
}
// Implementation of the `App` including all functions to be used
impl<'a> App<'a> {
fn build(&mut self) {
self.age = 5;
self.name.first = "Karam";
self.name.last = "Yousef";
println!("{:?}", self);
}
.
.
}
// Define. build and run the `App` from the `main`
fn main(){
let mut app = App::default();
app.build();
}