9 Replies - 1260 Views - Last Post: 02 April 2014 - 06:30 AM

#1 infernorthor  Icon User is offline

  • D.I.C Addict

Reputation: 187
  • View blog
  • Posts: 876
  • Joined: 07-February 14

More functions

Posted 01 April 2014 - 09:19 AM

How many times must I say use more functions or classes (synonyms and the like) ?

I haven't taken any CS college courses, but it seems those are left as advanced bit that students really don't see the importance of. I know you have to get through the basics, but that really shouldn't take that long. Any comments how classes are taught would be interesting.

I think a new meme for it :bananaman: more functions ! :bananaman:

Is This A Good Question/Topic? 0
  • +

Replies To: More functions

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8937
  • View blog
  • Posts: 33,490
  • Joined: 12-June 08

Re: More functions

Posted 01 April 2014 - 09:22 AM

... or it could be the folks who are the ones with one or two posts, looking for folks to do their homework at the last moment, are just the ones who are lost on the topic already or were not paying attention.. everyone else - who are not asking questions - already understand the topic.
Was This Post Helpful? 0
  • +
  • -

#3 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5780
  • View blog
  • Posts: 12,594
  • Joined: 16-October 07

Re: More functions

Posted 01 April 2014 - 09:50 AM

My mantra in all the languages is: "more functions."

This is either coupled with "globals bad" or "static bad" depending on the language.

Part of it is the mentality of the beginner. As an instructor, the constant challenge is sympathizing with that position.

The beginner has a block of code that works. Do they copy the working code verbatim, changing one value, or do they figure out how to write a function? The former is always the first choice, mostly because the latter seems scary at first. Copied working code seems infinitely better than writing different code that will break differently.

Same goes for almost all beginner errors. It took a great deal of effort to get as far as they have. Proposing something new can seem like adding insult to injury. Beginners will often say things like "but THAT works, I need help with THIS." It can be frustrating, but it's where they're at.

Always keep in mind, some people want to learn how to program, but many are just trying to survive a class that's kicking their ass. We try to teach everyone, whether they like it or not, in the belief that learning is the only thing that gives meaning to the exercise. Learning, of course, will also ameliorate future ass kicking, but students often fail to appreciate that.
Was This Post Helpful? 2
  • +
  • -

#4 infernorthor  Icon User is offline

  • D.I.C Addict

Reputation: 187
  • View blog
  • Posts: 876
  • Joined: 07-February 14

Re: More functions

Posted 01 April 2014 - 11:23 AM

Yeah help forums likely don't represent the majority of students.

If I were to guess the structure of class is

1 data types
2 operators
3 control statements
4 functions

I'm sure people like to jump into coding. I almost think function should be taught just after data types.
So you are starting off by being able to explain int main() in Hello World instead of well we'll get to that later.

I think Java course jump into classes a lot sooner than C++ where they start with C stuff first, but I could be wrong.
I just like big picture approach perhaps, but it delays actually testing things out.
Was This Post Helpful? 0
  • +
  • -

#5 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5780
  • View blog
  • Posts: 12,594
  • Joined: 16-October 07

Re: More functions

Posted 01 April 2014 - 11:46 AM

Well, in Java, classes are unavoidable; sort of. This is where all the static comes in.

Java seems to start out in static Main. When functions (methods) are introduced, they're often static functions, because OO isn't on the table just yet. This is why we see that massive Main from hell in early programs.

In C++ you can sort of ease into it. However, if you started with C, you run the "C with classes" risk.

I almost miss BASIC. It was a horrible language that taught horrible things, but you could at least hit the ground running. Most languages require ice skates before you can really get moving.
Was This Post Helpful? 1
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3468
  • View blog
  • Posts: 10,688
  • Joined: 05-May 12

Re: More functions

Posted 01 April 2014 - 02:04 PM

I could almost hear Alec Guinness say:

View Postbaavgai, on 01 April 2014 - 02:46 PM, said:

I almost miss BASIC. It was a horrible language that taught horrible things, ...

Was This Post Helpful? 0
  • +
  • -

#7 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5780
  • View blog
  • Posts: 12,594
  • Joined: 16-October 07

Re: More functions

Posted 01 April 2014 - 03:41 PM

LOL. "not as modular or secure as an OO framework. An inelegant language, for a more civilized age." Or something like that. ;)
Was This Post Helpful? 1
  • +
  • -

#8 ArtificialSoldier  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 325
  • View blog
  • Posts: 1,200
  • Joined: 15-January 14

Re: More functions

Posted 01 April 2014 - 04:10 PM

Relevant. Sort of.
Was This Post Helpful? 1
  • +
  • -

#9 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: More functions

Posted 02 April 2014 - 01:04 AM

I think part of the issue is that schools aren't teaching how to design software.
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 3468
  • View blog
  • Posts: 10,688
  • Joined: 05-May 12

Re: More functions

Posted 02 April 2014 - 06:30 AM

At least when I was in school 20 years ago, when they did teach how to design software, they taught the Booch Method. *gag* It was the one class I dropped because I didn't want to learn to design software that way. I'm hoping current curricula teaches Design Patterns, and any C/C++ course includes at least 6 months of covering books by Meyers and Alexandrescu. Or perhaps a quarter or semester covering Code Complete and The Pragmatic Programmer.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1