4 ms·
I sat down to learn Python a few years back to add another language to my tool belt. I ended up hating it in the first 10 minutes and haven't really had the nee
by labrador 10y ago
I sat down to learn Python a few years back to add another language to my tool belt. I ended up hating it in the first 10 minutes and haven't really had the need to use it since. Why? My sample program looked perfect. It was indented properly without braces - losing braces was the first concession the language asked me to make - but it wouldn't run because of one line which was indented several places. Three of those indents were 4 spaces each, but one of them was a tab. The interpreter chose not to tell me this fact. It merely said my program had illegal indentation or something. Looking at it I didn't see any problem. Solving this mystery was an unnecessary waste of 10 minutes of my life and I decided on the spot that Python was too opinionated for my tastes and not helpful at all. Then I read the designers of Python are forcing coders to change their "print" statement when upgrading Python 2 to Python 3 and think my first impression was right.
In terms of Boy Scouts, Python is the kid with strict dietary requirements who insists the other boys eat his crappy food, just because.
- jomamaxx 10y agoAdmittedly, that part stinks. It's been 20 years and they still haven't fixed some of those basic things. BUT - Python is a great language for scripting. If you need to parse some stuff, produce a result ... Python is it. The documentation bytes, I'm not a big fan of how it scales, packages are clumsy, deployment can be clumsy, but if you can get past those things, script away. As far as brackets: in the long run I think it's better. I was very resistant to it at first. But then I came to prefer it. I actually wish Java had a bracket-less option. If Java had that, plus simpler file access, plus amazing array and string access ... man, that would be great. Even though those are 'small things' - in reality, a lot of scripting code is filled with that, so it really adds up. Going one step further ... maybe heretic - but having worked with a lot of Javascript ... I suggest that some loose data typing options would be great as well. JSON in Java is a goddam pain. JSON and Javascript is seamless. A lot of front-end programming is very data centric, but in the 'micro sense' i.e. passing around a lot of little bits of data. Also, it's highly event drive and async, which JS does well. So - also add more seamless async (Java Lambdas approach this) - and voila, Java could be better for UX type things as well. But languages don't evolve very well, sadly :) it usually takes someone to come along and reinvent it using best practices and maybe a big company to support it, and it takes years to get to maturity. Either that or to create a highly 'proprietary' version of something, a-la Microsoft.
- douche 10y agoAlmost, but not quite would be http://www.groovy-lang.org/ http://www.groovy-lang.org/
- vorg 10y ago> I actually wish Java had a bracket-less option Jython is much older and more stable than Apache Groovy, and is bracket-less so there's no "almost but not quite" about it. It only exists for Python 2.x, not Python 3, which is a result of its stability.
- tracker1 10y agoI find that abstract data as objects, translation, conversion, etc works very well in JS. There's a reason node has seen it's rise as a middle-tier server servicing front end APIs as much as it has.
- bigger_cheese 10y ago>BUT - Python is a great language for scripting. If you need to parse some stuff, produce a result ... Python is it. That's really interesting to me. I feel almost exactly the same way about Perl. It has a heap of rough edges and things that are "imperfect" but when I need something done quickly (i.e a quick script to parse some text) I reach for perl. Strange how conceptually they are very different languages but have converged...
- shagie 10y agoGiven that JSON stands for JavaScript Object Notation, I would expect nothing less than seamless integration in JavaScript. Languages that have a more strict and less dynamic structure would likely have more difficulty working with JSON. On the other hand, give me an xsd and I'll generate some not awful Java. Consider the joys of JavaScript where one has to validate against an xsd. Might I introduce you to Groovy? http://groovy-lang.org/json.html http://groovy-lang.org/json.html
- vorg 10y ago> Languages that have a more strict and less dynamic structure would likely have more difficulty working with JSON Unlike with Javascript, JSON is not a subset of Apache Groovy syntax, which also makes it have difficulty working with JSON.
- kevin_thibedeau 10y agoPy3 refuses mixed indentation so that problem can't happen anymore. The change to print is easy enough to deal with: > 2to3 -w foo.py Moreover much of the new Py3 syntax has been usable in 2.x for 10+ years with __future__ imports. There's little excuse for not taking advantage of it.
- deleted 10y ago[deleted]
- MBlume 10y agoIf you think it should be acceptable to mix tabs and spaces in a source file, then one of the attractive features Python offers its users is the assurance that they'll never find themselves working on a project with you.
- labrador 10y agoSpoken like a true believer. Did you know some editors offer the use of tabs for indent and spaces for alignment? The chances for a space to get into the left hand indent side are pretty high in such a system, which I imagine is dealt with harshly in your world. I am happy to self-select myself out of it.