9 ms·
Programming Languages as Boy Scouts
- labrador 10y agoI 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.
- jomamaxx 10y agoHa. I think Java is the best all round language. Oddly, it's usually not the best language for any specific thing :). Paradox :)
- jharger 10y agoReminds me of this quote: "Perl is like vise grips. You can do anything with it but it is the wrong tool for every job." - Bruce Eckel
- qwertyuiop924 10y agoI think Lisp is the best all-rounder. If it isn't the best at something, you can MAKE it the best.
- jomamaxx 10y agoLisp as a 'language' maybe, but the problem is it's more than syntax and compiler. The advantage of JVM, garbage collection, relative platform neutrality, docs that are really consistent, libraries that are very easily shared, and the huge amount of things built into the lang package over time, the number of Q/A on Stack Overflow, resources available, support, 3rd part libraries - these are things that Lisp really lacks, making it not a very useful thing all around.
- qwertyuiop924 10y agoIt depends on what lisp you pick. And while CL isn't my favorite, if you're a Common Lisp user, some of that stuff's already there for you. But yeah, the JVM is a great platform. But Java is inseparable from it, and Java isn't a great language.
- _asummers 10y agoLisp and JVM are not mutually exclusive, of course. There were JVM Lisps before Clojure (I don't know any off the top of my head), but Clojure is an extremely nice language to work with, if you've never worked with it.
- 10y ago
- patorjk 10y agoIt should be noted that Scout Law varies depending on what country you're in. For example, some countries have laws saying a scout should smile and whistle under all circumstances. I'm not sure how one would work that into a positive property of a programming language.
- basseq 10y agoWho's going to take this a step further, evaluate every programming language against this framework, and tell us who's the Eagle Scout of the group?
- cmontella 10y agoSorry to self-promote a little but, but I just published a dev diary [1] for Eve, where I talk about a lot of the same ideals described here. For instance, the author writes: > For brownie points, your compiler should explain why the programmer has encountered an error, and for the gold medal it should propose a solution. This is exactly what we're trying to do with Eve. In one of the examples [2], I show an error that is met with a full explanation of what went wrong, a possible fix, and even a button that offers to fix the error. On our philosophy toward errors, we've identified that they should be understandable (written in full plain English sentences), relevant (point to the root cause of the error, rather than incidental errors), and actionable (we provide the reason for the error, offer to automatically fix the error where possible, and teach the user why the error occurred and how to avoid it in the future.) We're still in the early stages of handling errors, but this is at least how we're thinking about it. [1] http://incidentalcomplexity.com/2016/08/03/july/ http://incidentalcomplexity.com/2016/08/03/july/ [2] http://incidentalcomplexity.com/images/errorExample.gif http://incidentalcomplexity.com/images/errorExample.gif
- cpeterso 10y agoOne advantage of non-human-readable error messages is that they are easier to Google. Microsoft's compiler warning and error messages all have unique error codes like C1234, which make them easier to find on sites like MSDN or Stack Overflow. https://msdn.microsoft.com/en-us/library/aa249862(v=vs.60).aspx https://msdn.microsoft.com/en-us/library/aa249862(v=vs.60).a...
- cmontella 10y agoThis is true, but at the same time I don't think having to resort to Googling an error is a good user experience in the first place. With Eve, we want to try and avoid that as much as possible.
- Klathmon 10y agoWell the 2 aren't mutually exclusive. Throw a unique error code in there, as well as a description on how to fix it.
- wyager 10y ago> Such a language should have ASLR enabled Or, you know, just be memory safe.
- titzer 10y agoThis is brilliant! > Reverent. Whether you belong to the Kingdom of Nouns or the Church of Lambda, be respectful of all faiths. Better yet, take the best of all worlds when designing your language (see: my previous post). Don't force users to pick one paradigm over the other, but rather be flexible enough to accommodate all walks of life. If only. But, that being said, I think all languages are coming around to adding first class functions.
- tracker1 10y agoWhat's funny, is to me F# and JavaScript would rank pretty highly in my mind. Though JavaScript does allow for more varied paradigms of adoption, but not so friendly.
- douche 10y agoComparing JS and F# is interesting... I would be very psyched if web browsers implemented F# rather than JS. Type safety, with inference, would be a big win.
- catnaroek 10y ago> But, that being said, I think all languages are coming around to adding first class functions. Object-oriented languages have always been higher-order. Functional programming is great, but object-oriented languages have always had first-class procedures, whether they compute mathematical functions or not. And not all procedures compute mathematical functions in functional languages either. What object-oriented languages lack is an emphasis on values, rather than the memory locations (aka object identities) that contain said values. The benefits of not worrying about object identities cannot be overstated: Removing the spurious distinction between memory blocks that hold equal values automatically endows the language with a richer equational theory that can be used both by language users (for reasoning about correctness) and language implementors (for optimization purposes).
- bcheung 10y agoI saw trustworthy, loyal, and my mind immediately filled in the rest. I haven't had anything to do with Boy Scouts in over 20 years and I still remembered it flawlessly. It's a shame the clean rule isn't found in programming languages more. I really like low noise syntax of Python, Coffeescript, and Elm but it seems like it is not really being adopted.
- mshenfield 10y agoElm wins the gold medal for helpfulness. http://elm-lang.org/blog/compiler-errors-for-humans http://elm-lang.org/blog/compiler-errors-for-humans
- ksubedi 10y agoAll valid points. C# seems like it fits the criterias the best out of the languages I have used.