This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Lyqyd's profile picture

Thoughts on Drag & Drop Coding

Started by Lyqyd, 18 September 2017 - 11:56 PM
Lyqyd #1
Posted 19 September 2017 - 01:56 AM
To anyone stumbling across this thread, it's a bit of a mess. It originated from a thread in Ask a Pro, and then someone took it upon themselves to make a poll rather than waiting for the moderation team to split the thread out. So, quoted in this post are the original post that started the thread, as well as the first post in the subsequent poll topic (the poll in this thread was preserved from that thread). All posts following this post are simply moved into it from the original Ask a Pro thread, and then discussion continues from there. If this gets too contentious, I'll lock it.

Here's the original post that started the discussion in the Ask a Pro topic:

If you install CCEdu, it comes with programmable turtles that use a codebloks like system for programming the turtles. Now, i know that isnt exactly what you wanted, but its the closest we have right now.

Ah yes, that's the closest to Scratch you can get (programming a turtle to do something).

Code-block programming is a bit frustrating because it doesn't really teach you to program, it teaches you how to use someone else's programs that are made for you..

And here's the first post of the topic from General, which added the poll.

There was a rather interesting discussion on the usefulness of drag and drop coding here, and I thought this discussion should continue in a more appropriate thread.

If you don't know what drag and drop coding is, there are a few examples. What are your thoughts? Do you think they're a good replacement for text programming? Do you think they really help beginners learn how to program, or just muddy the water further? I'd like to hear your thoughts.
KingofGamesYami #2
Posted 19 September 2017 - 04:31 AM
-snip-
Code-block programming is a bit frustrating because it doesn't really teach you to program, it teaches you how to use someone else's programs that are made for you..
I disagree.
This type of programming can actually be very powerful in some situations. It has also been shown to be less intimidating to a younger audience than text based programming.

A great example of visual programming is LabView. It's used in quite a few places, including robotics. One of the best teams in FIRST Robotics Competition controls their robot using LabView, exclusively.

*This isn't exactly a scientific study, and I know that, but it's not terrible.

PS: I personally cannot stand working with visual languages. I do understand their legitimacy though.
Edited on 19 September 2017 - 02:34 AM
Dave-ee Jones #3
Posted 19 September 2017 - 04:48 AM
-snip-
Code-block programming is a bit frustrating because it doesn't really teach you to program, it teaches you how to use someone else's programs that are made for you..
I disagree.
This type of programming can actually be very powerful in some situations. It has also been shown to be less intimidating to a younger audience than text based programming.

I agree that it is less intimidating, therefore easier to get into, but the fact that it's a "wall of random text" isn't the only thing that pushes people towards code-blocks. Code blocks are watered down, easy to understand and are 'dumbified'. I myself started programming with code-blocks in Game Maker, but I found that code was far more powerful and versatile, as the people who programmed those code-blocks only did basic functions and frameworks.

Robotics is indeed the way people go to learn programming these days, and yes, most of it is done in code-blocks (just look at NXT..).
KingofGamesYami #4
Posted 19 September 2017 - 05:01 AM
I dare you to use LabView and find any aspect of it "dumbified". Really. Try it.
Dave-ee Jones #5
Posted 19 September 2017 - 05:15 AM
I dare you to use LabView and find any aspect of it "dumbified". Really. Try it.

