General "Methods/Structures" in Programming

In summary, the conversation discussed the use of Alice 2.3 freeware for self-teaching programming and whether the structures used in Alice generalize to other programming environments. The main items in Alice include methods, events, functions, parameters, and variables, which are important concepts in any computer language. However, there may be more to learn about in terms of data structures. Inheritance in programming was also mentioned as a way to reuse code in object-oriented programming. Some participants expressed mixed views on the effectiveness of Alice as a tool for learning how to program, with some suggesting that it may not be the best approach.
  • #1
WWGD
Science Advisor
Gold Member
7,399
11,372
Hi all,
I have been teaching myself some programming by using Alice 2.3 freeware.

My question is whether/to what degree, the structures used in Alice generalize:

Alice's main items are : methods, events, functions, parameters, variables.

Is this also the case for general programming environments. If so, to what extent?

Thanks.
 
Technology news on Phys.org
  • #2
The list: methods, events, functions, parameters, variables is certainly very important in any computer language, so you are not wasting time in learning about them. But I don't think they do much to characterize different types of structures. When I think of types of data structures, I think of lists, hash arrays (aka dictionaries), linked lists, trees, etc. So just be aware that there might be more to learn about. It's an important subject dealing with how information is organized, stored, retrieved, and communicated. On the other hand, you may go a long time only encountering simple examples of these that you will understand immediately.
 
Last edited:
  • #3
None of what you mentioned are structures, they are just concepts.

Methods - these are functions attached to an "object." You call it, it does some work on the object, then it returns. Used for everything.
Event - something that may happen at any time. You register a function that gets called when something happens. Used for dealing with events that can happen in any order: mouse, keyboard, sockets...
Functions - these are groups of code that do work, similar to a method but without an object associated with it
Parameters - this is how you get information into a function, a function usually requires some data to do it's work
Variables - these are just placeholders for data, just like in mathematics. They are used everywhere.
 
  • #4
WWGD said:
Hi all,
I have been teaching myself some programming by using Alice 2.3 freeware.

My question is whether/to what degree, the structures used in Alice generalize:

Alice's main items are : methods, events, functions, parameters, variables.

Is this also the case for general programming environments. If so, to what extent?

Thanks.
Those are some of the main programming concepts. The list is missing "class" and "object". A method is usually a function tied to an object. A variable tied to an object is called an attribute, member, or property. The term "structure", as I think another poster mentioned, usually refers to data structure, which is different, things like trees and linked lists. But in the normal English usage of how a program is structured, those in the list are the key parts.
 
  • #5
Thanks, Fooality, I will look further into these concepts.
 
  • #6
WWGD said:
I have been teaching myself some programming by using Alice 2.3 freeware.
I took a very quick look at an Oracle site that provides information and examples about the Alice programming language. My take is mixed: on one hand, you can do some pretty cool things with animation very quickly, but on the other hand, the user interface gets in the way of learning how to write programs (IMO). To get a better feel for programming, I believe that it's more beneficial to actually write code than to fill in boxes with information.

A lot of people start out with Python, which can be downloaded for free. Another alternative is to start in with C (non-object-oriented) or C++ (which has object-oriented features). There are several free compilers that are available, including gcc and Microsoft Visual Studio Express, the latter of which can also be used if you write code in C#.

FactChecker mentioned several data structures that are used in programming. There are also control structures, such as if/else and other branching structures, for loops and while loops, and so on, that are present in virtually all programming languages.
 
  • Like
Likes FactChecker
  • #7
Thanks all for your replies. Yes, I did use the word "structures" too loosely, my bad.

@runner, anyone: would you plese give me a ref. on "inheritance issues" for these concepts? I

am confused, using Alice, on when I should use a world method, or a method of any other object,
same for events, other concepts.
 
Last edited:
  • #8
Hey, I looked at Alice.org, I get the impression that version 2 teaches basic programming logic, while version 3 teaches object oriented concepts (this is where you learn about objects and classes) http://www.alice.org/index.php
Inheritance in programming exists in object oriented programming. One class is said to inherit attributes and methods from its "parent" or "base class". Its a way to reuse code.
 
  • #9
