Skip

Blockly
June 19, 2012 10:49 AM   Subscribe

Blockly is a visual programming editor from Google.

Blockly was developed by Neil Fraser, who has appeared previously on Metafilter.
posted by alby (93 comments total) 43 users marked this as a favorite

 
I don't know why people insist on re-inventing these things every few years. Nobody who actually needs or wants to program anything ever finds them more usable than just typing. Nobody ever creates a visual essay builder.
posted by tylerkaraszewski at 10:50 AM on June 19, 2012 [11 favorites]


Looks like scratch, right?
posted by shothotbot at 10:52 AM on June 19, 2012 [5 favorites]


This is not "from Google" in any sense except that it's being hosted on code.google.com.
posted by Plutor at 10:54 AM on June 19, 2012 [4 favorites]


Indeed. Every few years someone who doesn't know very much about language design gets all worked up about the fact that source code is plain text, and has been plain text since the dawn of time, and becomes convinced that somehow we should be able to use our modern fancy video screens to display something ever so much better than old fashioned plain text, and off they go to the latest round of the visual programming game. It never works.
posted by Mars Saxman at 10:55 AM on June 19, 2012 [6 favorites]


Nobody who actually needs or wants to program anything ever finds them more usable than just typing.

I don't think anyone is going to write an OS with these. But they are great for kids. They can ignore matching braces, using semi-colons and other syntax errors and just focus on fixing their many logic bugs.

I had one kid graduate from Scratch to Python/C/Tcl/Scheme. I had another play with Scratch for a while, try out Python and decide it wasn't for him (at least not yet).
posted by DU at 10:55 AM on June 19, 2012 [15 favorites]


This is not "from Google" in any sense except that it's being hosted on code.google.com.

This WIRED story certainly gives that the impression that it very much is "from Google".
posted by alby at 10:56 AM on June 19, 2012 [2 favorites]


I totally agree, though, that if the industry as a whole were adopting this I'd be pretty down on it (like with IDEs, which are basically the same thing only they don't even solve the original "problem" of the source code being text).
posted by DU at 10:57 AM on June 19, 2012 [1 favorite]


There are some interesting example projects in a post about Blockly on Y Combinator.
posted by alby at 10:58 AM on June 19, 2012


Indeed. Every few years someone who doesn't know very much about language design gets all worked up about the fact that source code is plain text, and has been plain text since the dawn of time, and becomes convinced that somehow we should be able to use our modern fancy video screens to display something ever so much better than old fashioned plain text, and off they go to the latest round of the visual programming game. It never works.

To be fair about this, people who know vast amounts about language design have also spent - and still spend - a lot of time being worked up about the fact that (most) source code is plain text.

I don't mean that most working programmers spend any time being worked up about this, but a lot of very smart people have been convinced that there are better representations for code than a concrete syntax rendered in characters stashed in text files. Quite a few historically important languages and environments have done things rather differently.
posted by brennen at 11:00 AM on June 19, 2012 [2 favorites]


tylerkaraszewski: “I don't know why people insist on re-inventing these things every few years. Nobody who actually needs or wants to program anything ever finds them more usable than just typing. Nobody ever creates a visual essay builder.”


Mars Saxman: “Indeed. Every few years someone who doesn't know very much about language design gets all worked up about the fact that source code is plain text, and has been plain text since the dawn of time, and becomes convinced that somehow we should be able to use our modern fancy video screens to display something ever so much better than old fashioned plain text, and off they go to the latest round of the visual programming game. It never works.”

Geez, why the hate? This is an interesting way to play with programming language. It has no pretensions to being the next language for writing enterprise applications or anything like that. Do people really not know that programming can actually be fun and interesting in itself?

And, in Blocky's defense, it does look a bit less uselessly verbose than Java.
posted by koeselitz at 11:00 AM on June 19, 2012 [3 favorites]


...there are better representations for code than a concrete syntax rendered in characters stashed in text files. Quite a few historically important languages and environments have done things rather differently.

I bet blockly code is stored as text files. It just isn't rendered that way.

I'd enjoy a link to descriptions of these "quite a few" languages that weren't/aren't.
posted by DU at 11:02 AM on June 19, 2012 [3 favorites]


I'm still mildly horrified that LabVIEW is actually used in the real-world.

I mean, the general concept of a visual language is nice, but a little code never hurt anyone.

Things like MAX/MSP, and the sadly-neglected Yahoo Pipes seem to make more sense, though. They're great for "workflow-based" tasks that specifically depend on one process feeding into another.

However, adding any sort of of control logic to a visual program tends to turn things into spaghetti code. Nest a few loops and conditionals, and I'd imagine that a blockly program would end up being more confusing than a text-based source file.

Still, nice way to get kids into programming. We don't really have many "starter-level" languages anymore that are readily accessible.
posted by schmod at 11:07 AM on June 19, 2012 [2 favorites]


DU: "I don't think anyone is going to write an OS with these. But they are great for kids."

Yep. My girlfriend's son really loves programming with scratch and it seems like a good first step to something more.
posted by brundlefly at 11:07 AM on June 19, 2012 [2 favorites]


Nobody who actually needs or wants to program anything ever finds them more usable than just typing

You've obviously never seen properly outsourced code. I thought I was looking at the work of a John Nash-type genius until someone leaned over and said, "Nah, that's the drag and drop in Visual Studio."

THIS POST WAS GENERATED BY A TOOL
posted by yerfatma at 11:08 AM on June 19, 2012 [7 favorites]


So is there a count-down timer before this dies/goes away to a silent death, like Go (the programming language) ?
posted by k5.user at 11:09 AM on June 19, 2012


If it's really from Google, then it seems like it's not worth paying much attention to, because Google pulls the plug on small projects like this one pretty regularly.
posted by grouse at 11:12 AM on June 19, 2012 [2 favorites]


If Tony Stark can build revolutionary next-gen tech simply by waving his hand around, I don't see why visual programming can't work.
posted by kmz at 11:13 AM on June 19, 2012 [4 favorites]


They can ignore matching braces, using semi-colons and other syntax errors and just focus on fixing their many logic bugs.

At the risk of sounding like a cranky old guy, I would suggest understanding why matching braces and semicolons are important is crucial for understanding programming.

Internalizing the fact that the computer is a dumb piece of machinery that can be made to do smart things and not your magical technology friend is the first step on the path to enlightenment.
posted by Dr Dracator at 11:15 AM on June 19, 2012 [7 favorites]


It's all bollocks. Use KidsRuby or Lua or something.
posted by GallonOfAlan at 11:20 AM on June 19, 2012


Internalizing the fact that the computer is a dumb piece of machinery that can be made to do smart things and not your magical technology friend is the first step on the path to enlightenment.

I don't think you can have read all the way to the end of my sentence. Or maybe you just failed to internalize it.
posted by DU at 11:22 AM on June 19, 2012


AppleDylan is about as visual as I want the actual code editing to be, but I definitely appreciate more visual approaches in other areas, like Core Data modeller and Interface Builder (both also Apple).

Actually, I like Automator for quick n' dirty, especially compared to trying to remember AppleScript.
posted by fightorflight at 11:23 AM on June 19, 2012 [1 favorite]


I don't think there's anything wrong with making accessible, fun, toy languages. All the "this is useless in the real world" complaints seem a little misguided to me. It's like berating lego for not having the flexibility of clay modelling, or training wheels on a bike for aerodynamic inefficiency.

If it gets kids, or anyone else who's curious, into programming, it's a good thing.
posted by Jon Mitchell at 11:25 AM on June 19, 2012 [9 favorites]


I assume all of you who are pooh-poohing this also look down on those who build model rockets or RC cars.
posted by benito.strauss at 11:29 AM on June 19, 2012 [1 favorite]


You assume wrong, friend-o.
posted by GallonOfAlan at 11:30 AM on June 19, 2012 [2 favorites]


I was inspired to learn about programming by science fiction, so I guess I did want the computer to be my "magical technology friend" at some point. Kind of amazing how well I adapted to the reality, which is that computers are best viewed as formal systems, and formal systems are best represented textually. It might be interesting to have a programming notation more like mathematics. APL is an early example, but maybe something more general would be good.
posted by Jestocost at 11:30 AM on June 19, 2012


I'm glad to see the Blockly guys are paying tribute to Scratch, as is that Wired article. Scratch is a really neat project. Not just because it's a graphical programming language, but because it's designed really nicely for kids to build things and share them. They've got over 2 million projects in the database now, code you (or your kids) can start with and then tinker and modify. Really useful as a pedagogical tool.
posted by Nelson at 11:31 AM on June 19, 2012 [1 favorite]


Mars Saxman: "It never works."

I consider myself a relatively competent programmer, but I'm also a fairly visual person. Sometimes a single ER diagram can be a much more effective introduction to an unfamiliar data model than a few hundred CREATE TABLEs spread over dozens of files.

I don't think that visual tools will ever replace text as a primary programming interface, but there is room for good tools that complement and support textual syntax. I like that people are thinking of ways to do that better.
posted by vanar sena at 11:31 AM on June 19, 2012 [2 favorites]


OK, well I thought this was cool when I first looked at it and it definitely fulfills a need, namely, getting beginners interested in programming.

Problem is, that need is already covered. It's called LEGO Mindstorms, and with LEGO you get to see your programs interact directly with the real world through the proxy of your own physical creations. Also there's LEGO.

It's interesting, like all the other attempts to make this idea. But it's not LEGO.
posted by Algebra at 11:32 AM on June 19, 2012 [1 favorite]


The programming for the russian space program was done in a visual programming language DRAKON.
posted by Ad hominem at 11:32 AM on June 19, 2012 [3 favorites]


k5.user: "So is there a count-down timer before this dies/goes away to a silent death, like Go (the programming language) ?"

Go went away?

As far as I'm aware, it's still getting some pretty major attention in academic circles, and only reached version 1 back in March. It's gonna be a while until we see it used in a major project, but that's kind of the nature of the game.

I think Google are already using it internally. It looks like a very nice language that actually might make us start writing more low-level code again.
posted by schmod at 11:33 AM on June 19, 2012 [2 favorites]


Start your kid right, with EMACS.
posted by hellojed at 11:33 AM on June 19, 2012 [8 favorites]


I'm still mildly horrified that LabVIEW is actually used in the real-world.
posted by schmod at 11:07 AM on June 19 [1 favorite +] [!]


Considering how difficult even making LabView work properly in the test and measurement world is, it's hardly surprising that one of the only other mainstream ways to do test automation is using Measurement Studio (also from National Instruments).

Now that stuff like SciPy, NumPy and python based instrument control libraries like pyVISA are available I'm starting to switch for some applications but LabView and MATLAB were (and still mostly are) my bread and butter. T&M interfacing and control is finikey enough on a good day with manufacturer written and supported libraries for NI products.
posted by Dr. Twist at 11:33 AM on June 19, 2012 [1 favorite]


Geez, why the hate?

oh, probably just a knee-jerk response learned from perennial breathless articles about the obsolescence of text. I find it easy to understand how one comes by such a knee-jerk response, though it does seem unwarranted in this case.
posted by Zed at 11:38 AM on June 19, 2012


Geez, why the hate?

I've been watching these things come and go for a quarter of a century now. They promise much and deliver little. The people promoting them seem to suffer from a fundamental misunderstanding of what programming actually is. I have never met anyone who learned to program using such a tool, nor heard of anyone who played with one and went on to learn real programming. They are built for the amusement of their creators and not because they actually solve a real problem.

It's like teaching a kid to write by handing them a plastic typewriter with six big colorful buttons labelled "A" through "F". In a technical sense, you might be helping them practice one of the minor, preliminary skills at the very beginnning of the path to the craft of writing, but it is so limited that a beginner won't be able to do anything interesting with it. An expert writer might have enough experience and insight to be able to do something useful with such a limited tool, but a beginner will never make it through the tedium.

It's the sense of possibility, after all, that hooks people: the sense of a grand vista opening up, the realization that you are at the cusp of being able to do something new and amazing.

You don't hand a toddler a plastic hammer because you want them to learn carpentry; you hand them a plastic hammer because they live in a world of action and imagination, and their hungry little brains need things to play with so they can figure out how their bodies work. When the kid grows up and actually wants to build a set of shelves, you pick out the basic saw and hammer and show them how to cut boards and nail them back together. You don't give them the fischer-price plastic saw; you give them a real saw, and show them how to use it. Once they're done, hey, wow, look at that - I can cut a board to length, and look at this thing I made! It's a real thing! A little of that and off they go.

Visual languages are always toys, because people doing real work don't need or want the graphical fluff, and toy languages do not create interest in programming. Rather, people get hooked on programming when they discover that they can make useful things.

If you want to teach someone to program, you don't hand them a brightly colored nerf language and say "See, this is how programming works" - you find out what they actually want to do, then you show them a tool that will let them do that, walk them through enough of it so that they can see their way to the end, then step back and let them have that "Wow" moment where the tool they've built does something useful.
posted by Mars Saxman at 11:39 AM on June 19, 2012 [10 favorites]


It's interesting, like all the other attempts to make this idea. But it's not LEGO.

Right, why give them a free programming language when they can merely spend $250 to buy a less-powerful one!

