Python Forum
compiling to python-- should ; be used or not?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
compiling to python-- should ; be used or not?
#2
Quote:the reason i do this is because it fits more code per page, which makes it easier (for me) to read what im doing.
Its easier for me to read without semi-colons.

In fact when i copy and fix someones code on the forum, i go through and remove the semi-colons as they bug me before i post it back on the forum.

It even bugs me that there was a space between print and the pareth
print(5)
print(12)
To me its better to have readability even at the expense of speed...which in that case does not.

But it can in list comps. I would say that its better to "unpack" list comps that are long and complicated to regular for loops for the same reason. Its better to be able to read it. And the speed increase is probably not worth it.

Same thing about regex. Some are simple and too simple that python has builtins for. Its easier to read without using regex in most cases. But yes, sometimes you just have to live with regex though.

for numerous imports i would do
from .states import (
    stats_screen,
    blackjack, 
    craps, 
    bingo, 
    keno, 
    video_poker
)
instead of spreading them off in a one liner.

The zen of python states...
Quote: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.
Recommended Tutorials:
Reply


Messages In This Thread
RE: compiling to python-- should ; be used or not? - by metulburr - Dec-24-2017, 04:05 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  compiling with an undefined variable Skaperen 0 1,050 Nov-10-2022, 11:59 PM
Last Post: Skaperen
  compiling numpy, getting C source Skaperen 10 3,891 Nov-20-2021, 12:41 AM
Last Post: Skaperen
  python compiling and sql? abrogard 2 2,382 Oct-27-2020, 06:37 AM
Last Post: buran
  cross-compiling python with zlib support michelebucca 5 5,978 Aug-25-2020, 08:19 PM
Last Post: carterb
  compiling various versions of Python, which toolchain? Skaperen 4 2,817 Jun-06-2019, 06:28 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