Writing drawing code like this by hand is really tedious and even though a lot of vector drawing apps output SVG code, it is usually quite complicated and ugly.
We make a vector drawing app called WebCode that instantly generates nice and readable SVG and JavaScript+Canvas code.