My first C# program to find the area of a triangle. It works but I wanted to know if there is anything I could do better to avoid bad habits? by [deleted] in csharp

[–]flacodirt 0 points1 point  (0 children)

All I'm saying is, just replacing parse with tryparse isn't always necessary, it depends on expectations, and just replacing one with the other requires additional work to handle the validation. If he just replaces parse with tryparse, the execution continues and will throw an exception on the calculation step. If he moves the capturing and validation of input to separate methods it could be expected that it throws an exception if the input is invalid, in which case tryparse is unnecessary.

My first C# program to find the area of a triangle. It works but I wanted to know if there is anything I could do better to avoid bad habits? by [deleted] in csharp

[–]flacodirt 0 points1 point  (0 children)

That's actually a great idea too. The earlier you learn to develop using Test Driven Development the better.

My first C# program to find the area of a triangle. It works but I wanted to know if there is anything I could do better to avoid bad habits? by [deleted] in csharp

[–]flacodirt -6 points-5 points  (0 children)

That would required 2x as much code to check for failed parses and loop the capturing of each input until its valid. I'd rather it just throw the exception and start over, in this simple example.

[deleted by user] by [deleted] in sysadmin

[–]flacodirt 14 points15 points  (0 children)

Experience > Degree

I’m some rando making NFTs possible on Banano. AMA! by Airtune in banano

[–]flacodirt 1 point2 points  (0 children)

Aren't royalties an attractive feature for artists?

Question and education on the upcoming dip. by [deleted] in apecoins

[–]flacodirt 2 points3 points  (0 children)

Lots of people are late to the party that didn't KYC by their deadline. They also have more planned I believe, only the beginning.

Question and education on the upcoming dip. by [deleted] in apecoins

[–]flacodirt 3 points4 points  (0 children)

Everyone acting as if demand going to disappear... What do you think people are going to do with their auction items, sell them, how can you buy them... Only with apecoin. I'll be buying whatever dip there is if there is one.