# Should I use type parameters or abstract arguments in a function?

**URL:** <https://discourse.julialang.org/t/should-i-use-type-parameters-or-abstract-arguments-in-a-function/4133>\
**Category:** General Usage\
**Created:** [June 7, 2017, 10:33am UTC](https://discourse.julialang.org/t/should-i-use-type-parameters-or-abstract-arguments-in-a-function/4133 "2017-06-07T10:33:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [June 7, 2017, 10:33am UTC](https://discourse.julialang.org/t/should-i-use-type-parameters-or-abstract-arguments-in-a-function/4133/1 "2017-06-07T10:33:16Z")

</div>

I find myself faced with a decision quite often to either use f{T\<:Real}(a::T) or f(a::Real), using Real as an example. Is there any performance difference between the 2? Which one is more preferred?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [June 7, 2017, 10:55am UTC](https://discourse.julialang.org/t/should-i-use-type-parameters-or-abstract-arguments-in-a-function/4133/2 "2017-06-07T10:55:16Z")

</div>

> [@mohamed82008](#):
>
> Is there any performance difference between the 2?

No.

> [@mohamed82008](#):
>
> Which one is more preferred?

Are you going to use `T`?

---

<div class="post-metadata">

**Author:** ![mohamed82008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mohamed82008/32/18171_2.png) [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Post date:** [June 7, 2017, 11:02am UTC](https://discourse.julialang.org/t/should-i-use-type-parameters-or-abstract-arguments-in-a-function/4133/3 "2017-06-07T11:02:21Z")

</div>

I see, so only when T is going to be used.
