DEV Community

Cover image for Things to know
Tony.Rese5
Tony.Rese5

Posted on • Updated on

Things to know

  1. What is the difference between a function and a method?

    A- A function returns a value, but a procedure does not. A method is similar to a function, but is internal to part of a class. The term method is used almost exclusively in object-oriented programming. A function is something that takes a bunch of inputs and returns one or more values.

  2. Why are structures a better way to define data than just declaring a series of variables?

    A- A structure definition is like a blueprint for the structure. It takes up no storage space itself instead just specifies what variables of this structure type will look like. An actual structure variable is like a box with multiple data fields inside of it. Consider the idea of a student database. One student record contains multiple items of information (name, address, SSN, GPA, etc)

Top comments (3)

Collapse
 
seanolad profile image
Info Comment hidden by post author - thread only accessible via permalink
Sean

Bud, not bad, but try adding more to your post, beginners for swift will need more information. Like what a structure is, etc.. Also, don't call it "Swift stuff", no one is going to take you seriously with that title. I learnt swift in a couple months and I've got to tell you, every thing that you put here is in one lesson. For your next post write something that people want to hear about, or just you own personal experience with swift.

Collapse
 
tony5293 profile image
Info Comment hidden by post author - thread only accessible via permalink
Tony.Rese5

This is all for school. I have to post what they ask of me nothing more nothing less, sorry if you don't like it.

Collapse
 
seanolad profile image
Info Comment hidden by post author - thread only accessible via permalink
Sean

k, u do u

Some comments have been hidden by the post's author - find out more