11 Replies - 494 Views - Last Post: 27 January 2013 - 10:41 AM Rate Topic: -----

#1 ChristianGamer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 25-January 13

What is an argument?

Posted 26 January 2013 - 04:52 PM

Okay so the tutorial I'm on is pretty straight forward but one thing I've noticed is that sometimes they say words and don't explain anything about them. Such as 'arguments' I hardly know what they're talking about because I don't know what the programming definition and us of an argument is! So I was wondering a couple definitions and possibly the applications of these terms if nobody minds answering my misc. request... I'm also kinda thinking it'll be a good place to go for beginners on this board who are also kind of confused by the programmer speak going around! If there's another board like this I apologize and I'll be totally willing to redirect my question there but I'm mainly wondering what a C# 'argument' is...

Is This A Good Question/Topic? 0
  • +

Replies To: What is an argument?

#2 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: What is an argument?

Posted 26 January 2013 - 05:00 PM

An argument is the actual "data" that you pass into a methods parameters.

For example

public void someMethod(string myParameter) {}

string p = "this is the argument";
someMethod(p);


In this case 'myParameter' is the parameter, and the string 'p' is the argument.
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3177
  • View blog
  • Posts: 10,639
  • Joined: 12-December 12

Re: What is an argument?

Posted 26 January 2013 - 05:18 PM

This MSDN page is quite good, even though it references VB.

I'm not sure about the car-parking analogy though :dontgetit:

[People are a bit lax with the terminology though :) and you will often hear the terms parameter and argument treated as synonyms.]

This post has been edited by andrewsw: 26 January 2013 - 05:19 PM

Was This Post Helpful? 0
  • +
  • -

#4 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2239
  • View blog
  • Posts: 9,409
  • Joined: 29-May 08

Re: What is an argument?

Posted 26 January 2013 - 06:05 PM

Arguments are the values you supply to a method to met it method signature.
Dim ValueOut As Integer
If Integer.TryParse("1234",ValueOut) Then
...


I'm supplying the method (TryParse) the arguments "!234" and the reference to variable: ValueOut

Parameters are what you define in the method signature

Public Function Example (Of T) (P1 As Integer,ByRef P2 AS String,Optional Sq As Boolean = True, ParamArray xs As Double()) As T

Generic Parameters
ByRef Parameter
Usually used for Out parameters, eg Integer.TryParse(String, Integer) As Boolean
Optional Parameters
Skipping these parameters will default value supplied
ParamArray xs As Double()
These must be the at the end of the method parameters, and consume any matching arguments left over.

Return (Parameter) Type


Arguments
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5432
  • View blog
  • Posts: 11,643
  • Joined: 02-June 10

Re: What is an argument?

Posted 26 January 2013 - 06:49 PM

Quote

I don't know what the programming definition and us of an argument is!


I've never seen a beginner's book that didn't define these things.

Are you working your way through a book, such as "Learn C# in 30 days"? If not, why not?


My standard beginner resources post - Updated DEC 2012

You can try to learn C# by dismantling snippets and googling terms - basically you can take a hit-n-miss, shotgun approach. Or you could just follow a proper training program whether it be a couple intro books, school, on-line course or series of tutorials like the ones we offer. I'll tell you from experience that just fumbling around in the dark and trying to teach yourself with no guidance doesn't work. Its like stumbling across a Harrier Jump Jet and trying to teach yourself how to fly with no background in piloting: You simply lack any groundwork to start from. How can you lay out your own training course if you don't already know the material? Would you go to a university where the teacher says "I don't know any of this but we'll fumble through it together?"

We have a tutorials section and a learning C# series of articles.

First learn the language by working 2-5 "Learn C# in 30 days" type books cover to cover. Do a couple hundred on-line tutorial projects where you build what you're told to build, the way you are told to build it WITH AN EXPLANATION OF WHY so you can learn.

There are three routes people seem to take when learning programming.
  • Just start trying to create programs
  • Start taking apart other programs and try to figure out the language by reverse engineering
  • Follow a guided learning course (school or self-teaching books)


For the life of me I can't figure out why people try 1 & 2. I strongly suggest taking the guided learning approach. Those book authors go in a certain order for a reason: They know what they're doing and they know the best order to learn the materials.

Quote

Where do I start?


You start by learning a coding language FIRST.
Learn to plan before you type.
THEN you start designing software with a purpose.


If this sounds like you

Newbie/Rookie said:

I have a little programming experience but I need to write ...
read this section
Spoiler


Otherwise, you can just jump to the resources here:
Some of the tutorials below are for C# or Java not C, C++, VB.NET [...]. But the conceptual stuff of classes, object oriented design, events etc. are not language specific and should give you enough guidance in theory of program development for you to be able to look-up specific code example in your chosen coding language.



Resources, references and suggestions for new programmers. - Updated Oct 2012
Spoiler

Was This Post Helpful? 0
  • +
  • -

#6 ChristianGamer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 25-January 13

Re: What is an argument?

Posted 27 January 2013 - 12:56 AM

