Python Forum
Is it bad practice to return a variable and not use it?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it bad practice to return a variable and not use it?
#6
You answered the question yourself.  Basically, you don't want to write code that will make your program more difficult to reuse or debug.  In other words, code should be clean, and minimize errors, because as you write more complex programs, you will have difficulty debugging the code as your programs get larger.  Further, object oriented programming is based around the idea of making your code easier to debug and reuse.  So with that said, you should practice good programming principles and not return values from functions when they won't be used.
Reply


Messages In This Thread
RE: Is it bad practice to return a variable and not use it? - by terrancepython11 - Apr-03-2017, 11:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  best practice example data science mostafa705 1 825 Oct-13-2023, 04:44 AM
Last Post: KianLynch
  Practice coding through hackathon!! TheOutcast 0 1,511 Jun-11-2020, 12:03 PM
Last Post: TheOutcast
  Coding Practice BarakTu 2 3,333 Apr-14-2018, 05:31 AM
Last Post: buran
  is it considered good practice to ... Skaperen 9 6,300 May-10-2017, 02:42 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020