Welcome, Guest. Please login or register.
March 28, 2024, 02:20:16 am

ballp.it is the community forum for The F Plus.

You're only seeing part of the forum conversation. To see more, register for an account. This will give you read-only access to nearly all the forums.

Topic: Thread.setTitle("Programmers Anonymous");  (Read 60648 times)

Gyro

  • touched fuzzy, got dizzy
  • Paid
  • 830
  • 55
There was a study done that found that keyword-based syntax and indentation-based syntax were easier for new programmers to learn: https://www.quorumlanguage.com/evidence/evidence.pdf. (the full paper is unfortunately hard to find online, but from what I remember from reading it their methodology was super fair)
Zekka, July 03, 2016, 12:47:39 pm

That's pretty legitimate, but out of the two I'd still choose indentation-based syntax by a landslide (and I do, by using Moonscript over pure Lua). The difference is that proper indentation is something you should be doing anyway. No extra typing. Less typing than curly braces, in fact, if you're already indenting that way!

So yeah I kinda like Python.

e: Thanks for the study, by the way. That's pretty informative.
« Last Edit: July 03, 2016, 12:53:48 pm by Gyro »

Lemon

  • Whatever happened to Freedom of Speech?
  • Administrator
  • ...IT'S NOW THE MASH!
  • 4,127
  • 421
I like indentation-based stuff a lot, but I don't get to use it much. I do a lot of writing in Jade (indent based HTML language), and that system just forces me to think in systems and dependencies, and I (sometimes) come out with cleaner code as a result. Always quicker to write.

I do some other stuff in yml, which is terse and that's nice, but I feel like the syntax is dumb and my yml files never work as well as I think they should.
I keep meaning to teach myself coffeescript to eliminate all of the fluff that JavaScript forces into a person, but I never find the time. Hopefully this year.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 872
    • 54
I like indentation-based stuff a lot, but I don't get to use it much. I do a lot of writing in Jade (indent based HTML language), and that system just forces me to think in systems and dependencies, and I (sometimes) come out with cleaner code as a result. Always quicker to write.

I do some other stuff in yml, which is terse and that's nice, but I feel like the syntax is dumb and my yml files never work as well as I think they should.
I keep meaning to teach myself coffeescript to eliminate all of the fluff that JavaScript forces into a person, but I never find the time. Hopefully this year.
Lemon, July 03, 2016, 06:20:09 pm

The improvements Coffeescript introduces (at least as far as I remember) are pretty conservative -- you're a reasonably intelligent person so I doubt it would take you longer than a week to learn to use it. The annoying bit is that you have to manually recompile (or tell your build system to recompile automatically) when you use it -- but it sounds like you already use tools that have that workflow so probably you have no reason to care.

Lemon

  • Whatever happened to Freedom of Speech?
  • Administrator
  • ...IT'S NOW THE MASH!
  • 4,127
  • 421
Yeah, I precompile both my css and my html, so it makes sense to do it with js as well. Results don't seem quite as interesting, but if I can just avoid that "everything breaks if the last item in an array has a comma after it" problem, my life already improves a little.

Thanks for thinking I'm reasonably intelligent though!

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 872
    • 54
Thanks for thinking I'm reasonably intelligent though!
Lemon, July 03, 2016, 07:44:43 pm

If you come into this thread and post a CoffeeScript question I'll probably have to rethink that assessment.

Nifty Nif

  • Big Dumb Slimy Monster
  • Paid
  • powerful and can be dangreous
  • 809
  • 51
On the topic of compiling JS, I'm using React for the first time, and I am rethinking so many of my life choices at this moment.  I really wish they had more docs on their API calls because I don't like using their JSX syntax.  I'm also having to Browserify the Node underneath, which is a real pain in the ass, but it works okay I guess.  I'm probably going about this all wrong, but my main problem is with the lack of documentation on the api calls.  I can mostly pick them up, but for a non-javascripty person they're a little too loose and free to intuit.

ham burger

  • super hungay
  • Paid
    • 82
    • 15
I keep meaning to teach myself coffeescript to eliminate all of the fluff that JavaScript forces into a person, but I never find the time. Hopefully this year.
Lemon, July 03, 2016, 06:20:09 pm

So, my opinion only but if you're gonna dive in on coffeescript, and you're perfectly okay with compiling JS, forget about coffeescript. Learn all the new ES6 features and start writing ES6 and transpiling it back to ES5 if you're deploying to the internet at large.

ES6 has lots of nifty features Coffeescript will give you, and you have the added bonus of writing code that works without compilation in modern JS environments. Just my two cents. At my last job we used Typescript, and really dug it, but my current team owns a greenfield app that we did in react with ES6 over the past year and it's been a really, really brilliant transition (and JSX aside, we're writing vanilla JS that conforms to the ES specification so should work indefinitely as support for it/work on it will never be dropped.)
Nifty Nif

