Slashdot Mirror


User: Half-pint+HAL

Half-pint+HAL's activity in the archive.

Stories
0
Comments
4,366
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 4,366

  1. Re:Who's surprised by this? on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    So you're really just saying performance be damned, functional programming is great, right?

    Did I say we should all be using FP? No. I said that FP doesn't work right in an imperative paradigm. Now a declarative language would need to be compiled, because yes, an interpreted declarative language isn't going to be able to optimise itself on the fly. But a compiler should be able to handle performance for us. One of the reasons compiler optimisations are so difficult is down to the multitude of ways imperative programming can be hacked about, so there is very little that is predictable in its behaviour, but even then, any decent compiler will spot redundancies in simple expressions and optimise them out, eg 3*((3*x)+2) optimised to (9*x)+6. In pure FP with immutable values, everything's an expression that can be reordered in that way. At that point, you are essentially programming declaratively anyway.

    That was my point. FP isn't really FP if you try to do it as an imperative paradigm.

  2. Re:Who's surprised by this? on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    Oops... wrong button. I was trying to sort the formatting on the code.

    Anyway -- as I was saying... With a for loop, you have to understand each step individually then construct the relationship between lines. The more experience you have, the easier this becomes, but it is still a more difficult cognitive task than reading a single statement. The list comprehension syntax isn't perfect, and you still need to break it down, but once you know about list comprehensions, it's impossible not to recognise what you're looking at, and you know the state of the execution environment afterwords. It eliminates inadvertent overwriting of variables with the same name as your intermediate values. And it's not like hand-crafting a near-identical FOR loop every single time you're faced with the task makes the resulting code any more efficient....

  3. Re:Who's surprised by this? on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    I find the above more readable than

    Sure, I can see that. But both are infinitely less readable than a for loop.

    I disagree with that, except in the trivial sense that you need to know what a list comprehension is before you can recognise one, and that Python FOR loops are reasonably similar across different languages.

    my_list = [] for x in list : if x>0 : my_list.append(x*x)

    The problem with most imperative programming is that the meaning of the program is broken up between multiple statements. The semantics of an individual statement are purely technical, and carry little meaning in terms of the overall functioning of the program. A list comprehension is a single statement that describes neatly and explicitly the

  4. Re:Stats are irrelevant on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    It's not at all uncommon for a well-designed system to be implemented using multiple technologies and languages, each best suited to their piece of the puzzle.

    Which is why it's a nuisance that a single file can only be in one language. I've been saying it a lot of late, but the reason that most multiparadigm languages fail is that they add keyword upon keyword in order to hack a single syntax into multiple different paradigms, rather than simply having syntax defined by context.

    The most extreme example I can think of would be SQL queries. When I last needed to database queries from Servlet Java (over a decade ago), you had to build everything up as strings and then call a library method with the string, then process the output... casts etc etc etc. Yeuch. I imagine it's now more like python-sql, where you do everything with object manipulations, which then generate the SQL code automatically. But by shifting all the database handling to "libraries", we no longer have a language for databases. What if instead our language allowed us to embed different language/syntax blocks? For example, an SQL recordset can easily be converted into a Python list of dicts, so wouldn't this be nice...?

    list_of_dicts = SQL { SELECT t1.name AS name, t2.location AS location FROM t1, t2 WHERE t1.id IS t2.id ANS t2.location == PythonVariableNameHere; }

    It would mean my code editor would be able to do syntax highlighting from all the different structure types in my code, and not just the ones in the "master" language.

  5. Re:"SITED as a language to watch"? on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    I'd always assumed it derived from the Scots "keich" -- excrement. Internet says no.

  6. Re:68th to 22nd and there are many to go on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    The point of popularity contests in programming languages makes the difference between having to write all the libraries yourself, or being able to use work others have done. Also it's interesting to see what other people think is good.

    Surely there's a saturation point for libraries where trying to see the wood for the trees is less convenient than just getting on with the job.

  7. Re:Who's surprised by this? on JavaScript, PHP Top Most Popular Languages, With Apple's Swift Rising Fast · · Score: 1

    Tail vs head recursion is a result of the imperative programming paradigm. FP is supposed to be an analogue of mathematics, which logically implies that it should be declarative. FP has been hamstrung by people fixating on ML, Lisp etc, and forgetting that much of how they do things is determined by the memory and processor constraints of machines 40 or 50 years ago. Yes, on one level it's good that programming language codebases are kept more stable and predictable than other code (given how much other software relies on the compiler or interpreter), but we have a hell of a lot more resources to play with, so we can do things a bit more clever, surely?

    Maybe I just did too much maths in my early years at university, but I always felt ".... where x=whatever(y)" was far easier to read than interrupting code with "let x=whatever(y) in ... end". The linearity of code and the [two|three|whatever] pass compiler system was designed not for the programmer, but for the machine. We have enough memory to do away with that now and make readability a true priority.

    We're kidding ourselves on if we tell ourselves that linearity is best, because we always find situations where we break it -- for example Python's list and generator comprehensions. Let's look at the order of evaluation of this example:
    my_list = [ x*x for x in input_list if x > 0 ]
    The first thing we do is retrieve input_list, then we iterate elements x, then we test the condition, then multiply for our final answer, then we assign the full thing to my_list. We can notate the order of evaluation thus: 5 = [ 4 for 2 in 1 if 3 ]

    List comprehensions are great. It doesn't take long to get used to them, and I find the above more readable than the (reverse) linearly evaluated
    my_list=map(lambda x: x*x,filter(lambda x:x>0,input_list)
    The comprehension doesn't just save a dozen characters, it's much, much quicker to mentally process. And of course it saves you iterating twice across large lists.

  8. Re:It is all fun and games... on You Can Now Clone Samsung's Gear VR and Test Your Virtual Reality Apps · · Score: 3, Informative

    It's difficult to get lawyers interested after you've released your code as open source...

  9. Re: just want I wanted! on Microsoft Announces Windows For Raspberry Pi 2 · · Score: 1

    Your attitude is understandable, but not excusable. Whenever somebody feels threatened by change, insofar as their inability to adapt to it is concerned, they will react with baseless accusations and attempts to spread FUD as a method of defending themselves which is precisely what you are doing. Many of these tools exist to supplement existing curriculum, not replace it, however that doesn't stop the incumbents from feeling threatened by the change if they are not progressive.

    When you assume, you make an ass of U and the adaptive learning systems programmer you are talking to. I'm not frightened of change, I'm trying to create it. If I'm worried about any threat, it's the threat of a flood of acceptably mediocre offerings creating a popular view that educational technology is a little freebie that has a few nice effects, thus undermining research into truly revolutionary (but far more expensive) systems. KA throughout it's history has been based on screencasts, and everything added on since has been aimed at leveraging the screencasts. It has all been taken from existing standard edtech practice -- nothing they have done as been cutting edge.

    The end result is basically a semi-automated update of what was known as "resource-based learning" back when my father was the one railing against it, and because KA doesn't have as much teacher involvement it's better than previous resource-based approaches, but in the end it still shares many of its limitations in terms of flexibility -- all the assumptions that went into the curriculum design and resultant ordering constraints remain. Which is why this is overly optimistic:

    Many of these tools exist to supplement existing curriculum, not replace it,

    A tool can supplement an existing curriculum, but materials always end up supplanting it. With teaching materials, it is rarely a question of all-or-nothing, but the middle ground between all and nothing is best described as a poorly coordinated mess. You need to have a profound understanding of the rationale behind the material before you can adapt it without losing the benefits, and if you step off the resource's expected learning path, suddenly you've got to adapt every other resource to meet your new path.

    For example, if your language resources start with the present tense, animals and food, and you want to start with the past tense (maybe because you want to tell lots of stories in class, and the past is the typical narrative tense in the language), all your resources will be loaded with vocabulary it expects the kids to know before the lesson starts, so you can't use any of them. You only truly get flexibility when the materials are made by the teacher or to the teacher's specifications -- KA doesn't attempt to do that. That's why I don't like Khan Academy.

  10. Re: Fascinating on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    How is it a "proper edit" to "correct" something that isn't wrong to start off with?

  11. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    And it says "the construction comprise of" ... "is regarded as incorrect." lgw's heart can rest peacefully.

    You misunderstand. It says to be comprised of "is part of standard English, but ... comprise of, ... is regarded as incorrect." IE. The construction only exists in the passive voice.

  12. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    Fuck that, it's wrong.

    His source (not the OED, see above) actually says it's "regarded as incorrect."

    Read it again:

    This usage [i.e. "to be comprised of"] is part of standard English, but the construction comprise of [NB: present tense, active voice], as in the property comprises of bedroom, bathroom, and kitchen, is regarded as incorrect.

    I.E. The Oxford considers "be comprised of" a valid construction, but something of a fixed phrase, and you cannot use it in active voice.

  13. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    Fucking descriptivists can die in a fire.

    This is true. But descriptivists are also capable of meeting their end in an inferno when they are not engaged in sexual intercourse. Prescriptivists too have the ability to end their lifes during exothermic chemical reactions, and again both during intercourse and at other times. In fact, even chaste linguists, who will never be caught inflagrante have the possibility of leaving this life via conflagration. And even people who have no interest in linguistics whatsoever can have their metaphorical goose quite literally cooked.

    The problem with prescriptivism is that there's always a better pedant waiting round the corner....

  14. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    People have often misinterpreted the story to make Canute look like he was drunk on power, when in reality it was exactly the opposite. He knew he couldn't hold back the tide, what he was doing was demonstrating to his sycophant advisors that he was not omnipotent. In effect he was telling his court to stop blowing smoke up his arse and start thinking about practical solutions to the kingdoms problems.

    My point exactly -- the "mythical version" is the one that people talk about trying to stop the sea.

  15. Re:ATM machine ..? on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    That vvovld have been so mvch better had yov vsed the letter v throvghovt.

    But it would haue been wrong. Historically, the "v" form was vsed only at the beginning of a word, and it was written "u" everywhere else.

    If you stumble across an original script for Romeo and Juliet, you'll probably find the line "where ciuil blood makes ciuil hands vnclean.

  16. Re:ATM machine ..? on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    Thou forgetst that twas to ShanghaiBill that I addressed mine former epistle. Thou art quick in anger and slow of wit, tis clear as day...

  17. Re: just want I wanted! on Microsoft Announces Windows For Raspberry Pi 2 · · Score: 1

    Last time I looked, none of the tools on KA were unique or innovative. They were all just implementations of standard tools that have been available for years in various forms. Khan Academy's success derives from the media hype, not the technology.

  18. Re:language fluidity on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    Pro tip: when you're tempted to write a grammatical booger like comprised of, think for a moment and use something else.

    Ah yes? Which profession is that? My pro tip as a language teacher is never to declare something is wrong when people use it all the time. I'm happy to advise against "comprised of" on the grounds that some egotistical shit-for-brains will look down on you for using it, but I'll never call it "wrong".

  19. Re:Patent Grammar Too on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    If you want to get a the meat, you have to engage in a bit of butchery...

  20. Re:Edit count whoring on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    If you can write a script that correctly identifies truly ambiguous uses of commas, why waste that talent on Wikipedia when you could instead be making millions coding semantic analysis algorithms for Google?

  21. Re: Fascinating on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    No, it's strange to get a kick out of it. I had someone pop up on a page I frequently edit to "correct" "neither... or..." to "neither... nor..." It really, really pissed me off that some guy with no interest in the topic would drop in and do a bit of "drive-by" condescention, taking there archaic minority usage to be somehow superior to that of us "commoners".

  22. Re:Fascinating on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    "Lone soldiers" are usually paranoid nutjobs fighting a reactionary war to recreate a past that never existed.

  23. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    What's the difference between "rent" and "hire"...?

  24. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    it's fine that they are sinonims, but you can't say "comprised of". That is poor grammar.

    Quad erat demonstrandum...!

    Although it has been in use since the late 18th century, sense 3 is still attacked as wrong.

  25. Re:I concur on One Man's Quest To Rid Wikipedia of Exactly One Grammatical Mistake · · Score: 1

    This guy's my hero - misuse of "comprised" is a pet peeve of mine.

    I hope you don't have a weak heart, because if you do, the Oxford English Dictionary entry on comprise might be a little too much for you to take:

    When this sense is used in the passive (as in the country is comprised of twenty states), it is more or less synonymous with the first sense ( the country comprises twenty states). This usage is part of standard English,