# Mixin and parameter packages: How many macros is too many macros?

**URL:** https://discourse.julialang.org/t/mixin-and-parameter-packages-how-many-macros-is-too-many-macros/10809
**Category:** Community
**Tags:** question, announcement
**Created:** [May 10, 2018, 8:02am UTC](https://discourse.julialang.org/t/mixin-and-parameter-packages-how-many-macros-is-too-many-macros/10809 "2018-05-10T08:02:17Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)
#### Post date: [May 11, 2018, 8:12am UTC](https://discourse.julialang.org/t/mixin-and-parameter-packages-how-many-macros-is-too-many-macros/10809/6 "2018-05-11T08:12:49Z")

</div>

On the plus side: Many macros are useful to write code more quickly by reducing boiler-plate, abbreviate, etc. It may make the code more maintainable, by avoiding repetitions which would need to be updated in sync during a refactor. (Although, I think, that problem can often be solved with more careful code design.)

On the negative side, it makes your code much harder to read, for other people or your future self. This will decrease contributions from others, as they need to learn your meta-language first, and may impede the maintainability of your code by yourself.

So, for long term projects or projects where you expect/want outside contributors, I think limiting macro usage probably makes sense. This conversation from another [thread](https://discourse.julialang.org/t/knet-vs-mxnet-for-programmer-new-to-ml/10073/16) between `@osofr` and Mike Innes (one of our top macro-gurus) illustrates my point nicely:

> [@Knet vs MXNet for programmer new to ML](https://discourse.julialang.org/t/knet-vs-mxnet-for-programmer-new-to-ml/10073/6):
>
> Mike’s implementation is a thing of beauty, some of his Julia code is just on another level. For example, take a look at the Flux implementation of backprop with Adam optimizer – there is so much Julia magic there it hurts. Sometimes the source code can be very hard to understand (for a newbie), but its a very rewarding experience when you eventually get it.

gets the reply

> [@Knet vs MXNet for programmer new to ML](https://discourse.julialang.org/t/knet-vs-mxnet-for-programmer-new-to-ml/10073/16):
>
> Optimisers are actually the part of Flux’s interface that I’m least happy with right now (which is largely why they are not documented beyond basic usage). I’m not happy that they are magical and want to redesign something that’s simple and powerful.

---

_[View the full topic](https://discourse.julialang.org/t/mixin-and-parameter-packages-how-many-macros-is-too-many-macros/10809)._
