Issue with formatted WriteLine
I'm following along with C#12/.net8 and came across this snippet around Ch5. The first one works, the second one cannot parse args, this seems like something simple I'm just not getting. I can print bob.Born or the FavoriteAcientWonder(excuse the typo) but as soon as I add a 3rd arg it won't work.
15 Replies
I strongly recommend using interpolated strings instead of
WriteLine
with format strings
the superior way to WriteLine, approved, please submit the PR.
haha I will and I like that syntax, I was just curious why it didn't work and why ChatGPT/Bard also had no idea.
but interesting the last one fails.
Console.WriteLine Method (System)
Writes the specified data, followed by the current line terminator, to the standard output stream.
I wonder if its a limitation of args as opposed to params
because there's no 4-arg overload
ah yeah that is what I was imagining
I strongly recommend you stay well away from ChatGPT and similar until after you're comfortable with C#
because it often spits out complete garbage
I would suggest the same specially if you're learning
yeah i kinda get that feeling tbh. i am coming from java, i started learning spring boot but there are waaaay more c# jobs where i am and want to live.
when they first came out i was very impressed and worried about the future, now I am mostly frustrated and angry unless it is dead-simple...
asp.net is like spring boot but better :kekw:
you'll probably like it
LLMs are quite useful, but you need to actually understand the output to make use of them
at least for me they're still in that stage where verifying the output is often more work than its worth
I appreciate the advice
just remember all LLMs do is predict text
they don't know how to program :when:
that's usually what i use them for, autocomplete or making variations of some code based on something i already wrote
or like a more chatty search engine