Reputation
787
Top tag
Next privilege 1,000 Rep.
See votes, expandable usercard
Badges
2 10
Newest
 Nice Answer
Impact
~28k people reached

  • 0 posts edited
  • 0 helpful flags
  • 47 votes cast
Aug
1
awarded  Nice Answer
May
23
revised Is Visitor Pattern valid in this scenario?
edited body
May
22
comment Is Visitor Pattern valid in this scenario?
What article are you referring with that you disagree? However, interesting point of view on the domain model. Probably you can see it like that, though, people usually avoid mixing services into entities, because it will create a tight coupling very soon.
May
22
answered Is Visitor Pattern valid in this scenario?
Feb
23
comment My value checker function needs to return both a boolean and a message
'[..] check that the value is of the right format.' Shouldn't the name be FormatChecker, then?
Feb
9
awarded  Autobiographer
Dec
28
comment TDD with repository pattern
@Thaven: TDD says, start implementing a feature by writing a unit-test. A new feature is foremost about business functionality. You also don't test if variable assignment works, and usually it is useless to test CRUD operations - at all (and that includes TDD).
Dec
28
comment Are all magic numbers created the same?
+1 for @SamDufel's "it's also about reading the calculation". I usually tend to workaround such well known magic numbers by creating a method for it, e.g. {{getSizeAsHumanReadable()}}. An automatic quality-check will still be upset about it, but it puts the numbers in a small context, where it is easier for a reader to narrow down the meaning. And people who know what 1024 could mean are faster in checking if the calculation is correct. Finding a good name for that number is so hard, because someone may change the value to e.g. 1000, without changing the name...
Oct
2
awarded  Yearling
Sep
1
answered How 'child proof' should i write code as a solo programmer?
Jul
25
comment How much data should exceptions hold?
There are some kinds of errors/exceptions I can react on by following an alternate route. In my example the caller may adjust the timeout by 10% and tries again. Or it tries another server instance. Or it wants to write to a database, that a specific server is not available.
Jul
25
comment How much data should exceptions hold?
you didn't say The exceptions should be self explaining by their type. I agree with that (although not completely). However... let's assume a timeout-exception, which should indicate the server to be reached, and the timeout-period. In your proposal you create a string with that values, and later you are not able to access them programmatically, only by parsing the string.
Jul
24
answered How much data should exceptions hold?
Jul
24
comment How much data should exceptions hold?
-1 for "don't store this values inside the exception but just use them to create the exception message in the constructor." a string is good for textual output, but what about translation or checking out a specific value (e.g. an error code)? Are you then going to parse the string?
Jul
14
awarded  Organizer
Jul
13
comment Is testability and mockability really that important in web development?
@MightyPork Well, not for everything. And it is up to you (or your lead developer, or your architect) to decide whether it's worth it. You basically do that by defining quality goals and maybe come to the conclusion testability is a top 5 criteria (or you do not test at all, because you implement a static webpage). BTW: when writing unit-tests you often unveil caveats in your code like bad model-structure, so maybe your model wasn't that good after all.
Jul
1
comment How bad is it calling println() often than concatenating strings together and calling it once?
I have to say that I don't see the point here. When interacting with a user via terminal, I can't imagine any performance issues because usually there is not that much to print. And applications with an GUI or an webapp should write to a log-file (usually using a framework).
Jun
11
comment Continuing to code on large projects
I'd like to amend: 2) there are several types of automated tests (unit-, behaviour-driven, GUI-tests). Think/read about which one makes sense to your projects. 3) document the main aspects of the architecture, e.g. arc42 is a very slim template.
May
16
comment Benefits of Java in education?
@Jasper probably you want to take a look at JVM based languages like groovy or scala.
May
16
comment pattern to share objects between API and application
To me it is not clear what architecture you implemented (maybe it is the .net wording that puzzles me) - is it a 3 tier architecture: client, server, db?