And I dare you to try and do what LabView is doing in the background. I'm telling you, it's far more confusing. LabVIEW is a foreground, user friendly program to simplify it for users. 'Dumbifying' it.
Saldor010 #6
Posted 19 September 2017 - 05:26 AM
Personally, I have no problem with drag and drop coding, so long as it stays in introductory programming where it belongs. The real problem I have with drag and drop is that sometimes it will give students the false idea that this is what programming really is (hence, the OP's confusion, no offense OP). While drag and drop does teach you some core concepts of programming, it never tends to go beyond that.

(I have more thoughts on the subject, but I don't have the time to post them just yet)
KingofGamesYami #7
Posted 19 September 2017 - 01:09 PM
And I dare you to try and do what LabView is doing in the background. I'm telling you, it's far more confusing. LabVIEW is a foreground, user friendly program to simplify it for users. 'Dumbifying' it.

I did, last year. Is there any difference between dragging around a little icon that says "set the motor to xx speed" and motor.setSpeed( xx )? No. Not really.

Of course, if I were to try to rewrite WPILib, then I'd be in trouble. But that's released in LabView, C++, and Java, and community ported to C#, Python, and a couple other languages.

Eg this:



Ends up like this: (approximated in Java; library names may vary slightly. Don't care enough to go look it up right now)



Joystick joy = new Joystick(0);
Motor rearLeftMotor = new Motor(1)
Motor rearRightMotor = new Motor(2)
--# etc.
rearRightMotor.setInverted( true )
frontRightMotor.setInverted( true )
DriveSystem drive = new DriveSystem( rearLeftMotor, rearRightMotor, fronLeftMotor, frontRightMotor )
...

I'm not going to bother writing the rest of it out, but this is a fairly simple program. In general 1 line of code -> 1 object.
Dave-ee Jones #8
Posted 20 September 2017 - 12:34 AM
And I dare you to try and do what LabView is doing in the background. I'm telling you, it's far more confusing. LabVIEW is a foreground, user friendly program to simplify it for users. 'Dumbifying' it.
Is there any difference between dragging around a little icon that says "set the motor to xx speed" and motor.setSpeed( xx )? No. Not really.
This type of programming can actually be very powerful in some situations. It has also been shown to be less intimidating to a younger audience than text based programming.

You just made your own point invalid..?

Code is more versatile, you can (in general) do more with it, changing the flow to how you would like. Those drop-down menus, for example, would only show limited options based on what object you need there. In code you could set virtually anything there (may or may not work, depending on how you're doing it).

I agree that code-block programming is easier to understand for beginners, better for visualisation (I mean, it's basically a big flowchart so ofc it's easy to visualise) and is in general great for beginners. But I believe, like Saldor, that it should stay as a beginners-learning tool. It's more for being introduced into programming so you know general program flow and sequence. From there, you can migrate to code where you can incorporate you learnt flow and sequence.

Anyway this has gone from a legitimate question to an argument. There's a time and place for arguments, it ain't here ruining someone else's question. Maaan, never mind.
Edited on 20 September 2017 - 03:38 AM
Lupus590 #9
Posted 20 September 2017 - 11:13 AM
The original Ask a Pro thread did spur me to begin making this.

My intention is for the appearence to be simular to edit, I.E. the code blocks will have lua text in them, so by using the blocks you automatically see the equivulent lua code.
Edited on 20 September 2017 - 09:13 AM
nitrogenfingers #10
Posted 20 September 2017 - 11:15 AM
My 2 cents on this (I used to use visual language as a teacher)

Visual programming languages are useful for teaching because both syntax and compsci principles are important to learn when programming, and the use of a syntax-minimal language allows them to be learned independently. The algorithms behind principles like conditionals, looping and recursion are largely equivalent regardless of language, so you can create and observe these structures without worrying about syntactic pitfalls like missing punctuation or misspellings. Of course theoretically a visual programming language can probably implement any finite set of functionality, but the programs I've used keep the scope of their respective languages very small (or choose a simple platform) for the sake of simplicity.

So functionally I haven't seen a visual language that could be used for anything complex, because to do so would be missing the point.

Regarding the impact of hiding low-level functionality on programmer understanding, this was actually the topic of my graduate thesis :D/> From my research, yes this is a danger. A good example of this is BlueJ, a Java IDE that uses UML to hide the static elements of the language. It's not a visual language per se but it has visual components in place of code. At my university we observed significant issues transitioning from BlueJ to Eclipse because it fundamentally altered their perception of how Java worked. The author of the IDE discussed this among other issues in a 2008 paper.

It's a super-specific case but my takeaway is as teaching tools they're useful to a point, and students should not come to rely on them in the long run, as this may hamper their ability to learn other paradigms in the future.
Edited on 20 September 2017 - 09:16 AM
supernicejohn #11
Posted 20 September 2017 - 04:54 PM
I think it may well be a good learning tool, but it seems to me like many of these visual coding tools are extremely proprietary; I tried one that had 'turn snowman 90 degrees" as a block, and at that point people wont be learning more than that 'the computer does what I want it to do'.

The thing that would make them cool in my book is to be useful as a transitioning tool to learn a specific language, if one were to gradually replace the blocks with text.

As for some of my non-programmer friends (less than me at least!), visual programming gets bad reputation, mostly for the visual element but if I were to guess, they'll see some weird proprietary blocks in whatever program they were using.

Perhaps as ""technology""" advances, (read 'good implementation strategies' and 'easier to learn than text') I'd reevaluate what visual block coding is. For now my NXT is gathering dust. (And I'm not clever enough to install other languages onto 'it') xp
KingofGamesYami #12
Posted 20 September 2017 - 06:03 PM
The thing that would make them cool in my book is to be useful as a transitioning tool to learn a specific language, if one were to gradually replace the blocks with text.

So… kind of like code.org works? It's all drag 'n drop (like scratch), but you can also write completely in javascript if you prefer. One of my highschool classes used it, and there is a certain point in the lessons where it encourages you to transition to text. I personally used text the entire time, but I know people in my class who did not.

You don't actually have to install robotc on the NXT, it does that for you. Though you will need to purchase a license for extended use… :(/>

-snip-

Just to clarify things, here's my stance:

1) Visual programming does not replace text based programming. I personally prefer text based
2) Visual is not inherently better or worse as far as utility goes; it is simply different.
3) It has strengths and weaknesses, just as text based does. But this goes for ANY programming language - R will beat Go in the right circumstances, and vice versa.

Elaborating on this a bit:
- Visual programming is better for introducing kids to programming because it is more approachable. Don't ask me why, it just is.
- Visual programming is better for certain jobs in industry. The best example I can think of is assembly lines. You really don't want to try and visualize what position the robotic arm is in - much better to actually see it.
- Text based programming is better at some things as well. You wouldn't want to do optimization on a visual program. 'course, that's mostly handled by compilers now.
valithor #13
Posted 22 September 2017 - 11:57 PM
If you are majoring in computer science one of the first things they try to teach you is how to actually think logically. At my university at least, if you are in the accelerated comp sci class you don't even look at code for almost a month and a half. If you are not in the accelerated one you would go almost the whole semester without touching code. Whenever you are trying to teach people how to code, tossing them straight into a language is setting them up for failure. Sure a few might pick it up, but you are not only asking them to learn the syntax and all the nuances of the language, but also how to think logically and solve problems in a way that is completely different from anything else they have ever done.

My stance on the code blocks vs text is slightly biased since my university started us out in code blocks before moving us onto c++. Code blocks are a great tool for teaching people beginnings, or helping nontechnical people create simple programs. In the end learning how to think logically is far more important than learning a language, in fact a large majority of professional programming has nothing to do with the actual syntax, or learning languages (See linked software engineering book if you don't believe me).

1. Code blocks are great for teaching logic instead of syntax (arguably the most important thing for a programmer)
2. Code blocks are definitely not a replacement for textual code (I would expect a visual representation to become cluttered, hard to manage, and more time intensive to make minor changes)

mentioned software engineering book: https://worayoot.fil...8th-edition.pdf
Edited on 22 September 2017 - 09:57 PM
Saldor010 #14
Posted 23 September 2017 - 02:40 AM
If you are majoring in computer science one of the first things they try to teach you is how to actually think logically. At my university at least, if you are in the accelerated comp sci class you don't even look at code for almost a month and a half. If you are not in the accelerated one you would go almost the whole semester without touching code.

My stance on the code blocks vs text is slightly biased since my university started us out in code blocks before moving us onto c++.

That's interesting, my class had us programming in c++ by the second day. I guess everyone does it differently.
valithor #15
Posted 23 September 2017 - 03:05 AM
If you are majoring in computer science one of the first things they try to teach you is how to actually think logically. At my university at least, if you are in the accelerated comp sci class you don't even look at code for almost a month and a half. If you are not in the accelerated one you would go almost the whole semester without touching code.

My stance on the code blocks vs text is slightly biased since my university started us out in code blocks before moving us onto c++.

That's interesting, my class had us programming in c++ by the second day. I guess everyone does it differently.

I thought it was strange as well, granted I already knew a decent amount of c++ before the class, but after seeing many of the people in my class struggle with thinking through how to solve problems, even with using the code blocks instead of code, it made sense. They wouldn't have survived if we had jumped straight into code (many of them had no background in programming or at most python stuff).
Saldor010 #16
Posted 23 September 2017 - 03:39 AM
I thought it was strange as well, granted I already knew a decent amount of c++ before the class, but after seeing many of the people in my class struggle with thinking through how to solve problems, even with using the code blocks instead of code, it made sense. They wouldn't have survived if we had jumped straight into code (many of them had no background in programming or at most python stuff).

All of the people in my class pretty much knew what they were doing. There were still people asking for help, but their problems were all syntax related, they had the logic down fine. Maybe a difference of community college versus university? Either way, I think both approaches are acceptable (though if I were teaching, I would probably start off with code blocks).