Skip to main content
edited body
Source Link
Heslacher
  • 51k
  • 5
  • 83
  • 177

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString(); and have no code to modify in that method the day PlejeFamilie needs a new member.

[scrolls down]

The same applies to BiologiskFamilie; whenever something changes in these classes, you have multiple placedplaces that must change. I would refactor this code so as to minimize the amount of code that needs to be written (therefore possible omissions and bugs) when a change becomes required.

Why is everything static? This class has disposable private fields, I think it should be an instance, and should implement IDisposable so it could be used in a using block and then the client code doesn't need to "remember" to call EndConnection.

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString(); and have no code to modify in that method the day PlejeFamilie needs a new member.

[scrolls down]

The same applies to BiologiskFamilie; whenever something changes in these classes, you have multiple placed that must change. I would refactor this code so as to minimize the amount of code that needs to be written (therefore possible omissions and bugs) when a change becomes required.

Why is everything static? This class has disposable private fields, I think it should be an instance, and should implement IDisposable so it could be used in a using block and then the client code doesn't need to "remember" to call EndConnection.

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString(); and have no code to modify in that method the day PlejeFamilie needs a new member.

[scrolls down]

The same applies to BiologiskFamilie; whenever something changes in these classes, you have multiple places that must change. I would refactor this code so as to minimize the amount of code that needs to be written (therefore possible omissions and bugs) when a change becomes required.

Why is everything static? This class has disposable private fields, I think it should be an instance, and should implement IDisposable so it could be used in a using block and then the client code doesn't need to "remember" to call EndConnection.

added 479 characters in body
Source Link
Mathieu Guindon
  • 75.6k
  • 18
  • 195
  • 469

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString(); and have no code to modify in that method the day and have no code to modify in that method the dayPlejeFamiliePlejeFamilie` needs a new member.

[scrolls down]

The same applies to BiologiskFamilie; whenever something changes in these classes, you have multiple placed that must change. I would refactor this code so as to minimize the amount of code that needs to be written (therefore possible omissions and bugs) when a change becomes required.

Why is everything static? This class has disposable private fields, I think it should be an instance, and should implement IDisposable so it could be used in a using block and then the client code doesn't need to "remember" to call EndConnection.

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString();and have no code to modify in that method the dayPlejeFamilie` needs a new member.

[scrolls down]

The same applies to BiologiskFamilie.

Why is everything static?

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString(); and have no code to modify in that method the day PlejeFamilie needs a new member.

[scrolls down]

The same applies to BiologiskFamilie; whenever something changes in these classes, you have multiple placed that must change. I would refactor this code so as to minimize the amount of code that needs to be written (therefore possible omissions and bugs) when a change becomes required.

Why is everything static? This class has disposable private fields, I think it should be an instance, and should implement IDisposable so it could be used in a using block and then the client code doesn't need to "remember" to call EndConnection.

Source Link
Mathieu Guindon
  • 75.6k
  • 18
  • 195
  • 469

I find whenever I feel the need to use a #region, there's something fishy going on with my code; I see the same in your SendPlejeFamilieObjekt method: all those WriteLine/Flush calls look very suspicious. Why do you flush at every single line written?

Have you considered overriding PlejeFamilie.ToString() to return the equivalent string? You could do _sWriter.WriteLine(pfamilie.ToString();and have no code to modify in that method the dayPlejeFamilie` needs a new member.

[scrolls down]

The same applies to BiologiskFamilie.

Why is everything static?