My Expierence with Python and API so far | API Development | T…

My Expierence with Python and API so far

    • DieselBlade [1701621]
    • Role: Wiki Contributor
    • Level: 56
    • Posts: 1,499
    • Karma: 1,314
    • Last Action: 3 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 08:53:00 - 20/08/24 (3 months ago)
    |
    Last replied 13:40:43 - 06/09/24 (3 months ago)

    I think this meme sums it up quite well:

     

    9fdd1f7a-a6a6-424f-94f3-01e745285a6d-1701621.jpg

    8db021b7-6a5d-4507-ab53-6ac6b2fa27de-1701621.gif

    • tiksan [2383326]
    • Role: Civilian
    • Level: 100
    • Posts: 947
    • Karma: 1,257
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:19:28 - 20/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Can’t have scope creep if you never define the scope xD

    LnNwLrL.gif

    • Glasnost [1844049]
    • Role: Committee
    • Level: 68
    • Posts: 428
    • Karma: 2,175
    • Last Action: Now
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 10:44:54 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Just going to leave this here and go cry myself to sleep with my spaghetti nightmares (FYI, I am not a developer, I'm sysadmin/infosec xD)

     

    2024-08-31-NLrLDk4nGqyy.png

     

    2024-08-31-yyvzS8NMaXnd.png

    Co-owner and Developer of TornPal

    TornPal API - Extract market & bazaar data with your own tools/sheets

    • Accountant [3171310]
    • Role: Civilian
    • Level: 49
    • Posts: 826
    • Karma: 945
    • Last Action: 22 days
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 11:07:32 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    DieselBlade [1701621]

    I think this meme sums it up quite well:

     

    9fdd1f7a-a6a6-424f-94f3-01e745285a6d-1701621.jpg

    That's where I more or less said to myself: "f**k it, I'm moving to finance"

    • tiksan [2383326]
    • Role: Civilian
    • Level: 100
    • Posts: 947
    • Karma: 1,257
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:03:53 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Glasnost [1844049]

    Just going to leave this here and go cry myself to sleep with my spaghetti nightmares (FYI, I am not a developer, I'm sysadmin/infosec xD)

     

    2024-08-31-NLrLDk4nGqyy.png

     

    2024-08-31-yyvzS8NMaXnd.png

    It doesn’t look too testable but it doesn’t look that bad.

    LnNwLrL.gif

    • Glasnost [1844049]
    • Role: Committee
    • Level: 68
    • Posts: 428
    • Karma: 2,175
    • Last Action: Now
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 14:10:14 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Glasnost [1844049]

    Just going to leave this here and go cry myself to sleep with my spaghetti nightmares (FYI, I am not a developer, I'm sysadmin/infosec xD)

     

    2024-08-31-NLrLDk4nGqyy.png

     

    2024-08-31-yyvzS8NMaXnd.png

    tiksan [2383326]

    It doesn’t look too testable but it doesn’t look that bad.

    Probably the best feedback my coding has had in years, I'll take it :)

     

    I do have some unit tests setup elsewhere, but coverage isn't great whilst I am still shuffling things around and building up the workflows.

    Co-owner and Developer of TornPal

    TornPal API - Extract market & bazaar data with your own tools/sheets

    • tiksan [2383326]
    • Role: Civilian
    • Level: 100
    • Posts: 947
    • Karma: 1,257
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 15:27:40 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Glasnost [1844049]

    Just going to leave this here and go cry myself to sleep with my spaghetti nightmares (FYI, I am not a developer, I'm sysadmin/infosec xD)

     

    2024-08-31-NLrLDk4nGqyy.png

     

    2024-08-31-yyvzS8NMaXnd.png

    tiksan [2383326]

    It doesn’t look too testable but it doesn’t look that bad.

    Glasnost [1844049]

    Probably the best feedback my coding has had in years, I'll take it :)

     

    I do have some unit tests setup elsewhere, but coverage isn't great whilst I am still shuffling things around and building up the workflows.

    I'm not one to judge. Most of my Torn projects have no or almost no tests.

    LnNwLrL.gif

    • FlamingCacti [2605077]
    • Role: Civilian
    • Level: 50
    • Posts: 193
    • Karma: 185
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:37:58 - 02/09/24 (3 months ago)
    Post link copied to clipboard Copy post link

    My advice is to make heavy use of functions. Each of my functions does ONE thing, but with variable parameters. It is modular in that way. Then, I can puzzle piece functions together at the end of the script to execute. This way, I can stay organized and easily read the logic.

     

    Internet search for "Unix philosophy", it helps. When scripting, I substitute "program" for "function". I've copied/pasted it below, and reworded a couple terms.

     

    (i) Make each program function do one thing well. To do a new job, build afresh rather than complicate old program functions by adding new features.

    (ii) Expect the output of every program function to become the input to another, as yet unknown, program function. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.

    (iii) Design and build software scripts, even operating systems, to be tried early, ideally within weeks hours. Don't hesitate to throw away the clumsy parts and rebuild them.

    (iv) Use tools in preference to unskilled help manual work to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.

    • pobk [3171827]
    • Role: Civilian
    • Level: 52
    • Posts: 110
    • Karma: 156
    • Last Action: 3 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:40:43 - 06/09/24 (3 months ago)
    Post link copied to clipboard Copy post link

    >>> import this
    The Zen of Python, by Tim Peters

    Beautiful is better than ugly.
    Explicit is better than implicit.
    Simple is better than complex.
    Complex is better than complicated.
    Flat is better than nested.
    Sparse is better than dense.
    Readability counts.
    Special cases aren't special enough to break the rules.
    Although practicality beats purity.
    Errors should never pass silently.
    Unless explicitly silenced.
    In the face of ambiguity, refuse the temptation to guess.
    There should be one-- and preferably only one --obvious way to do it.
    Although that way may not be obvious at first unless you're Dutch.
    Now is better than never.
    Although never is often better than *right* now.
    If the implementation is hard to explain, it's a bad idea.
    If the implementation is easy to explain, it may be a good idea.
    Namespaces are one honking great idea -- let's do more of those!

    Last edited by pobk on 13:41:32 - 06/09/24 (3 months ago)

    ~ P

    Support my suggestions: Faction API Keys

Reply
Thread Title: