Hello, I started a couple of weeks ago the blueprints course for unreal, and we are talking about macros right now. The teacher told that we shou’ld avoid repeating code, so for that we are starting to use macro librabaries.
I want to ask What are the inconveniences of repeating code, can it crash da game or is just bad optimazation or something else. Is my first experience with unreal and coding so I’m sorry if is a dum question
I think the main reason here is that repeating code can make maintaining your code more complicated. Let’s say that your code has a bug that you overlooked before.
If you use this same code in multiple places it means you have to fix this bug in all the places and maybe you miss one place and leave the bug there. But if you used macros or functions to make sure that your code is only in one place then you only have to fix the bug there.
Also, it’s easier to modify that specific code if it’s only in one place.
1 Like
It makes a lot of sense actually, thank you!!
1 Like
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.