Linked by MOS6510 on Thu 10th Jan 2013 23:25 UTC
Permalink for comment 548450
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Features
Linked by Thom Holwerda on 06/13/13 14:35 UTC
Linked by Thom Holwerda on 06/11/13 17:07 UTC
Linked by Thom Holwerda on 06/10/13 23:13 UTC
Linked by Thom Holwerda on 06/08/13 14:57 UTC
Linked by Thom Holwerda on 06/07/13 11:40 UTC
Linked by Thom Holwerda on 06/04/13 12:45 UTC
Linked by nfeske on 05/31/13 10:12 UTC
Linked by Thom Holwerda on 05/29/13 16:59 UTC
Linked by Thom Holwerda on 05/24/13 17:26 UTC
Linked by Thom Holwerda on 05/21/13 21:38 UTC
More Features »
Sponsored Links



Member since:
2006-07-26
I love C and Python.... and I love the fact that they're fairly simple to intermix.
Porting C to Python and Python to C is pretty straight forward (as long as you're not doing OO programming in Python obviously).
To me... I see Python as C but with a nicer syntax and just the right amount of built in data structures.
I love being able to create a throw-away list, dictionary, or other structure right inline a statement.
See if the first two letters of a string match one of several other strings?
In Python:
if foo[:2] in ['XX', 'YY', 'AB', '!!']:
print 'woo hoo'
In C:
if ( strncmp(foo, "XX", 2) == 0 ||
strncmp(foo, "YY", 2) == 0 ||
strncmp(foo, "AB", 2) == 0 ||
strncmp(foo, "!!", 2) == 0 ){
printf("woo hoo\n");
}
... its the little things.
Is the Python going to perform faster?... hell no, but I love the readability. And if it needs to be ported to C for performance, it is straight forward.