Mark44 said:
My take is mixed: on one hand, you can do some pretty cool things with animation very quickly, but on the other hand, the user interface gets in the way of learning how to write programs (IMO).
I looked, too. My take was less mixed. IMO, Alice is the computer science equivalent of Physics for Poets. Just as Physics for Poets is not the way to learn physics, Alice is not the way to learn how to program a computer.
 
  • #10
D H said:
I looked, too. My take was less mixed. IMO, Alice is the computer science equivalent of Physics for Poets. Just as Physics for Poets is not the way to learn physics, Alice is not the way to learn how to program a computer.

Well, the interface is frustrating, but if you do a search for Alice , you see that it is being taught and it has been taught for many years now at "reasonable" schools, i.e., not bottom-of-the-barrel ones, so maybe there is more to it than meets the eye.
 
  • #11
WWGD said:
Well, the interface is frustrating, but if you do a search for Alice , you see that it is being taught and it has been taught for many years now at "reasonable" schools, i.e., not bottom-of-the-barrel ones, so maybe there is more to it than meets the eye.
Lots of "reasonable schools" have classes like the "Physics for Poets" that D H cited, as well as "Rocks for Jocks," a simplified course in geology. Filling in boxes is not my idea of learning how to write programs.
 
  • #12
Mark44 said:
Lots of "reasonable schools" have classes like the "Physics for Poets" that D H cited, as well as "Rocks for Jocks," a simplified course in geology. Filling in boxes is not my idea of learning how to write programs.
Believe me, you do need to have an idea f what you are doing here. If you do not " fill your boxes" correctly, the
program will not run. Of course, this is an intro, so you get to know and understand the main concepts, and to know
some real programming you need you need to go beyond this into some more advanced environments. You need to
know if/when to use different types of loops, if/else statements, what types of variables to use, how to combine different variables into
strings (using joins, etc.). It is an intro and it does not claim to be anything more than that.
 
  • #13
Mark44 said:
Filling in boxes is not my idea of learning how to write programs.
That's like saying, drawing circuit diagrams is not my idea of learning about electronics. After all everyone knows that circuit design is all about soldering and not drawing lines and boxes on paper.
 
  • #14
Mark44 said:
Filling in boxes is not my idea of learning how to write programs.
DrZoidberg said:
That's like saying, drawing circuit diagrams is not my idea of learning about electronics. After all everyone knows that circuit design is all about soldering and not drawing lines and boxes on paper.
Your analogy isn't at all apt, IMO.

