DEV Community

Discussion on: How to Produce Readable Code

Collapse
 
vlasales profile image
Vlastimil Pospichal • Edited

actions on objects: user.get(), user.add(), post.modify(), post.delete()

user = new User(id)
print database.get(user)

posts = new Posts()
print database.get(posts)

post = new Post(data)
database.update(post)
Collapse
 
jaffparker profile image
Jaff Parker

Yeah, that works too! I prefer a more functional approach though, that's pretty much what I described :) this is more OOP.

But as long as you and any person who hasn't seen your code can read it, anything works!