principles of writing js