C
C
CallMeYourDaddy2020-07-09 08:23:57
C++ / C#
CallMeYourDaddy, 2020-07-09 08:23:57

Do I need to instantiate the class in the arguments?

I am trying to shorten my code and instead of:

var config = new DiscordConfiguration{};
Client = new DiscordClient(config);

I can write like this:
Client = new DiscordClient(new DiscordConfiguration
{

});


Is it correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-07-09
@CallMeYourDaddy

Pure taste. I usually write in one line, if it fits into 80 characters, if more, then I share it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question