11
Yujiri
5y

I do not understand people who critique Python for using indentation to mark code blcoks. I've seen multiple posts being like "Uhh in Python a missing space breaks everything and it's so hard to find it". Yeah so hard when the interpreter throws a parse error and tells you exactly which line it's on. Let me go back to a bracefest language, misplace a brace halfway through the file, and get told there's a syntax error at the end, and spend a whole two minutes finding it.

Comments
  • 2
    I prefer comma-fests myself
  • 2
    The thing is, you have to consciously write code and cant just do for example

    list
    .something
    .something

    Because its a syntax error
  • 2
    This. Of course there are corner cases but most of the time, it is really obvious where you need to indent, and with a sufficiently intelligent editor it's not even half a challenge to get right.
  • 0
    But let's be real here, tab being one is a fucking death sin
  • 1
    Not sure if Python allows tabs… F# doesn't—spaces only!—because tabs mean different things to different people. Spaces are easy to count.
  • 3
    @SomeNone tabs are allowed but mixing tabs and spaces within the same file results in an error
  • 0
    mostly a preference. I love Python for itd piwer but hate the lack of static typing as well as the indentation. Does this make it horrible? not by a large margin since the benefits outweigh the cons imo, but i still dislike the whitespace and will never like it.
  • 1
    I usually have to to change my whole methodology of writing variables and function names when switching from java to pythob which i find irksome.

    //Java
    Class student{

    Student(int id, String name, String address, char gender,
    Int totalMks, int totalSubject,...)
    {...}

    }
    =================================
    #Python
    class Student:
    def __init___(self,i,n,a,g,t_mks,t_subj,...):
    #stuff

    Its nice but gets unintuitive when one tries to limit line length to 80 chars
  • 0
    @StopWastingTime or you could

    def a(b, c, d\
    e, f, g)
  • 0
    @yellow-dog of course, although it does feel weird leaving \ character dangling between your code
  • 0
    Completely fair point.
Add Comment