Author Topic: Coding and Scripting  (Read 12569 times)

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: Coding and Scripting
« Reply #30 on: November 25, 2009, 07:39:58 AM »
Please name some of your ideas :)

I'm interested in helping



Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #31 on: November 25, 2009, 10:03:03 AM »
As no one responded to my last request for sharing knowledge, I ask this:

Is the question I asked something that you consider to be too basic? Is understanding those symbols "required" before going on to other things and must be learned on one's own? Or is it too advanced and needs to be learned "as you go?"


Offline Chomp

  • Full Member
  • ***
  • Posts: 173
Re: Coding and Scripting
« Reply #32 on: November 25, 2009, 01:15:46 PM »
Neal,

I fully plan on doing your exercise.  It's just finding the time.  It's been a tiring week for me so far and looks like it will continue to be so until the weekend.  The PDF I've chosen to help me learn had over 100 pages of introduction in the first chapter without getting into the code yet.  I thought it was important to read it all so I did.  Chapter 2 also has a lot of reading too, but finally starts getting into the code at the end.  After I find the time to go through chapter 2, I'll fill your request.  Can't speak for anyone else.

Edit:  I don't think it's too basic or too advanced.  Good way to start collaborative learning for newbies in my opinion.
« Last Edit: November 25, 2009, 01:17:38 PM by Chomp »

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Coding and Scripting
« Reply #33 on: November 25, 2009, 01:20:36 PM »
Chomp:  Did you get that pdf online?  Got a link?  I used to do some C and C++ but it's been a long time.
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Coding and Scripting
« Reply #34 on: November 25, 2009, 01:31:10 PM »
As no one responded to my last request for sharing knowledge, I ask this:

Is the question I asked something that you consider to be too basic? Is understanding those symbols "required" before going on to other things and must be learned on one's own? Or is it too advanced and needs to be learned "as you go?"


When starting a project like this, assume total ignorance on the learners part, and start with "Hello World". With each lesson, give details as to the meaning of each character used, then the working example. Those with more experience will jump in once the lessons progress to where they exhibit a level in excess of their current knowledge, or to answer questions, if some detail was not made clear in the lesson proper.

The trouble with most tutorials is that they either assume more knowledge than is actually present from the start, or they start with "Hello World" and a few rather meaningless examples, then jump to a level that leaves a big gap in the students knowledge, and pick up where the former group of tutorials start. This gets very discouraging for those newer students, as they don't get the middle level transitional knowledge; they're just suddenly in over their head. I've seen many tutorials I would equate to teaching first, second, and third grade, then jumping directly to middle or high school level, with only a paragraph in between.

How many tutorials start with, "We assume the student is already familiar with programming in another language"? If all tutorials were written this way, nobody would learn anything. To be successful as a true teaching method, one must assume this to be the first programming language the student has ever seen, and progress in a logical fashion from there. This may be a fact, but even if it's not, it's still good to offer all the needed steps as a refresher, to those who have been away from the language for a while, and keep everyone on the same page.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #35 on: November 25, 2009, 02:13:24 PM »
O-P,
You describe the difficulties I've had quite well. I've read tutorials on C, C++, Python, Perl and others that purported to be for beginners, yet gave no real beginning lessons. I don't really consider "Hello world" to be a beginning lesson, as so little of it is ever explained.

If you guess from the above that I don't know what I'm doing re programming, you're probably right. I know how to learn a language (modern foreign languages degree work -- okay, years ago), but the basics must be available in order to learn. That is why I posed the symbols exercise. As they are a part of the language(s) that might be considered non-standard from a human-spoken/written point of view, learning what they are / definitions for them seemed a good start off point. Definitions for other words and phrases would be next and a little basic structure with it. More advanced syntax and definitions could come on a one level to the next basis. At least, that was my thinking.

If you could outline a better lesson plan, it would be very much appreciated.


Offline Chomp

  • Full Member
  • ***
  • Posts: 173
Re: Coding and Scripting
« Reply #36 on: November 25, 2009, 02:34:14 PM »
Chomp:  Did you get that pdf online?  Got a link?  I used to do some C and C++ but it's been a long time.


Bruce Eckel's Thinking In C++

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Coding and Scripting
« Reply #37 on: November 25, 2009, 02:38:50 PM »
Sweet!  Thx a bunch!
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Coding and Scripting
« Reply #38 on: November 25, 2009, 02:54:42 PM »
Neal:  It's been years but if you really want to start at the beginning, something like this,
hello world  (explain the compiler and linker)
variables
if
for
case
functions
variable scope
uh.. something something..... anyway it's a start.

I've been using this recently and it looks pretty good for C++:
http://www.cplusplus.com/doc/tutorial/
http://www.cplusplus.com/files/tutorial.pdf