View PosttlhIn`toq, on 26 January 2013 - 06:49 PM, said:

Quote

I don't know what the programming definition and use of an argument is!


I've never seen a beginner's book that didn't define these things.

Are you working your way through a book, such as "Learn C# in 30 days"? If not, why not?


No and it's because I'm kind of out of work.. I'm working my way towards my G.E.D. so I can get a job but until then I have a serious lack of resources. If there's any tutorials that would be helpful and explain that kind of stuff be my guest and recommend some!
Was This Post Helpful? 0
  • +
  • -

#7 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3177
  • View blog
  • Posts: 10,639
  • Joined: 12-December 12

Re: What is an argument?

Posted 27 January 2013 - 04:04 AM

View PostChristianGamer, on 27 January 2013 - 12:56 AM, said:

View PosttlhIn`toq, on 26 January 2013 - 06:49 PM, said:

Quote

I don't know what the programming definition and use of an argument is!


I've never seen a beginner's book that didn't define these things.

Are you working your way through a book, such as "Learn C# in 30 days"? If not, why not?


No and it's because I'm kind of out of work.. I'm working my way towards my G.E.D. so I can get a job but until then I have a serious lack of resources. If there's any tutorials that would be helpful and explain that kind of stuff be my guest and recommend some!

Eh?! It appears you only read the first two lines of the previous post and neglected all the other very useful information.
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5432
  • View blog
  • Posts: 11,643
  • Joined: 02-June 10

Re: What is an argument?

Posted 27 January 2013 - 07:31 AM

Can't pay for a book or course. Okay. But you do seem to be able to get on-line even if it is only at a free source like the library or hanging out at Starbucks.

Quote

I have a serious lack of resources.

Not when it comes to learning programming you don't. It's simply untrue. Everything you could ever hope to find is available on the internet. And I'm not just talking about places to ask questions in the hopes of being hand-held through it all. There are entire courses for free... many publishing sites let you browse entire chapters of books on-line in the hopes of selling the books. Oh - and there is a public library in your town isn't there?

A 5 second Google of "C# for Dummies" lead me to an entire series of YouTube videos.
http://www.youtube.c...h?v=SqMreZ9syWo

MSDN has numerous tutorials.

When I want a definition for something as you did here, the first place I hit is Wikipedia.
argument(programming) - See parameter (computer programming)

There are also numerous free online course offered by schools if you look around. I just did a 5 week course on Windows Phone 8 that was free.
http://learn.itmasters.edu.au/

Sorry if this is blunt but: If you're not at work then you have 40 hours a week more than the rest of us to research and study. A motivated person with the drive to succeed finds a why to reach their goals. Other people find reasons why its not their fault.

This post has been edited by tlhIn`toq: 27 January 2013 - 07:32 AM

Was This Post Helpful? 1
  • +
  • -

#9 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3177
  • View blog
  • Posts: 10,639
  • Joined: 12-December 12

Re: What is an argument?

Posted 27 January 2013 - 07:40 AM

Talking of which, tlhIn`toq there is a free 800+ page ebook for Windows 8 programming.

This post has been edited by andrewsw: 27 January 2013 - 07:43 AM

Was This Post Helpful? 0
  • +
  • -

#10 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5432
  • View blog
  • Posts: 11,643
  • Joined: 02-June 10

Re: What is an argument?

Posted 27 January 2013 - 07:47 AM

Cool. Thanks for the link. I'm sure we'll add add it to our collections of coding libraries. I love it when they are available as ePubs so I get all the advantages of scaling type size etc. on my iPad!

That link made me wonder what else was available for free.
So I googled "Free microsoft press" and was lead to this page where there a a dozen titles listed.
http://blogs.msdn.co...ou-a-penny.aspx
Was This Post Helpful? 1
  • +
  • -

#11 ChristianGamer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 25-January 13

Re: What is an argument?

Posted 27 January 2013 - 10:32 AM

View Postandrewsw, on 27 January 2013 - 04:04 AM, said:

View PostChristianGamer, on 27 January 2013 - 12:56 AM, said:

View PosttlhIn`toq, on 26 January 2013 - 06:49 PM, said:

Quote

I don't know what the programming definition and use of an argument is!


I've never seen a beginner's book that didn't define these things.

Are you working your way through a book, such as "Learn C# in 30 days"? If not, why not?


No and it's because I'm kind of out of work.. I'm working my way towards my G.E.D. so I can get a job but until then I have a serious lack of resources. If there's any tutorials that would be helpful and explain that kind of stuff be my guest and recommend some!

Eh?! It appears you only read the first two lines of the previous post and neglected all the other very useful information.


Yeah, I apologize about that... I was really tired when I quoted that and kinda shrugged aside the rest... Sorry!
Was This Post Helpful? 0
  • +
  • -

#12 ChristianGamer  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 16
  • Joined: 25-January 13

Re: What is an argument?

Posted 27 January 2013 - 10:41 AM

Though I do wanna say thanks a ton, a lot of programmers up till now have shunned me away telling me that I need to buy books and join a school. So when I hear 'why haven't you?' it kinda brings up that feeling of 'oh not this again...' I didn't mean to sound like I was ignoring your other information! But yes, I do have 40 more hours a week and I want to put it to the best use I can as it can't last forever. All of these tutorials look spectacular and I was looking all over for how to find a proper way to look up the programming version of the word but I just couldn't seem to think of the correct search terms... C# station has also been a huge help in my programming venture and because of it I now know how Variables work, how to create instance methods (Although I am a tad bit confused about some parts of it...) How to make while and do while loops (For and foreach confuse the crap out of me...) and several condition statements such as if, else, switch, etc.

All the help and resources your sharing are a big help and I plan to get right to reading them! Yet again I apologize if it sounding like I kinda snapped..
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1