# Programming in Swift: Functions & Types, Episode 33: Methods | raywenderlich.com

**URL:** <https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229>\
**Category:** 🎓 Courses & Articles\
**Created:** [January 28, 2022, 2:47am UTC](https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229 "2022-01-28T02:47:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![catie](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/catie/32/110937_2.png) [@catie](https://forums.kodeco.com/u/catie)\
**Post date:** [January 28, 2022, 2:47am UTC](https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229/1 "2022-01-28T02:47:35Z")

</div>

Take a deep dive into methods, including writing initializers, mutating methods, and more. Work with structures and enumerations!

* * *
This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/28433240-programming-in-swift-functions-types/lessons/33](https://www.raywenderlich.com/28433240-programming-in-swift-functions-types/lessons/33)

---

<div class="post-metadata">

**Author:** ![huszczahuszcza](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/huszczahuszcza/32/102075_2.png) [@huszczahuszcza](https://forums.kodeco.com/u/huszczahuszcza)\
**Post date:** [January 28, 2022, 1:18pm UTC](https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229/2 "2022-01-28T13:18:16Z")

</div>

tons of new concepts not necessarily related to the topic, no purpose. It’s hard for me to imagine someone who smoothly sits by himself and thinks it all up, since you don’t know what the goal is.

---

<div class="post-metadata">

**Author:** ![protagonista89](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/protagonista89/32/102075_2.png) [@protagonista89](https://forums.kodeco.com/u/protagonista89)\
**Post date:** [February 11, 2022, 12:16pm UTC](https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229/3 "2022-02-11T12:16:18Z")

</div>

The temp of speech is too fast for me. Pauses and subtitles didn’t do much help. After watching the video I need to read more about mutating and non-mutating functions once again.

---

<div class="post-metadata">

**Author:** ![dakimi07](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/dakimi07/32/102075_2.png) [@dakimi07](https://forums.kodeco.com/u/dakimi07)\
**Post date:** [April 16, 2022, 3:05pm UTC](https://forums.kodeco.com/t/programming-in-swift-functions-types-episode-33-methods-raywenderlich-com/163229/5 "2022-04-16T15:05:22Z")

</div>

**When to use case-less enumerations, and when we don’t need it?**

Hi, Catie. In this course, you introduced the concept of “case-less enumeration”. Just want to make sure, why it doesn’t make sense to write code like this when we can call the method after `math`?

```auto
struct Mathematics {
  func getLength(x: Double, y: Double) -> Double {
    ...
  }
}

let math = Mathematics()
math.getLength(x: 3.0, y: 4.0) // 5.0

```

If `let math = Mathematics()` doesn’t make sense in this case, when would we need to write code like this?

```auto
struct Mathematics {
  // What kind of code will make sense here? 
  // If there is only one method that doesn't take any parameter? 
  // If there are multiple methods? 
  // If it only contains properties?
  // Or if it contains properties in it along with methods?
}

let math = Mathematics()

```

I would really appreciated if you can help we clarify the concept. Besides, because English is not my native language, if there’s anything I wrote that is hard to read or sounds offensive, I don’t mean that and I apologize for that. Thank you.
