# When to use tuples?

**URL:** https://discourse.julialang.org/t/when-to-use-tuples/18675
**Category:** New to Julia
**Created:** [December 14, 2018, 11:30pm UTC](https://discourse.julialang.org/t/when-to-use-tuples/18675 "2018-12-14T23:30:16Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![ninjaaron](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ninjaaron/32/6392_2.png) [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)
#### Post date: [December 18, 2018, 10:33am UTC](https://discourse.julialang.org/t/when-to-use-tuples/18675/12 "2018-12-18T10:33:57Z")

</div>

Yeah, I would never dispatch on a tuple type outside of my own module. What I meant was that I’d rather have an interface like:

```julia
MyLib.do_the_thing(a, b, c)

```

rather than…

```julia
instance = MyLib.MyStruct(a, b)
MyLib.do_the_thing(instance, c)

```

Allowing users to create structs is fine if they need more control, but object setup and teardown is like Java busywork. My preference is to deal with the library I’m using as little as possible. If there’s one or two functions that cover the majority of usecases for my module, all you should have to do is stick some built-in types in those functions and get the output you want.

This is what I meant to say about using tuples for API stuff; Not that users should _never_ have to use my structs directly—just that simple things should be simple. I’m sure you didn’t mean to suggest anything to the contrary, of course.

---

_[View the full topic](https://discourse.julialang.org/t/when-to-use-tuples/18675)._