Pointers always confuse me, specially when they get dereferenced several layers deep.  I seem to get pointed in the wrong direction.  Well anyway, you get my point.
« Last Edit: November 25, 2009, 03:01:08 PM by Joble »
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #39 on: November 25, 2009, 03:36:18 PM »
Thanks, Joble. Your input is, IMO, invaluable.


Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Coding and Scripting
« Reply #40 on: November 25, 2009, 03:37:29 PM »
O-P,
You describe the difficulties I've had quite well. I've read tutorials on C, C++, Python, Perl and others that purported to be for beginners, yet gave no real beginning lessons. I don't really consider "Hello world" to be a beginning lesson, as so little of it is ever explained.

If you guess from the above that I don't know what I'm doing re programming, you're probably right. I know how to learn a language (modern foreign languages degree work -- okay, years ago), but the basics must be available in order to learn. That is why I posed the symbols exercise. As they are a part of the language(s) that might be considered non-standard from a human-spoken/written point of view, learning what they are / definitions for them seemed a good start off point. Definitions for other words and phrases would be next and a little basic structure with it. More advanced syntax and definitions could come on a one level to the next basis. At least, that was my thinking.

If you could outline a better lesson plan, it would be very much appreciated.

I think we're on the same page here. Define only the symbols used in the example first, then show how and where they are used in the example, and tell why they are in the order they occur. Next lesson, do the same. If there's some repetition, that only reinforces what's been learned already; don't assume the definitions will be remembered after just one use. After about five or six lessons, those symbols from the first lesson can be dropped from the definitions, as they should by then be memorized.

By progressing from single;

{
      code example
}

to;

{
      code example
}

{
      code example
}

type programs the student can see how larger applications can be built from a collection of smaller code blocks, with each block's function clearly explained.

Just showing the code, and the output, doesn't fully explain why a particular block of code was chosen, or the details of how it achieves the end result, which is necessary if one is to be able to learn to build a new application from scratch. If more than one block of code can achieve the same end results, it would be nice for the student to know there are choices, and why one method was chosen over the other.

A bit off topic, as it concerns bash scripting, but still to the point, I once asked for a script for a specific task, at the original hack site, and an explanation of how it worked. I got two or three scripts with up to 100 lines of code, with a lot of extras thrown in that I didn't need, and weren't necessary for the job at hand. By bouncing the scripts back and forth for a bit, refining it as we went along, the script was reduced to two short lines of code that did exactly what was asked for originally. The point being that coding does not need to be an exercise in excess, with large line counts, to be a success, but rather, a refinement to the bare essentials to do the job required.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Coding and Scripting
« Reply #41 on: November 25, 2009, 03:47:55 PM »
I agree with you there. In my perhaps "limited" view of how coding should be approached, I see no reason to write a page or more of code that can be done by a line or two. IMO, if we do it right, we can code some very good programs this way that are "light" enough to seem powerful and fast; i.e. I'm in favor of best output from best effort, not biggest effort.


Offline Chomp

  • Full Member
  • ***
  • Posts: 173
Re: Coding and Scripting
« Reply #42 on: November 25, 2009, 03:49:50 PM »
I also think code examples should be able to be compiled by us so that we can see the output and see what it does as opposed to taking a random chunk of code that won't compile because it's not complete or requires an IDE.  My two cents.

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: Coding and Scripting
« Reply #43 on: November 25, 2009, 04:29:58 PM »
+1  I've often run into bits of code that look great, but cannot be run.  Any code should be runnable.  Provide it this input variable, run the function, expect this result.  For someone who does not understand the code to begin with, code that will not stand on it's own is useless to the student.  Line by line understanding, what this does, what that does, must have an expected input, and an expected output, else it's just useless code on a page that is not understood.
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11591
  • ----IOFLU----
Re: Coding and Scripting
« Reply #44 on: November 25, 2009, 04:38:31 PM »
I also think code examples should be able to be compiled by us so that we can see the output and see what it does as opposed to taking a random chunk of code that won't compile because it's not complete or requires an IDE.  My two cents.

Excuse me if I'm wrong, but I thought that was the whole point; write the code, compile it, then fun the app; make corrections if it doesn't compile, until it does. If the output is different than expected, refine the code to achieve the desired results.

When I first did this back on Windows, looong time ago, I put each apps code and the compiled app in it's own sub directory, including any variations I made along the way, so I could compare the different outputs of each version of the code. I'd strongly suggest each person do the same.

Making variations helps to cement the concepts, to be sure you understand what is actually happening with the code, and the entire collection of created apps, assembled in one place, organized by lesson numbers, or dates, makes a pretty good refresher course, if you get away from it for a while. When you've written the code yourself, and supplied your own comments within it, it's very easy to understand, the second time around. ;D
« Last Edit: November 25, 2009, 04:43:18 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...