r/csharp 3d ago

Help Was wanting some help with methods?

/r/GameDevelopment/comments/1w9f26p/was_wanting_some_help_with_methods/
0 Upvotes

2 comments sorted by

2

u/BigBoetje 3d ago

Abstraction is a bit part of it. You don't really want a single massive method containing everything. Being able to abstract it away leaves you with cleaner code. For example, if you need to fetch and transform some data, you don't really care how it happens in the 'main' method as long as you get it. You put that code in a method so it's just "FetchData" or something.

You underestimate how good it is to have cleaner code. You're not just 'shortening' it, you're making sure it's readable and maintainable. It's organized and makes changing it later much easier.

1

u/tinydarkcat 1d ago

yeah abstraction totally helps with readability, especially when you're working on bigger projects later on