Reputation
1,152
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
6 15
Newest
 Yearling
Impact
~30k people reached

  • 0 posts edited
  • 1 helpful flag
  • 82 votes cast
Aug
25
comment die() or try/catch when interacting with MySql database in PHP?
Only catch something you can handle it intelligently. If there's nothing to do then I'd suggest failing hard.
Aug
8
awarded  Yearling
Jul
22
comment Why dynamic memory allocation functions in C returns void*?
This is because these methods are allocating memory without any specific type. If malloc returned int* and you allocate only 1 byte, you would never be able to dereference it safely without casting.
Jul
16
awarded  Popular Question
Jun
26
comment Should you write your back-end as an API?
Is the assumption that the API (assembly) must have some sort of web interface? I see no reason why the API could not live within the same AppDomain as the MVC app. If you wanted to offer a Rest interface, you would reference the same API with the approperiate end-points.
May
20
comment Example of writing unit test for a method
My obj-c is rusty, but if Crashlytics is a static instance, there's probably not much you can do. You could write an instance wrapper for Crashlytics, inject it, and test that it gets invoked correctly, but if you already have working code I probably wouldn't bother for something so simple.
May
15
comment Is it a good idea to install more libraries than you need?
I try and not predict the future, writing code takes time, and that's time wasted if it's never used. In addition, if the code is not currently used, we don't know if it will even be correct when we do need it. Your problem is a little bit different as you're not writing code, but you are still configuring an environment which takes time. Even if the time is negligible, it may be overwhelming to look at many dependencies to try and find what you're looking for.
May
15
comment Is it a good idea to install more libraries than you need?
Rhetorical response: is it a good idea to write a method that is not used now but may be used in the future? This doesn't answer the question, but that's my opinion on installing things that are not needed.
May
15
comment Unit-testing on higher levels of architecture
@RobertHarvey I don't understand the question as methods being static and methods being idempotent are orthogonal. In my answer I used examples where the complex scenario has side effects where the simple scenario is pure and idempotent. Quite often it's the side effects you want to avoid when testing a unit, instead you would test that the dependency that would causes a side effect is invoked with the correct parameters, and that the caller handles the mocked result correctly.
May
15
comment Unit-testing on higher levels of architecture
Most definitely, the point I'm trying to make is there is no one-size-fits-all for unit testing.
May
15
answered Unit-testing on higher levels of architecture
May
15
comment How to explain design decisions when refactoring code
Thanks for this answer. The reason why I was changing that implementation is I was using it in a new web project that has a lot of unit tests and an IoC container. The main issue is that the project in which this library lies does not have any consistency I can discern.
May
15
accepted How to explain design decisions when refactoring code
May
15
comment How to explain design decisions when refactoring code
I actually do have an extension method on my ICacheProvider that does something similar.
May
14
revised How to explain design decisions when refactoring code
added 11 characters in body
May
14
asked How to explain design decisions when refactoring code
May
4
comment Why do methods that take an unlimited amount of parameters often define overloads with fewer parameters?
Another thing to note is that passing Combine with zero or one path segments does not even make sense, yet the params version allows you to do this.
Apr
22
awarded  Citizen Patrol
Apr
15
comment TDD Red-Green-Refactor and if/how to test methods that become private
Making private methods is the result of the refactoring of public methods in the TDD refactoring step.
Apr
14
accepted Calling RESTful service from browser and handling 4xx class responses