TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How does my Python code look?

1 pointsby marclavealmost 11 years ago

2 comments

dozziealmost 11 years ago
1. badly indented monthDict content (and not only because the four spaces in place of a tab; ending brace should occur in a separate line, if you format like this)<p>2. trailing whitespaces in many lines (including, but not limited to, empty lines with whitespaces)<p>3. too long lines<p>4. bad command line arguments processing (should be optparse or argparse)<p>5. bad operation separation (addEvent() being the first example -- too complex, too many things being done on the same level)<p>6. string formatting done badly (you should use printf-like formatting instead of string concatenation)<p>7. code duplication (getEventsToday() vs. getEventsTomorrow())
评论 #7993389 未加载
nocturnalgeekalmost 11 years ago
It&#x27;s not about how it looks, it&#x27;s about what and how fast it does!
评论 #7993393 未加载