Hi All

I was hoping for some advice based on the pool of experience here at Daniweb. I've been teaching myself to program in Python and I'm starting to get the hang of it, now I'm able to write small programs to automate administrative tasks as well as some complex data queries.

I did start programming in Python with the intention of starting on a larger project so I started off learning to use SVN, then moved onto Python (after thinking about which language would be most suitable).

After doing a bit of programming and taking simple tasks and figuring them out in my head I've realised that (as I am sure most of you reading this already have) it's a good idea to have a plan before you start writing that first line of code.

With this in mind, I wondered if anyone has any recommendations on books that I could read to design my software before actually writing it? I've heard terms like UML and Design Patterns but I'm not sure if they are suitable for a language like Python. Should I be reading the "GOF" book?

I'm not asking for answers, just to be pointed in the right direction so any recommendations would be most appreciated!

TIA, Simplified.

Dani AI

Generated

For , a small set of targeted references and a lightweight workflow will pay far more dividends than trying to master every design technique up front. The Python language has its own idioms and tradeoffs, so combine language-specific reading with a couple of general software-design books and a practical, iterative process.

Good starting books:

  • Fluent Python (Luciano Ramalho) — modern, idiomatic Python and how common design ideas map to the language: Fluent Python.
  • Python Cookbook (Beazley & Jones) — compact recipes for real problems you’ll meet as you build.
  • Design Patterns (Gamma et al., the “GOF” book) — excellent for the pattern vocabulary, but read it as concepts rather than code templates; Python’s dynamic features often let you express the same intent more simply. See the book summary at Design Patterns (book).

Practical workflow (small, repeatable steps):

  • Start from concrete behaviours (use cases or tasks), sketch interactions so others can understand them, and keep diagrams simple — box-and-arrow sketches are usually enough (UML is optional): Unified Modeling Language.
  • Implement the smallest working slice, add tests, then iterate. Favor readable, testable modules over clever one-offs. Use version control and small commits so design decisions can be evolved safely.

Further reading and references for Python-flavored patterns and tradeoffs:

As suggested, break big tasks down and iterate. As pointed out, learn the language’s idioms and let them guide how you apply classical patterns. Avoid over-engineering: pick patterns to solve concrete problems, not to showcase them.

Recommended Answers

All 5 Replies

Well get a pencil and a notebook. Always write down what you want your application to do and arreange them how they should work step by step.

Is a good idea to understand what you want to do. Dont rush with big tasks. Design by divide and conquer. Meaning make huge task very simplified. Comment your code for future. Leave space for improvements and updates.

Look through over and over. Once you get the idea....
Draw a flowchat or something. Put your ideas in a very human understandable way. No rushing,
Then start coding.

Thats my take ;)

Thanks for the advice!

you are welcome ;)

Make sure you understand
import this The philosophy of Python reminder for your contemplation

Duck typing Invest time for testing and designing use cases instead of catching mistakes of users before hand, instead:
“it's easier to ask forgiveness than permission” try..except..else is your thing not hasattr (except from basestring type check)
Burn CPU time, not Programmer time or First make it work, then optimize only that which you really need to optimize. Then optimize half of that, keeping the unittests running and checking for regressions. Notice that with bad luck you optimize one thing, then other.... then you notice you unoptimized the first thing same time.
etc...

Thanks Tonyjv! :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.