Hacker News new | ask | show | jobs
by ajford 3078 days ago
Is anyone else greatly annoyed by the FUZE/Python comparison block on the homepage (fuze.co.uk, ~halfway down the page) that compares the Fuze loop and Python?

They write the "print" statement like it's damn Java. A simple `print(outstring)` would have been sufficient, instead of two lines of Java-esque sys.stdout.write nonsense.

Not to mention something like `colored` and `colorama` or `click` would solve the colored text thing. Though I'll admit having globals like INK and PAPER makes things a bit more intuitive for kids.

But the fact that they go out of their way to make the Python example more intimidating is a little... annoying.

3 comments

Including the shebang and encoding at the top, using stdout for some reason, handling all the color formatting in one dense string...

This smacks of the writers trying to intentionally make their comparison language look obtuse. A pattern I've seen elsewhere and am never a fan of.

This is absolutely what they're doing. It condenses quite easily even to:

    import random
    import time

    while True:
        col = random.randint(30, 48)
        print("\x1b[{}m{}\x1b[0m".format(col, "Hello World"))
        time.sleep(1)
Which is still pretty obtuse, but the "random colours" task seems hand-picked to penalize Python.

It neglects to mention that Fuze has virtually no utility beyond an educational curio, too, versus Python which is used for many, many things.

And yet, the example correctly points out that Python, while a suitable choice, is not the ideal choice when it comes to programming for kids. Classroom time is precious, and kids need to be able to get right into the meat of things. Things that are easy for us to grok, like imports and functions vs methods, are tough for raw beginners. And _no_ kid should be forced to contend with ANSI escape sequences!

More appropriate would be to compare with some Python programming kit that had similar graphic environment abstractions:

  fontsize(4)
  while True:
     ink = rndcolor()
     paper = rndcolor()
     text("Hello, world!")
     sleep(1)
But even then, unless you wrap Python with something that handles imports/globals/etc for you (a la Processing), doing this in Python is still going to take a bunch of extra gunk.
One could argue that Fuze - a commercial programming language - is a bunch of extra gunk versus the free, open source and widely available alternative of almost any other language.

But you're right, a fairer comparison would be against a Python learning environment that sweeps some of the cruft and gotchas under the rug, and complexity is very tough for beginners.

Speaking from experience running and helping in workshops, I found a lot of Python learners would name their code "somemodule.py" after the module they're learning about, and this would subsequently break "import somemodule". So there's a lot of merit in "safer" environments.

The sad thing is, I'd bet that the developer first turned in something like what you've written, but was then asked to "make it more complex".

I'd like to see a satire done in a code-golf style: you think writing a line to a file in Python is easy? Think again, after you read this 400-character line of lambdas, string interpolation, and chained ternary operators!

Assembly code could be made to look like the sane alternative at the (il)logical extreme.

Not to mention "FUZE is widely accepted as an ideal resource for teaching coding", and I'm pretty sure 99% of us never heard of the language before...
I just makes me sad for a developer that actually created that language, who put lots of knowledge and work in it. And then someone (I assume not same person) try to propagate it using such stupid example.