I actually just moved from C to Python after 3 years of C, and am loving Python. That being said it does have its downfalls but it allows me to write cleaner, easier understood and powerful code.
Name:
Anonymous2012-01-30 8:25
>>3 clean, easier understood
Sure if you think FORCED INDENTATION OF CODE is good
Something like this? import sys
gpsFormat = lambda x, y: (lambda z: '%s.%s.%s%s' % (z[0][:-2], z[0][-2:], z[1], y))(x.split('.'))
if __name__ == "__main__":
for line in (l2 for l2 in (l.split(',') for l in sys.stdin) if l2[0] == '$GPGLL'):
print 'Lat: %s Long %s' % (gpsFormat(*line[1:3]), gpsFormat(*line[3:5]))
Name:
Anonymous2012-01-30 9:11
>>4
I personally believe that forcing users to stick with one single style over the enirety of the language is a good thing. I programmed in C for three years, until I found the Linux Kernel Style my code was absolute C soup and unintelligble to most programmers at a glance. Forcing a consistent style on the user makes code readable across the entire language. I can go look at any other snippet of Python and read the code for what it is rather then "What the fuck is the scope on this line?". Fucking Beautiful.
And about powerful, I can generally write anything (for any nontrivial example) in 10%-25% the amount of code a C varient and still maintain clairity.
And hell, if you wankers still want to write C and harness the awesomeness of python you can do it by writing a simple module. Python is fucking boss like that.
Come at me bro.
(In other unrelated news, why the fuck does Dillo work so well over SSH compared to Firefox/Chromium?)
Name:
Anonymous2012-01-30 9:49
>>6
You wrote shitty code that you couldn't even read yourself when looking back at it and thus you think C is ab unreadable heap of shit. Go back to your toy programs that no one gives a fuck about you toilet scrubber