Jump to content

The Scratch Thread


HansonKerman

Recommended Posts

i dont really see any point when i have the gcc toolchain installed and the knowhow to use it. 

ive never seen a graphical programming environment that didnt start to crash as soon as you tried to do any serious work with it. 

Link to comment
Share on other sites

Life is way bigger than C. :)

Scratch is the closest thing we have to the original Object Development Environment that were created "on the good old days", and the direct replacement of something I used to use as a Youngster: LOGO. :)

Link to comment
Share on other sites

On 9/9/2018 at 9:22 AM, Green Baron said:

Is Scratch meant for education ?

We're using Scratch in our 11th grade (I concur, @Just Jim, we really need a facepalm emoji) computer science class. It's basically programming without text, but with predetermined commands (thus avoids frustration due to typos/syntax errors) executed in a list.
I already used Scratch in 7th grade, so I was familiar with it and had an unfair advantage. First thing I did this year was a random walk just to prove my point.

In class I'm currently working on an implementation of the complex plane (that part is done) in an attempt to draw the Mandelbrot Set (that doesn't work yet, but I think I loop to much). Perhaps I can surreptitiously take a screenshot and post it here after coming home.

Edited by Delay
Link to comment
Share on other sites

i learned c in 9th grade. its totally in the realm of possibility for a highschooler to learn a real programming language. i see scratch as being for a more elementary level. 

Edited by Nuke
Link to comment
Share on other sites

Scratch = flash = horror. That alone is enough to keep me from recommending it for any purpose, even if it was useful beyond elementary school, which I doubt.
From what I can tell, scratch is to programming what lego is to structural engineering. Fun for a few minutes perhaps.

Link to comment
Share on other sites

29 minutes ago, steve_v said:

Scratch = flash = horror. That alone is enough to keep me from recommending it for any purpose, even if it was useful beyond elementary school, which I doubt.
From what I can tell, scratch is to programming what lego is to structural engineering. Fun for a few minutes perhaps.

i dont know about that, lego is pretty structurally robust if you build right. 

Link to comment
Share on other sites

25 minutes ago, Nuke said:

i dont know about that, lego is pretty structurally robust if you build right.

Show me a structurally sound full size cantilever bridge made from only lego, and I'll gladly concede the point... Once I see someone drive a semi across it. :P

As languages go, I can only make suggestions from my own experience. I began with basic, much to my chagrin, and I would have been much better off starting out with c.
This scratch thing strikes me in much the same vein - a simplified "easy" not-quite-language that will serve well to teach bad habits and reinforce misconceptions while having few, if any real-world applications. It's a toy.

Also, as I mentioned,  anything that requires adobe flash needs to eradicated. Flash has been nothing but a liability for years.

Edited by steve_v
Link to comment
Share on other sites

3 hours ago, Nuke said:

i learned c in 9th grade.

I hope that'll come in my class, too. Not necessarily C (or C++ or C#, preferably C++), but at least something you can be taken seriously with. I really hope that Scratch is only used to introduce the very basic concepts of programming and then move on to something actually useful.

I'm just trying to waste time with the Mandelbrot set while also seeing what can be done with such primitive tools.

Edited by Delay
Link to comment
Share on other sites

17 hours ago, steve_v said:

Show me a structurally sound full size cantilever bridge made from only lego, and I'll gladly concede the point... Once I see someone drive a semi across it. :P

lego is extremely strong under compressive loads. i hear there is a 118 foot high lego tower in israel, won a giunness world record in 2015. the other day i saw a video where they built a car mostly out of lego, and drove it (using a lot of lego motors). its only a matter of time.

 

everything else you said totally agree. i think anything with a virtual machine should be avoided at all cost. we had the problem of too many architectures, so we started using virtual machines to bridge the gap. now we have too many virtual machines. its only a matter of time before we get virtual machines in our virtual machines. gotta draw the line somewhere before things get out of hand. there are a lot of useful scripting languages, but its better when they stick to that job and not try to fix the too many architectures problem.

Edited by Nuke
Link to comment
Share on other sites

c is a good first language:

1 it teaches some very useful fundamentals. functional programming, working with memory, pointers, etc. 

2 it is still a useful language to know, looks good on a resume.

3 its not hard to jump into c++ after learning it. i learned c++ as my second language, and using c was a great stepping stone.

Link to comment
Share on other sites

12 hours ago, Delay said:

