Feeds:
Posts
Comments

Posts Tagged ‘perl’

To be honest, I wasn’t very satisfied with the way class my programming class went today. I’m understanding the material fairly well, but I felt like a lot of the students weren’t connecting with it.  I think part of that is because they’re still trying to catch up on some of the earlier fundamentals in the course.  The other part is I feel I was lecturing too much, and that I should have had them do more hands on activities today, but that would have been challenging too, given that a chunk of students are still trying to catch up on the basic concepts I just mentioned.

Today we reviewed some of the questions from last Monday’s exam, particularly those dealing with subroutines, bundles of computer code that can be reused by given them different inputs (for example add these three numbers, where the three numbers input into the program can change each time you run it. We looked at ways you can use a return keyword to take the results of these small programs and store them in containers of different types (i.e. simple variables like strings of characters, or more complicated variables like lists of items).  We talked about how we can use our understanding of lists to process the inputs to these basic subroutine programs (i.e., by assigning list items to their own containers (variables) based on their position or by using foreach loops to perform activities like mathematical calculations on all of the inputs regardless of how many there are or in what order they’re input.  We can also use these basic subroutines to print output onto the user’s screen.

We also discussed the idea of global vs. local containers (i.e., variables that can be accessed across multiple subroutine programs or vs. only accessible within a specific subroutine) and how using the keyword my can be useful here.  I also explained how the Perl programming language handles global vs. local variables in different ways than more “modern” programming languages.

 

Read Full Post »