Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
elegant code
#1
what is it that make code elegant?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
you
Reply
#3
what would people look for in code to decide to say that some particular code is elegent?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
Easy reading and understanding?
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#5
Python is good in expressing things.
If you understand this two functions in less than one minute, it's pythonic :-D
It's like poetry.

def qsum(number):
    result = 0
    number = abs(number)
    while number:
        result += number  % 10
        number //= 10
    return result

def qqsum(number):
    result = qsum(number)
    while result > 9:
        result = qsum(result)
    return result
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#6
is pythonic a proper subclass of elegant?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#7
I think so. Maybe pythonic is a subclass of elegant and readable.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#8
(Mar-26-2018, 06:31 AM)DeaD_EyE Wrote: I think so. Maybe pythonic is a subclass of elegant and readable.

... a subclass of the intersection of ... ?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

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