Good to know. How am I supposed to start? With what am I supposed to start? What am I supposed to work with?

#include <stdio.h>

int main() {
	printf("hallo wold\n");
	return 0;
}

you can always pick up a book on the subject, or youtube seems to work. a little google fu on c tutorials might be a good place to start. id reccomend gcc as a first compiler. visual studio is kind of bloated out of proportion and doesnt teach the fundamentals of working with compilers, and id rather have a simple makefile over a bloated mess of visual studio project files any day. 

Edited by Nuke
bugs
Link to comment
Share on other sites

21 minutes ago, Delay said:

Thanks, understood everything!

if you meant that in a non sarcastic way, congratulations, you got what it takes to be a programmer.

in case you were:

the include statement there just sticks a library in your code. stdio.h is usually the thing that gets included in a hallo wold application. i dont exactly know why, but when you get to the point where you can read code you can open the header file and see whats going on in there. stdio is pretty standard in most c programs so its full of low level stuff. this is also why i like to write my own libraries rather than rely on a bunch of black boxes, i like to know how things work. the # means that this is handled by the preprocesser and not the compiler (the compiler just sees the contents of the header file in its place). 

int main is a function. the main function is kind of special as that is the entry point for your program. but the format is the same as any other function you might use, the brackets are the start and end of the function, int means it returns a value of type integer, the return statement ends the function and gives the value of the returning integer. 

printf is another function (which i presume is part of stdio.h), you will use it a lot in c. the thing in the quotes is a string, c likes null terminated strings, hince the \n at the end. also note the semicolon, you should terminate statements with them. the printf and return are both statements, but the function definition and terminating brace are not. the include is handled by the preprocessor and therefore is not a statement (preprocessor directive?). 

thats as good a place to start as any, then you start writing your own functions and making variables, move on to structures and how to use pointers. one thing i found was poorly explained in the books i read was how to organize your code and use header files correctly. its not something you need when you are mostly writing single file programs, but when you start doing serious projects it really helps to know how to break your code down into self contained units. but understanding a hallo wold is the first step in learning a new language.

Edited by Nuke
Link to comment
Share on other sites

5 hours ago, Delay said:

Good to know. How am I supposed to start?

Book or tutorial. I personally prefer a good book. Should cover C11 and not some computer folklore :-)

If not book: https://www.cprogramming.com/tutorial/c-tutorial.html this was recommended elsewhere.

Quote

With what am I supposed to start?

I'd take Linux. It costs nothing, has the most recent, reliable and functional compiler versions and is completely documented. Download a debian image on a stick, install it on your computer's drive on an own partition if possible or get an old fried out computer from anywhere. It really doesn't matter for getting into programming.

When done with installation, install the package build-essential and that's it.

Quote

What am I supposed to work with?

In the beginning a terminal window, an editor, the command line, a few basal (not "basic" :-))) commands, the compiler, maybe a helper tool like make. At one future time you'll probably switch to an IDE.

Example for a first session after os installation:

- open terminal window

- to install the compiler and libraries type sudo apt-get install build-essential

- enter your password

- to invoke the editor type nano hello.c

- type in the program above

- to save and exit press ctrl-o followed by enter and then ctrl-x

- to compile type gcc -o hello hello.c

- if error, correct it or ask. If not, to change the file flags to executable, type chmod +x hello

- execute your first c-program by typing ./hello

 

Have fun !

Edit: my short tone is by no means meant to be disrespectful ! I apologize if this is understood that way, i was just too lazy :-)

'nother edit:

@Nukethe second line must be int main() {

Mind the brackets behind the function name (), which denotes a function call without parameters. For the first step. And yes, printf() is declared in stdio.h.

int main { will be interpreted by the compiler as a variable declaration and it'll lament a missing operator or , ; ...

Edited by Green Baron
Link to comment
Share on other sites

I haven't used scratch, but I have used graphical logic programming. There was a game called Blockworld or something like that and I got pretty good with scratch style programming. I also used Lego mindstorms for Lego robotics, but I'm trying to learn python. Python is like scratch, it's really simple, but you actually do the work 

Link to comment
Share on other sites

7 hours ago, Green Baron said:

@Nukethe second line must be int main() {

Mind the brackets behind the function name (), which denotes a function call without parameters. For the first step. And yes, printf() is declared in stdio.h.

int main { will be interpreted by the compiler as a variable declaration and it'll lament a missing operator or , ; ...

oops.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...