Style
The overall reading of these methods is pretty good and the code is well structured.
The documentation is good to read and to understand.
Your style is a little bit inconsistent. It's about the using of braces
{}
for single statementif
's . One time at the guard clause you use braces and later on for theif(throwErrors)
you don't use them.Speaking about
throwErrors
, the method won't ever throw errors but oneException
so a better name could be eithershouldThrowException
orthrowsException
.
Speaking about throwErrors
, the method won't ever throw errors but oneException
so a better name could be either shouldThrowException
or throwsException
.
Speaking about Serialize()
method
I don't like ref
parameters that much and I try to avoid them if there is a better/different way to solve this.
For the Serialize()
method the usage of an ref
parameter could be avoided by passing a StringBuilder
instead of a string
as argument.
You for sure would need to check if the passed in StringBuilder
is not null
but you could just pass it afterwards to this overload of the Serialize()
method.
Style
The overall reading of these methods is pretty good and the code is well structured.
The documentation is good to read and to understand.
Your style is a little bit inconsistent. It's about the using of braces
{}
for single statementif
's . One time at the guard clause you use braces and later on for theif(throwErrors)
you don't use them.
Speaking about throwErrors
, the method won't ever throw errors but oneException
so a better name could be either shouldThrowException
or throwsException
.
Speaking about Serialize()
method
I don't like ref
parameters that much and I try to avoid them if there is a better/different way to solve this.
For the Serialize()
method the usage of an ref
parameter could be avoided by passing a StringBuilder
instead of a string
as argument.
You for sure would need to check if the passed in StringBuilder
is not null
but you could just pass it afterwards to this overload of the Serialize()
method.
Style
The overall reading of these methods is pretty good and the code is well structured.
The documentation is good to read and to understand.
Your style is a little bit inconsistent. It's about the using of braces
{}
for single statementif
's . One time at the guard clause you use braces and later on for theif(throwErrors)
you don't use them.Speaking about
throwErrors
, the method won't ever throw errors but oneException
so a better name could be eithershouldThrowException
orthrowsException
.
Speaking about Serialize()
method
I don't like ref
parameters that much and I try to avoid them if there is a better/different way to solve this.
For the Serialize()
method the usage of an ref
parameter could be avoided by passing a StringBuilder
instead of a string
as argument.
You for sure would need to check if the passed in StringBuilder
is not null
but you could just pass it afterwards to this overload of the Serialize()
method.
Style
The overall reading of these methods is pretty good and the code is well structured.
The documentation is good to read and to understand.
Your style is a little bit inconsistent. It's about the using of braces
{}
for single statementif
's . One time at the guard clause you use braces and later on for theif(throwErrors)
you don't use them.
Speaking about throwErrors
, the method won't ever throw errors but one Exception
so a better name could be either shouldThrowException
or throwsException
.
Speaking about Serialize()
method
I don't like ref
parameters that much and I try to avoid them if there is a better/different way to solve this.
For the Serialize()
method the usage of an ref
parameter could be avoided by passing a StringBuilder
instead of a string
as argument.
You for sure would need to check if the passed in StringBuilder
is not null
but you could just pass it afterwards to this overload of the Serialize()
method.