5 ms·
For me, python, but that's not exactly a change ;). I've always felt that python offered the same benefits as ruby accept with a simpler syntax, better cross p
by jmtulloss 18y ago
For me, python, but that's not exactly a change ;).
I've always felt that python offered the same benefits as ruby accept with a simpler syntax, better cross platform support, better performance, and a more organized community.
- tocomment 18y agoI find the "there's only one way to do it" philosophy of Python to be really important. That's the main thing that kept Ruby off my radar.
- nihilocrat 18y agoI feel it diverges a little bit, actually. In many cases it provides the "C style" way of doing it and the "functional style" way of doing it. Thankfully, in many cases one of them is much faster than the other, but it's not obvious to the novice and they will probably use the "C style" for years in ignorance of the alternative. Example: mylist = [] for char in "foobar": if char == "f": mylist.append(char) vs. mylist = [ char for char in "foobar" if char == "f" ] The latter is supposedly much faster, and as you can see, much more succinct, but I hadn't learned about it until about a year ago. I have been programming in Python since about 2002/2003.
- tocomment 18y agoThat's a good point. I'd argue the first way is the wrong way to do it. I guess once you get to multiline statements the philosophy breaks down. I'm just happy there's no string.strip() and string.trim() or something crazy like that which I'm guessing Perl has :-)?
- NyxWulf 18y agoIt's pretty hard to believe you've been using Python seriously since 2002/2003 and had never heard of list comprehensions. They are a pretty big staple of most Python programmers.
- nihilocrat 18y agoThen you can call me out for being a noob, if you wish. :)
- d0mine 18y agoThis particular example could be written as follows: >>> char = 'f' >>> char * "foobaf".count(char) 'ff' Or >>> [char] * "foobaf".count(char) ['f', 'f']
- blasdel 18y agoThere's also the fact that the CPython implementation doesn't have any huge warts.
- jmtulloss 18y agoI can't believe I spelled "except" "accept". I need to get some sleep.