nuffkins, of all people,

  • Paid
  • much ado about nuffkins
    • 75
    • 13
Today my prof explained that — sure — C++ lambda isn't really lambda, but it can do most things actual lambda can.

Problem: that assumes functional programming purists care about doing things.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 872
    • 54
Today my prof explained that — sure — C++ lambda isn't really lambda, but it can do most things actual lambda can.

Problem: that assumes functional programming purists care about doing things.
nuffkins, July 21, 2016, 03:35:57 pm
What's not real about it?

nuffkins, of all people,

  • Paid
  • much ado about nuffkins
    • 75
    • 13
What's not real about it?
Zekka, July 21, 2016, 03:59:07 pm

Functions aren't first class data in C++.

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 872
    • 54
What's not real about it?
Zekka, July 21, 2016, 03:59:07 pm

Functions aren't first class data in C++.
nuffkins, July 21, 2016, 06:25:36 pm
Why not? Aren't lambdas in C++ just function pointers paired with the parts of the scope that are already filled? I'm not sure what other properties you would expect a function-as-value to have.

IIRC function pointer plus scope pointer is basically how Haskell or your other purist functional languages represent them, unless static monster cockysis proves that the closure doesn't last any longer than the creating scope.
nuffkins, of all people,

ham burger

  • super hungay
  • Paid
    • 82
    • 15
unless static monster cockysis
Zekka, July 21, 2016, 06:30:40 pm

OH MY GOD[/glow]
Nifty Nif chai tea latte

A Whirring Bone-White Gleech

  • fact-lord
  • Paid
  • I was in first place, you whore!
  • 720
  • 155
Problem: that assumes functional programming purists care about doing things.
nuffkins, July 21, 2016, 03:35:57 pm

Languages with good functional programming support make setting up callbacks (in graphical programming, for example) much, much easier.  Compare the following:

Python 3:
button = tkinter.Button(root, text = "click me", command = lambda: print("clicked"))

Qt/C++
    QObject::connect(ui->pushButton, &QPushButton::clicked, [=](bool clicked) {
        std::cout << "clicked" << std::endl;
    });

Java Swing (old-style)
        button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.out.println("clicked");
                }
            });

Consider how painful something like node.js would be, if every time you called an async function, you had to use the Java syntax.
« Last Edit: July 22, 2016, 10:58:31 am by Der Trommelngleech »

Gyro

  • touched fuzzy, got dizzy
  • Paid
  • 830
  • 55
It seems to me that, when people talk about functional programming, they're talking about two different things. There are languages with good functional programming support, like Python 3, Scala, and Rust. Then there are pure functional languages where mutable state does not exist outside of monads, like Haskell and (I think) Erlang. I'm pretty sure nuffkins was complaining about proponents of the latter.

Of course, in their defense, Erlang has been used to build practical things a bunch of times. It was born out of a desire to build telephone exchanges. So, you've got at least one functional programming language that people have used to solve real problems.

Pure functional languages still weird me out and I have no idea how to build anything in any of them. Take my opinion with a grain of salt, since I don't know shit.

Functional features in imperative languages are pretty sweet, though, in my experience.
Nifty Nif A Whirring Bone-White Gleech

Zekka

  • I AM IN INTO MATHEMATICAL CALCULATIONS AND MANY METHODS USED IN THE STOCK MARKET
  • Paid
    • 872
    • 54
It seems to me that, when people talk about functional programming, they're talking about two different things. There are languages with good functional programming support, like Python 3, Scala, and Rust. Then there are pure functional languages where mutable state does not exist outside of monads, like Haskell and (I think) Erlang. I'm pretty sure nuffkins was complaining about proponents of the latter.

Of course, in their defense, Erlang has been used to build practical things a bunch of times. It was born out of a desire to build telephone exchanges. So, you've got at least one functional programming language that people have used to solve real problems.

Pure functional languages still weird me out and I have no idea how to build anything in any of them. Take my opinion with a grain of salt, since I don't know shit.

Functional features in imperative languages are pretty sweet, though, in my experience.
Gyro, July 22, 2016, 12:06:12 pm

FWIW, IIRC Haskell and Idris are the only functional languages right now that are widely cared-about and have a strong preference towards monads. The monad thing is basically a magic trick you use to convince yourself code you would write anyways is OK -- there are advantages but for most programs they are pretty negligible. Monads just guarantee your program is rewritable to a version of your program that didn't use mutation.

IIRC some dogmatic functional languages that don't use monads are Mercury and Clean. (not positive, but I believe they use linear typing, which works like Rust's affine typing)

IIRC erlang is pretty pragmatic and doesn't represent most of the stuff you dislike -- it's also largely untyped.

IIRC. IIRC.