My (and D H's) complaint is more like the opposite of what you wrote. We are essentially saying that soldering bits and pieces together without the benefit of circuit diagrams isn't how to learn electronics, but drawing circuit diagrams is.
 
  • #15
Fine, that makes sense. But it doesn't matter whether you design your circuit diagrams by dragging boxes around and filling in the values or you design it by writing down text that describes how the components fit together. Textual vs graphical is not the important issue here.
 
  • #16
My two cents on the Alice-as-a-way-to-learn conversation: Java was my first language. It was a brutal learning curve, but once I was over it everything higher level: python, php, javascript etc. Came incredibly easy. Only lower level languages C/C++ came tough, and that's generally the rule: Its harder to go down in abstraction than it is to go up with learning languages. The best long term would be to start with a year of pure suffering in assembly languages and C, and then after than everything would come easy. But can people tolerate that? Its literally several months of programming without being able to produce anything interesting, whereas only a quarter of Python or Ruby would allow you to produce some little program you're proud of. The other thing is the world needs programmers at different levels. It needs lots of people who can script a solution in something simple, and it needs less people who can do breakthrough work on C algorithms, like the next video compression algorithm. So I don't think the top down approach Alice offers is totally flawed, but you have to understand you're stretching out the suffering this way too, there will be more every time you take on a lower level language that you have before.
 
  • #17
WWGD said:
Well, the interface is frustrating, but if you do a search for Alice , you see that it is being taught and it has been taught for many years now at "reasonable" schools, i.e., not bottom-of-the-barrel ones, so maybe there is more to it than meets the eye.

There is a difference between "computing", "computer science" and "programming".

If you do a degree such as "Computing and IT" they may well teach a visual programming language like Alice because you only need to understand the concepts of how a program is a system that follows logical rules that are pre-determined when it is created. The rest of the degree will be stuff like how to setup computer networks (the IT side) and a general introduction to computing such as how to use spreadsheets and what the cloud is.

If you do a "Computer Science" degree they will almost certainly not teach Alice, and will likely use a more traditional language like Python or Java (these are the two most common languages taught in US Computer Science university courses at the moment).

Programming itself is creating computer programs. Alice is programming, so don't let anyone tell you it isn't. However you are NOT going to be landing computer programming jobs with Alice. There are only a few fields in which visual languages are used. Game scripting is one of them (Unreal Engine has a visual languge for level creation) but even there, you'll need some knowledge of Python or LUA.

In my experience most of the people using visual languages such as Alice are creative artists who use computers as part of their art, because they are not "science-y people". For example, interactive installations with lamps that track your movement as you walk around the exhibit. Even then, a lot of them are using Python and C or C++ (microcontrollers).
 
  • #18
Carno Raar said:
There is a difference between "computing", "computer science" and "programming".

If you do a degree such as "Computing and IT" they may well teach a visual programming language like Alice because you only need to understand the concepts of how a program is a system that follows logical rules that are pre-determined when it is created. The rest of the degree will be stuff like how to setup computer networks (the IT side) and a general introduction to computing such as how to use spreadsheets and what the cloud is.

If you do a "Computer Science" degree they will almost certainly not teach Alice, and will likely use a more traditional language like Python or Java (these are the two most common languages taught in US Computer Science university courses at the moment).

I think my training in Mathematics is good-enough that I can make a (relatively, at least) smooth
transition between the high-level, graphic environment of Alice and a more "hands-on" approach. And
you do need to have a reasonably-good understanding of some programming concepts to come up with a decent program; it is not just an "artsy game": you need to know what type of loop to use, when to use it, you need to combine your loops correctly to know if/when you are exiting one and entering another, etc. While it may not be rocket science, it is not just artsy, technically-trivial either.

Programming itself is creating computer programs. Alice is programming, so don't let anyone tell you it isn't. However you are NOT going to be landing computer programming jobs with Alice. There are only a few fields in which visual languages are used. Game scripting is one of them (Unreal Engine has a visual languge for level creation) but even there, you'll need some knowledge of Python or LUA.

In my experience most of the people using visual languages such as Alice are creative artists who use computers as part of their art, because they are not "science-y people". For example, interactive installations with lamps that track your movement as you walk around the exhibit. Even then, a lot of them are using Python and C or C++ (microcontrollers).

I am using Alice as an introduction, not as the goal itself, and, AFAIK, this is the way it is used in many places -- as the first step towards a better understanding of programming, though I don't doubt it is also used by some who do not want to engage in the nitty-gritty. And you do need to have a reasonable conceptual understanding of when/how to use loops, what types of loops to use, and if/when you will enter a loop , you need to use if/else statements correctly, etc. Maybe not "rocket science" , but not entirely technically trivial either, you do need to have some understanding beyond just an "artsy" level. And I would like to believe I have enough training in related Mathematics that I can handle (albeit with a lot of work) into a more "nitty-gritty" level.
 
Last edited:

FAQ: General "Methods/Structures" in Programming

What are the basic programming structures?

The basic programming structures include sequence, selection, and iteration. Sequence is the order in which instructions are executed. Selection allows for decision-making based on conditions. Iteration allows for repeating a set of instructions.

What is the purpose of using methods in programming?

Methods, also known as functions, allow for reusable blocks of code that can be called multiple times within a program. This makes code more organized, efficient, and reduces redundancy.

How are methods defined and called in programming?

Methods are defined by providing a name, parameters (optional), and a set of instructions. They can be called by using the method name followed by parentheses, with any necessary arguments inside the parentheses.

What is the difference between a procedure and a function?

A procedure is a method that does not return a value, while a function is a method that returns a value. Procedures are typically used for code that performs actions, while functions are used for code that calculates and returns a result.

Can methods be nested within each other?

Yes, methods can be nested within each other, meaning a method can call another method within its instructions. This allows for code to be broken down into smaller, more manageable pieces.

Similar threads

Back
Top