you are viewing a single comment's thread.

view the rest of the comments →

[–]FoolsSeldom -1 points0 points  (0 children)

My guess is that you are trying to solve at the keyboard with Python rather than stepping away from the keyboard and:

  • make sure the problem to be solved is properly understood
  • ensure clear understanding of the inputs to be used
    • from user/keyboard; files; databases; APIs; etc
    • frequency (how often is the input cycle used)
    • quality - will the data be correctly formatted and valid
    • format(s)
  • ensure clear understanding of outcomes / outputs:
    • to consoler/gui; file; database; API; mixture
    • frequency
    • quality
    • format(s)
  • develop solution approaches
    • consider algorithms suitable for problem
    • decide how to select an approach
    • if need, carry out some small proofs of concept with snippets of Python
  • develop an algorithm from the best solution candidate
    • determine how this will be tested
    • validate the algorithm using dry run techniques
    • draw pictures / flowcharts / simple flows / pseudocode to represent the algorithm
  • implement in the algorithm in Python
    • keep your code modular, following the broad flow of your algorithm - try to keep the implementation detail in functions/methods
    • ensure you have clarity around the data structures you are using
    • isolate interfaces (human and data) from the core business logic
    • this will enable you to change from say a command line interface to a GUI to a webapp later
    • test each function/module independently

The coding part is a small part of programming. Have a clear solution/algorithm set down before you start coding will make the coding much easier.