To write good code, you sometimes have to write bad code

And I’m not referring to learning.
For example, yesterday I was trying to write code for something and it ended up beng harder than I expected. It’s one of those rare cases where you can fully imagine how the solution should work, enough to tell it to …


This content originally appeared on Lea Verou’s blog and was authored by Lea Verou

And I’m not referring to learning.

For example, yesterday I was trying to write code for something and it ended up beng harder than I expected. It’s one of those rare cases where you can fully imagine how the solution should work, enough to tell it to another person, but you can’t put your thoughts to code and you feel you’re not smart enough.

I find that in those cases, it helps a lot to open a new editor window and try to write code that just works. Without being elegant, fast or maintainable. Just something that works properly. And after you manage to put your thoughts into (bad) code, it’s easy to refine it from there and end up with good code.

Just don’t stop at the bad code, like many beginners do. It’s like when designers sketch a rough draft for a logo, before drawing the digital version. Could you imagine how horrible it would be if they wanted to stop there and give the rough sketches to the client instead? :)


This content originally appeared on Lea Verou’s blog and was authored by Lea Verou


Print Share Comment Cite Upload Translate Updates
APA

Lea Verou | Sciencx (2011-08-20T00:00:00+00:00) To write good code, you sometimes have to write bad code. Retrieved from https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/

MLA
" » To write good code, you sometimes have to write bad code." Lea Verou | Sciencx - Saturday August 20, 2011, https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/
HARVARD
Lea Verou | Sciencx Saturday August 20, 2011 » To write good code, you sometimes have to write bad code., viewed ,<https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/>
VANCOUVER
Lea Verou | Sciencx - » To write good code, you sometimes have to write bad code. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/
CHICAGO
" » To write good code, you sometimes have to write bad code." Lea Verou | Sciencx - Accessed . https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/
IEEE
" » To write good code, you sometimes have to write bad code." Lea Verou | Sciencx [Online]. Available: https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/. [Accessed: ]
rf:citation
» To write good code, you sometimes have to write bad code | Lea Verou | Sciencx | https://www.scien.cx/2011/08/20/to-write-good-code-you-sometimes-have-to-write-bad-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.