(Maybe they've changed it since the original Mindstorms, but it used to not even be Turing-complete.)
posted by DU at 11:39 AM on June 19, 2012


I have never met anyone who learned to program using such a tool, nor heard of anyone who played with one and went on to learn real programming.

Here you go
posted by DU at 11:40 AM on June 19, 2012 [1 favorite]


ok, fair point, I shouldn't have included that line, because now we're locked in the battle of the anecdotes.
posted by Mars Saxman at 11:41 AM on June 19, 2012


Geez, why the hate?

MetaFilter.
posted by Foosnark at 11:44 AM on June 19, 2012 [12 favorites]


now we're locked in the battle of the anecdotes.

Never go into a battle of anecdotes when death is on the line.
posted by kmz at 11:47 AM on June 19, 2012 [4 favorites]


I hate terrible tools (and GUIs) as much as the next crusty Linux programmer, but we are talking about kids.

My kid went from using Scratch directly to writing text code in an editor and running it in a terminal. It's a stepping stone. A way to gauge interest (on the part of both student and teacher).
posted by DU at 11:49 AM on June 19, 2012 [1 favorite]


Having worked on a "toy" programming language, I can say without a doubt that people do move on to "real" programming, and if you think a six-year-old can create their own video game in Python (or whatever) in the same time-frame they can in a visually-oriented system, you're crazy.

The system I worked on was Stagecast Creator. Here's a comment by an educator:

"In our learning environment, we use lots of programming software for children: Stagecast, Scratch, AgentSheets, NetLogo, Starlogo TNG, Etoys, and so on. None of the others are equal to Stagecast in allowing children so young to develop their programming skills."
-- Nilton Lessa, Moleque de Idéias Educação e Tecnologia Ltda, Brazil
posted by CheeseDigestsAll at 11:54 AM on June 19, 2012


It's like teaching a kid to write by handing them a plastic typewriter with six big colorful buttons labelled "A" through "F".

What are you, some kind of A BAD FEE FADE or something?
posted by OverlappingElvis at 11:56 AM on June 19, 2012 [6 favorites]


It is in fact "from Google", see the copyright line at the top of the source: "Copyright 2011 Google Inc."

Some non-programming friends of mine had a fun time with the maze demo, and there was a decently long thread with folks figuring out what worked and the tradeoffs between a more concise program and a longer one that found a more efficient path. I hacked up a version with autogenerated mazes to make things more interesting.
posted by lantius at 12:01 PM on June 19, 2012 [2 favorites]


Internalizing the fact that the computer is a dumb piece of machinery that can be made to do smart things and not your magical technology friend is the first step on the path to enlightenment.

Richard continued, "What I mean is that if you really want to understand something, the best way is to try and explain it to someone else. That forces you to sort it out in your mind. And the more slow and dim-witted your pupil, the more you have to break things down into more and more simple ideas. And that's really the essence of programming. By the time you've sorted out a complicated idea into little steps that even a stupid machine can deal with, you've learned something about it yourself."
posted by Isn't in each artist (7) at 12:07 PM on June 19, 2012 [7 favorites]


This did the rounds on Twitter a while back - it was really fun watching people who don't usually program or program much taking on the maze puzzle. Fun stuff.
posted by Artw at 12:11 PM on June 19, 2012


I'm actually a big proponent of visual coding techniques, as I find it dubious that ASCII line noise is state-of-the-art - but this is a pretty poor showing. Too close to traditional coding in structure, and without the benefit of a clear view of the shape of your code - it's flow and its structures. OK for teaching neophytes how a program works, and an obvious gateway drug for python, tho.
posted by Slap*Happy at 12:11 PM on June 19, 2012


lantius: If you want to release stuff into the wild & you work at Google, I'm told it's a whole lot quicker to just transfer ownership to them & have Google release it into the wild rather than go through the process of getting it cleared by the relevant internal committees, which will happen eventually, it's just that the process takes a month or two IIRC. If you just want to open source your code, why not take the quick route?
posted by pharm at 12:13 PM on June 19, 2012


Heh. First time someone told me about Phython's use of tabs for structure I was all whaaaaaaa-?

Still am, TBH. That just seems wrong.

/wraps self in protective curly braces.
posted by Artw at 12:14 PM on June 19, 2012 [3 favorites]


Scratch is an amazing project for introducing kids to code. Making an html 5 version of the scratch editor is totally fine in my book.

Just because it can't be used for real programming, doesn't mean it shouldn't exist, and people should stop doing things like it.
posted by jonbro at 12:16 PM on June 19, 2012


Also, regarding visual essay builder, does twine count?

Twine lets you organize your story graphically with a map that you can re-arrange as you work. Links automatically appear on the map as you add them to your passages, and passages with broken links are apparent at a glance.
posted by jonbro at 12:18 PM on June 19, 2012


One of my big failures from the other end of the spectrum was building a course that tried to teaching designers OOP using C++. It was a disaster all around and probably would have been just as effective had we started with something the learners already had contract with professionally in drag-and-drop form: ECMAScript.

Sure, pedagogical teaching languages and environments are not going to satisfy "serious" programmers. But I think they can help a bit with first steps.

And I'm having a blast with programming as a hobby now that I've gone back to the basics in a pedagogical and useless language. It forces me to actually think and work through the algorithms and their implementation instead of combing the Web for a library.
posted by CBrachyrhynchos at 12:18 PM on June 19, 2012


Internalizing the fact that the computer is a dumb piece of machinery that can be made to do smart things and not your magical technology friend is the first step on the path to enlightenment.

Richard continued, "What I mean is that if you really want to understand something, the best way is to try and explain it to someone else. That forces you to sort it out in your mind. And the more slow and dim-witted your pupil, the more you have to break things down into more and more simple ideas. And that's really the essence of programming. By the time you've sorted out a complicated idea into little steps that even a stupid machine can deal with, you've learned something about it yourself."


That's a nice quotation, but semicolons and matching braces have nothing to do with understanding what you're trying to program. They are a complete waste of human energy for the sake of accommodating old programming languages. It should be the other way around: the computer language should be close to the human's way of intuitively perceiving the problem. The compiler should be smart enough to sort out the stupid details — besides semicolons and matching braces, it should also figure out most static types, whether to pass by value or reference, object memory layouts, etc.
posted by esprit de l'escalier at 12:39 PM on June 19, 2012


and off they go to the latest round of the visual programming game. It never works.
Max is a visual programming language for music and multimedia developed and maintained by San Francisco-based software company Cycling '74. During its 20-year history, it has been widely used by composers, performers, software designers, researchers, and artists for creating innovative recordings, performances, and installations.
posted by LogicalDash at 12:42 PM on June 19, 2012 [2 favorites]


I've done a fair bit of puttering around in Game Maker. Game Maker has its limitations, but it also allows you to do interesting game-related things quickly.

GM has a large number of "drag and drop" actions you can string together to give objects behaviors, and yet I've never found those to be even slightly useful compared to just putting attaching a script to the thing. The first thing I do whenever I create a new GM "object" is create scripts to handle all the events I'll need. The drag-and-drop events are all stupid things like "increase this variable by X" or "reverse velocity" or some such, they're all things that would be better represented by plain text, yet hidden behind such an obtrusive and annoying development system that I can't imagine how anyone uses it to make a game more complicated than Pong. Yet to code using text scripts, you have to use the drag-and-drop editor to create a "custom script" action for each event, which is laborious.

I personally don't think that plain text will forever be the only way to program something usefully, I think there is definitely room for visual editors for actually constructing programs as opposed to just interfaces, but to work those systems will have to offer something beyond simple, useful plain text files.

Not to mention that plain text files have the advantage of not being proprietary. Visual development systems will probably store their code in a binary format that would be murder to take to another system, and may not even translate well to later versions of the same product.

I like that graphic systems have the potential to greatly reduce the number of stupid little syntax errors that I make for example, and having code that's composed of premade pieces could greatly assist automatic code completion systems in understanding what you're likely to enter next. And a lot of time I spend coding is actually spent going to websites or PDFs and looking up function documentation -- having that available in the IDE to a degree beyond simple code completion and doc string lookups could be really valuable. (Now someone will write a message saying that Visual Studio already does that, and also has a button that causes a CGI clown to come down and write my program for me.)

if you think a six-year-old can create their own video game in Python (or whatever) in the same time-frame they can in a visually-oriented system, you're crazy.

But that's not the fault of Python, a general-purpose language, so much as the libraries and assumptions made by the visually-oriented game development system. It would be much more annoying to use such a system if you had to use code blocks to load graphic resources off the disk, create surfaces out of them, arrange them into an array for easy access by the tile engine -- oh, and also write a tile engine.

Go went away?

It's important to note that it takes several years for a good programming language to emerge to the point where a variety of people people really get to using it. Ruby was created in 1995, and Python in 1991.
posted by JHarris at 12:42 PM on June 19, 2012 [1 favorite]


I think Google are already using it internally. It looks like a very nice language that actually might make us start writing more low-level code again.

What do you like about it?
posted by esprit de l'escalier at 12:43 PM on June 19, 2012


tylerkaraszewski: "I don't know why people insist on re-inventing these things every few years. Nobody who actually needs or wants to program anything ever finds them more usable than just typing. Nobody ever creates a visual essay builder."

Imagine you use a webmail client like Zimbra or Gmail. Now imagine how fun it is to use their webapp to write mail processing scripts, while still not allowing general scripting langauges to run. I'll take this over the status quo any day.
posted by pwnguin at 1:07 PM on June 19, 2012


That's a nice quotation, but semicolons and matching braces have nothing to do with understanding what you're trying to program. They are a complete waste of human energy for the sake of accommodating old programming languages.

this is why for years at berkeley and MIT they used Scheme to teach the introductory programming courses. of course we all know what LISP actually stands for so it's not *totally* free of nuisance. but as they say, it gets all the "syntactic sugar" out of the way so you can focus on the core of what programming is.*

* of course, at berkeley and MIT, what programming actually is is a gateway drug to wearing birkenstocks and having a day's worth of rations unwittingly stowed in your stallman-like beard.
posted by joeblough at 1:12 PM on June 19, 2012 [3 favorites]


First time someone told me about Phython's use of tabs for structure I was all whaaaaaaa-? Still am, TBH. That just seems wrong.

After four years of writing mixed C/ASM, then wrestling for a few years with sed/awk and PERL, encountering python was revelatory.

I get impatient with other languages now. Life is too short, you know?
posted by bonehead at 1:23 PM on June 19, 2012 [5 favorites]


Heh. First time someone told me about Phython's use of tabs for structure I was all whaaaaaaa-?

yes, it does seem wrong.... and yet every company I've worked for in a decade at least has had rules about the way C and C++ source code must be indented, and at some places you can't check code in until you get the indentation right. In practice, then, C++ uses indentation for structure - the error checking just happens a lot later down the pipeline.

<nitpick>python doesn't use tabs for structure: it uses indentations. you can create those indentations in any way that suits your coding style.</nitpick>
posted by Mars Saxman at 1:29 PM on June 19, 2012 [1 favorite]


I'll admit a small bit of fun was had by writing a terse maze walker that can solve any maze given the paucity of commands/controls. These kinds of "coding" interfaces are nice for small and well defined problem areas but quickly fall to pieces when trying to do something more general (or that needs to be maintained my humans).
posted by Fezboy! at 1:44 PM on June 19, 2012 [1 favorite]


Where 'my' == 'by'. Hands off my humans!
posted by Fezboy! at 1:45 PM on June 19, 2012


Matlab Simulink is a very useful graphical environment, even for experienced programmers. Expensive, though.
posted by Ella Fynoe at 1:51 PM on June 19, 2012


DU: I bet blockly code is stored as text files.

From what I can see (and I will preface that saying that I put on my "quickly evaluate an api" glasses and scanned through the code in 5 minutes looking for pain points), there is no storage format, FYI. Part of that appears to be because that the language is represented as the typical tree-ish structures and the code generators are just visitors of the program graph.

XML is one possible representation of this and appears to be what was maybe used as a bootstrap format (it's what I'd do), but there's no reason for blockly code to be any other reasonably serializable format.

And I don't mean to post this in a "someone on the internet is wrong!" kind of way. I thought it was an interesting assumption and thought it reasonable enough to give it a look.

As far as I'm concerned, what needs to be addressed better in programming environments is not visual code so much as searchable and navigable code. I don't particularly care about the layout of the code if I can find my way around it better. For example, it would be cool if methods that I invoke in any particular method get brought physically closer in the view if they are more important (used several times, used in a loop, used it an if-test that is more likely to succeed, whatever). At least I think it would be cool, because I do this any way by moving private implementation methods within a class to be closer to where they are logically used or grouped so I can flick scroll to them.

In my current project, the total lines of code is only39,000 lines and as I was tracking down a bug in code that I wrote 5 months ago, I totally recognized the code as mine and my style, but I couldn't remember writing it (then again, I was writing between 800 and 2000 lines of code per day when I wrote that particular block, so it doesn't surprise me that I don't remember writing it.

My whole code base should be incrementally indexed as I write it. VisualStudio does this to a certain extent with C# and intellisense is a god send, but it has room for improvement. Eclipse doesn't do this quite as well, but its error recovery suggestions are pretty good.

I always liked the approach that Lightspeed Pascal took, which was tokenize and parse as you type so there didn't have to be a "text" representation of the code that needed to be re-parsed in its entirety every time you made a one character change. Ultimately your code is going to be a list or a tree of nodes that is operated upon and they made an interesting choice in breaking out of the traditional batch scan->tokenize->parse->code generate pipeline.

Well, if not a text file, then what? Why are we stuck in the "code is text" paradigm? Are we even stuck? Maybe it comes from the desire to be able to do traditional processes: automated builds, make, etc. Maybe part of it is from using code to write code. I don't know, really, but any of these things could be managed by using a serializable data format and a decent API for constructing, visiting and manipulating code. .NET nearly has that facility by having decent access to code generation tools, but they're all pretty low level - it's like writing a program whose output is an assembly language program. Sucks to be you.

blah, blah tl;dr: it's a tree - what should we do with tree languages before shackling them to a text format?
posted by plinth at 2:01 PM on June 19, 2012 [3 favorites]


python doesn't use tabs for structure: it uses indentations. you can create those indentations in any way that suits your coding style.

DEATH TO THE SPACE INDENTORS!
posted by Artw at 2:15 PM on June 19, 2012 [4 favorites]


NON-PRINTING CHARACTERS HAVE NO PLACE IN A SOURCE CODE FILE!
posted by Jestocost at 2:18 PM on June 19, 2012 [1 favorite]


I think Google are already using it internally. It looks like a very nice language that actually might make us start writing more low-level code again.

Now, if only they let you put an opening { on a new line.
posted by fleacircus at 2:20 PM on June 19, 2012


DU: “I bet blockly code is stored as text files. It just isn't rendered that way. I'd enjoy a link to descriptions of these ‘quite a few’ languages that weren't/aren't.”

Not to be snarky, but there are actually very few programming languages that store code as text files; and the ones that do are generally known for being inefficient. And it's worth remembering that there was a time when people thought even writing code as text files was a stupid thing that nobody would ever want to do since you'd have to drop down to machine code to debug anyway.
posted by koeselitz at 2:22 PM on June 19, 2012


It's like teaching a kid to write by handing them a plastic typewriter with six big colorful buttons labelled "A" through "F".

A FAD? BEEF!
posted by zippy at 2:27 PM on June 19, 2012 [2 favorites]


And numbers. Otherwise how is the kid going to learn to count to F?
posted by Artw at 2:44 PM on June 19, 2012 [4 favorites]


I've been watching these things come and go for a quarter of a century now. They promise much and deliver little. The people promoting them seem to suffer from a fundamental misunderstanding of what programming actually is. I have never met anyone who learned to program using such a tool, nor heard of anyone who played with one and went on to learn real programming. They are built for the amusement of their creators and not because they actually solve a real problem.

I'm not a programmer. I do not want to be a programmer. Nevertheless, I do sometimes need to code up scripts in perl/python/ruby/vbasic to save time -- maybe 5 or 6 times a year. Every time I do it, I have to relearn all the little syntax quirks of the language -- like literally, how to do for-next loops and so on. It would be nice if I had a visual app that worked basically like pseudo-code that could generate working code in whichever language i needed to work in. It doesn't need to be optimized, or bug-free or maintainable. Usually it's for a one off project that I'll never have to touch again.
posted by empath at 2:46 PM on June 19, 2012 [3 favorites]


NET nearly has that facility by having decent access to code generation tools, but they're all pretty low level

.NET has always had emit in the reflection namespace, you are right, it was kind of fiddly. You should check out Roslyn CTP it allows you to do stuff like traverse the syntax tree and Syntax transformations
posted by Ad hominem at 2:46 PM on June 19, 2012


So this is pretty cool. I have always held programming in high regard, but also thought that it was something I could never do. It seems so alien to me. I struggle with foreign languages, and struggle with maths, and programming seemed a hellish mix of the two.

However, I tried out Blockly, and spent half an hour getting my figure to complete a maze without resorting to infantile steps like "Left-forward-right-forward-forward-forward etc etc". It's given me a little understanding about how things work, and it's given me the inspiration to now look up some basic programming stuff, and just try things out. (Q: Best resources for learning very very basic programming?)

This was a great first step (of many, hopefully).
posted by Petrot at 2:49 PM on June 19, 2012 [3 favorites]


I like this as part of the notion "Let a hundred flowers blossom and a hundred schools of thought contend." Much as I liked TRS-80 BASIC because (despite the evil GOTO) they enabled millions of young minds to see that programming could be FUN rather than overly-verbose academic exercises in what PL SHOULD be. Much as I liked LOGO because it -enabled-.

To see 10-minute code WORK is much more satisfying than having 2-hour code rubber-stamped PROPER, NIHIL OBSTAT, IMPRIMATUR by overweening theoreticians. OOP freed noone from bugs, it just turned simple achievement into an endless typing orgy ... and banished transparency to protect turf and lovers of obfuscation.

The economy of PRINT "Hello World!" is a thing of beauty. And enabling. If dragging a few icons around encourages more experiments, fantastic. Because -all- PLs still have a long way to go before -any- of them can be taken seriously. We are still in the early days ... and our bugs tell us that every day.
posted by Twang at 2:49 PM on June 19, 2012 [4 favorites]


Hey, this looks suspiciously like the Google/Android App Inventor that had it's plugs pulled out a few months ago.
posted by loquacious at 3:00 PM on June 19, 2012


But they are great for kids. They can ignore matching braces, using semi-colons and other syntax errors and just focus on fixing their many logic bugs.

I just started digging into Ruby, and the simplicity of the syntax makes it really good for kids on the command line. I am looking forward to teaching my kids that puts "hello kids!" is all it takes to make a computer talk back to them.
posted by davejay at 3:04 PM on June 19, 2012


There are graphical tools that enhance developer productivity in specialized domains. For example, I found SDL makes it a lot easier to program telecom switches. Similarly, there are many tools that can help you throw together a simple database CRUD application with a few clicks.

The trick seems to be to find the right high-level abstractions. I guess we haven't found them yet for generic programming, outside specific domains.
posted by Triplanetary at 3:04 PM on June 19, 2012



if language.too_simple?
puts 'haters gonna hate'
end

posted by davejay at 3:09 PM on June 19, 2012 [2 favorites]


I am looking forward to teaching my kids that puts "hello kids!" is all it takes to make a computer talk back to them.

I think you need at least Eliza for that.
posted by Jestocost at 3:12 PM on June 19, 2012


Actually, what I need to do is put each kid on a different computer, and have them type words into an IM window thinking they're programming, and see if either can figure out it isn't a computer on the other end.
posted by davejay at 3:16 PM on June 19, 2012 [3 favorites]


Let's see how well it handles a diff.
posted by humanfont at 5:03 PM on June 19, 2012


Seems like it would be useful for kids. I don't know why people are so butthurt about it. Avoiding minor syntax errors was definitely the most difficult part of programming when I was first learning (at age 12 or so), especially without real-time compiling in the background. That obviously makes it much easier.

I think visual models could potentially make things easier for kids and people just starting out. It could also potentially make things easier for people who aren't smart enough for 'real' plain-text code.
Not to be snarky, but there are actually very few programming languages that store code as text files; and the ones that do are generally known for being inefficient. And it's worth remembering that there was a time when people thought even writing code as text files was a stupid thing that nobody would ever want to do since you'd have to drop down to machine code to debug anyway.
Huh? Source code is still code. That's why it's called source code. And it's almost always plain text. In fact, I would bet most of these graphical languages use some kind of plain-text storage system as well (XML at least), rather then something binary.
posted by delmoi at 7:22 PM on June 19, 2012 [1 favorite]


I'm always a little shocked when I see programmers react with outrage to tools like this. No one is trying to take away your copy of vim. No one is suggesting that this tool is better than gcc, and should be used to build kernel extensions.

Many of today's experienced devs have fond memories of tinkering with LOGO and turtle graphics as kids; yet, those are terrible tools for building 3D first person shooters. Why would ANYONE ever use them?
posted by verb at 7:50 PM on June 19, 2012 [1 favorite]


Not to be snarky, but there are actually very few programming languages that store code as text files; and the ones that do are generally known for being inefficient.

The vast majority of working software in the world, whether compiled or interpreted, is written by people working with text files or their very, very near equivalent, and has been for pretty much as long as I've been alive, I think. If you mean that compiled languages produce executable binaries of one sort or another, sure, but that doesn't seem like it has much bearing.

If by "the ones that do", you mean interpreted (or compiled-at-runtime, semi-compiled-at-runtime, whatever) languages like shell, Perl, Python, PHP, Ruby, TCL, old-school BASIC, JavaScript, et al., these certainly tend to be more resource-intensive, but they also represent one of the dominant models of software development and deployment for at least the last couple of decades. Unix systems thrive on the stuff, as does the vast bulk of the web, which would never have evolved as it did without Perl CGI and all of its eventual descendants.

I mean, "generally known for being inefficient" is true in a specific technical sense, but [name your language here] is as likely to be embraced for its efficiencies in programmer time/happiness/expressiveness/safety relative to something like C as it is to be disdained for the overhead of firing up an interpreter, even to the extent that people setting up production web systems jump through all sorts of hoops to do things like cache compiled bytecode and keep interpreter processes running.
posted by brennen at 7:56 PM on June 19, 2012 [4 favorites]


I'm always a little shocked when I see programmers react with outrage to tools like this. No one is trying to take away your copy of vim. No one is suggesting that this tool is better than gcc, and should be used to build kernel extensions.

I think people who have been around a while have heard a lot of pretty foolish noise about how point-and-click drag-and-drop stuff will obviate the need for people to program in the traditional sense, or what have you, and so they aren't inclined to pay much attention to useful counterexamples. I kind of get this. Most "graphical programming environments" really are not just toys, but pretty bad toys. Programmers tend, both by temperament and a surfeit of bitter experience, to be a profoundly opinionated lot, and personal experience can be blinding.

I also think there are counterexamples, but I've had some good personal experiences. HyperCard, for example, is one of the reasons I'm a programmer today.
posted by brennen at 8:04 PM on June 19, 2012 [1 favorite]


Most of those have a UI element with a more traditional coding element behind, though. HyperCard scripting is regular text not some flowcharty thing.

(Also never trust any HTML generated by a WYSIWYG tool. And double never trust any HTML generated by a Microsoft application. Less of a problem now Razor is replacing Webforms I guess.)
posted by Artw at 8:40 PM on June 19, 2012


For more interesting and practical approaches to code editing, see the Light Table concept, which is now apparently on Kickstarter. It's a genuinely new and interesting way to visualize and organize code in a GUI, while keeping the code itself as textual as ever.
posted by Joakim Ziegler at 10:03 PM on June 19, 2012


hellojed: "Start your kid right, with EMACS."

Child abuse!!
posted by barnacles at 10:18 PM on June 19, 2012 [1 favorite]


Hey, this looks suspiciously like the Google/Android App Inventor that had it's plugs pulled out a few months ago.

It's a replacement for the editor part of App Inventor. App Inventor is alive and well at MIT. App Inventor was developed by someone on a sabbatical form MIT to Google. He had originally worked on Scratch, it appears, from an article linked above he basically took it back to him when he returned to MIT. App Inventor is being used, by grown ups, to do real things, despite the nay sayers upthread.

I love Scratch. I sat down with my 7/8 year old nephew and introduced to Scratch, teaching him using the Socratic method. At the end of 3 hours we had a working, mult-level, palyable interactive game. He figured how he could do basic collision detection all by him self. If I had been trying to teach him a text based language it would have been maybe half an hour of him getting frustrated with the keyboard before he ran off and did something else. The fast feedback loop works wonders.

Lego Mindstorms not so much. I taught an after school class to some middle schoolers using it and it was largely an exercise in frustration. The language was awkward, limited and it took far to long to get any real usable results. Some kids managed ok, the studious, motivated ones, others less so. It was a very diverse, low income intake and and a bunch of the kids were there because their parents weren't around at home to take them in and they were understandably frustrated by how long it took to do anything, preferring just to build stuff with Lego instead.

One of the great things about Scratch is you can throw some blocks together, really quickly, and get it to produce a whole lot of annoying noises without having to think about programming it. Once you have done this, and got the attention, iyou can extend it to get it to make different sounds in response to different things and by then you have boot strapped the whole process. It's easy to teach motivated kids, not so easy to produce the motivation in the first place.
posted by tallus at 11:19 PM on June 19, 2012 [1 favorite]


Like DU, verb, Twang and others said above, language environments like these are great learning playgrounds.

Robot Odyssey and Rocky's Boots changed my life forever as a kid. LOGO, Lego's Mindstorms, Squeak and all of these mere toys are putting tools into the hands of children to give them the power of creation.

Seymour Papert, Alan Kay and Warren Robinett are personal heroes, right alongside Sagan and Jane Goodall.


It will be interesting to see how NLP technologies like Siri change this. I realize Siri isn't the most advanced tech, but it is the most known at this point. Describing programs in spoken language but seeing them appear in graphical form would be a great hybrid.
posted by formless at 11:31 PM on June 19, 2012


Anyone else get a seriosuly Logoish vibe when messing about with CANVAS stuff?
posted by Artw at 11:33 PM on June 19, 2012


Anyone else get a seriosuly Logoish vibe when messing about with CANVAS stuff?

It reminds me not a little of my first experiences hacking together crappy little graphics demos and games in QBasic. Which is by no means a bad thing.
posted by brennen at 8:22 AM on June 20, 2012 [1 favorite]


Describing programs in spoken language but seeing them appear in graphical form would be a great hybrid.

I really like the cool factor of that idea, but it sounds nightmarish for stuff much more structured than one-off command-line interaction. Literally mimicking natural language hasn't (in general - I know that possible exceptions like Inform 7 exist) shown itself to be a very good interface for constructing programs, and any speech interface I can imagine would be a pretty clunky way to edit even a very simple program.
posted by brennen at 9:17 AM on June 20, 2012


Do any visual block editors like these write out javascript? Just like a visual designer can be a good jumping off point for coding HTML, it seems like visual logic programming is a good jumping off point for coding javascript. A weakness in a lot of these systems is that they don't include a graduation path...
posted by efbrazil at 10:14 AM on June 20, 2012


« Older I award you no points, and may God have mercy on...   |   4.5 Hours and 244 layers later Newer »


This thread has been archived and is closed to new comments



Post