Objective
Every programming language has its idioms... Studying these idioms helps one to write elegant code.
Description
Every language brings its own culture, hacks - and style with it...
And the stuff you absolutely have to know for getting something done...
Idiomatic code is also very elegant...
While learning python, I think this would fill in the need... The coroutines stuff in python is super stuff...
Also the list copy as
def y = x[:]
While comparing with other languages - here is what I mean...
C/C++ have extensive idioms - for example,
while( d++ = s++);
is how strcpy is defined in C... (Or "executing around the pointer" idiom in C++
http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Execute-Around_Pointer)
Perl has so many - (The first time I saw Schwartzian transform - my eyes popped out
http://en.wikipedia.org/wiki/Schwartzian_transform ;-)
Java's try/finally - and list -> array conversion
MyClass[] arr = myList.toArray(new MyClass[0]);
- and many others...
Speaker bio
I have been writing code for the last 16 years - in various languages - and know many idioms for them.
Please see more about me at
http://lnkd.in/fNUepH
1
▼
This proposal is too vague and the example provided is wrong. Please flesh it out and provide something more concrete.
1
▼
Not sure why it is vague - every language has idioms - and as example I have given a chosen few samples in languages I code...
I have also listed one python idiom... The talk would cover python idioms - and possibly compare and contrast these against similar idioms in other popular languages... I don't know which example you mean is wrong - please elaborate...
1
▼
def y = x[:]
is not valid python.The point I'm trying to make is that I'm not exactly sure what I'd learn if I attended this session. I can't decide whether to upvote or downvote it. Not enough information.
1
▼
Hi Noufal,
I tried it out - you are right - it should have read like
My apologies ;-) I think I need to practice more python...
I am not a Python programmer - but somehow love the language - found it very appealing - started to learn it on my own -
--- cheerio atul
1
▼
Oops I think the formatter ate up the new lines - I mean all the three assignments should be on separate lines...
--- cheerio atul