|
|
Subscribe / Log in / New account

Pythonic code review (Red Hat Security Blog)

Pythonic code review (Red Hat Security Blog)

Posted Dec 15, 2016 21:50 UTC (Thu) by markhb (guest, #1003)
Parent article: Pythonic code review (Red Hat Security Blog)

It seems he wrote far more on "interesting ways Python does things" than he did on more general insights into reviewing code. Also, Java does the exact same foreach loop he says it doesn't:

for (Object o : Collection<Object>)
//do stuff with o
}


to post comments

Pythonic code review (Red Hat Security Blog)

Posted Dec 15, 2016 23:52 UTC (Thu) by lordsutch (guest, #53) [Link] (5 responses)

Isn't that for statement syntax a relatively new addition to Java?

Besides which, he specifically prefaces the section discussing for loops with "For folks coming from C."

Pythonic code review (Red Hat Security Blog)

Posted Dec 16, 2016 0:07 UTC (Fri) by JanC_ (guest, #34940) [Link]

"for folks coming from C" sounds like an interesting syntax proposal... ;-)

Java for-each

Posted Dec 16, 2016 0:26 UTC (Fri) by tialaramex (subscriber, #21167) [Link] (3 responses)

Java 5, so, about 12 years old at this point. It's no ANSI C, but it's past the point where anybody should be pretending that it's some bleeding edge technology they can't justify in their Real Grown-up systems.

Java for-each

Posted Dec 16, 2016 2:24 UTC (Fri) by smckay (guest, #103253) [Link]

And long since EOL. Any non-horrifying deployment will be running Java 7 or 8.

Java for-each

Posted Dec 16, 2016 12:20 UTC (Fri) by jtaylor (subscriber, #91739) [Link] (1 responses)

Even though it is available since a long time, there are lots of programmers that learned the old way and continue using it today.
I still regularly have to regularly flag stuff like C89 un-scoped iteration counters in >= C99 code reviews despite this being standard since 17 years and available even longer in actual compilers.

Java for-each

Posted Dec 20, 2016 18:34 UTC (Tue) by niner (subscriber, #26151) [Link]

Even longer in actual compilers....except for MSVC which finally started supporting C99 in 2012 and still doesn't have full support. So people who are used to cross platform development have learned to stick to C89 for a long time.

Pythonic code review (Red Hat Security Blog)

Posted Dec 16, 2016 15:37 UTC (Fri) by khim (subscriber, #9252) [Link]

I don't think he says that Java does not have a "foreach" loop. Of course it does! Who does not? Even C++ have a foreach loop novadays!

What he says is that Python only have a foreach loop! It does not include a traditional C/Java for loop! And he's right, of course.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds