Reputation
1,189
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
6 18
Impact
~36k people reached

Jan
27
comment What's the point of running unit tests on a CI server?
@BoristheSpider that workflow sounds great, I assume conflicts still are resolved manually, or is it required for the feature branch to pull master first?
Jan
25
comment Should we avoid language features that C++ has but Java doesn't to increase maintainability?
How are languages to evolve if people are unwilling to use new features? The purpose of the new features is to make your life easier by solving common problems. If users do not use new features, then there's no motivation for anyone to implement them.
Jan
13
comment Function to return a string - Which is cleaner?
I prefer the second, less variables, return early, all good! It would be better if you passed in the status code instead too, and renamed the method accordingly.
Jan
10
comment Filtering request and responses in RESTful MEAN stack
This is a good point for this particular use case, however I find myself in the same scenario for other resources, for example employee with a field salary.
Dec
28
comment Tracking online users with a stateless architecture
I guess I don't understand the question, why should the client be transmitted recentUserAccessTimestamp? To me it seems like you're just transferring that state information to the client. If the client sends the old token again, is the system going to behave differently than if it were to send the newer token?
Dec
28
comment Tracking online users with a stateless architecture
I think we may have the same view, just worded differently. In either case, I think it would be worth while to simply store this information server side in the database in some sort of logging / audit table. Just because your application may be saving this information doesn't mean the exposed service has to behave differently because of it.
Dec
28
comment Tracking online users with a stateless architecture
That is different than what most people would consider a stateless service. Stateless typically implies that no state information is passed between client and server. If the server wants to cache things, then that would be opaque to the client.
Dec
28
comment Tracking online users with a stateless architecture
Would this not then make it stateful?
Sep
25
comment How should I pass login data from client to server using REST API
Show me the money!
Sep
25
comment How should I pass login data from client to server using REST API
It's bad because it makes it more difficult for the client (they must make an extra call and save state [the token] on their end), and you have to deal with session expiry scenarios on both ends. Stateless restful services are easier to test and understand. I would just pass the authentication information on every call. I do it through headers, I tend to use "basic http authentication", it's a very simple mechanism.
Sep
25
comment How should I pass login data from client to server using REST API
Are you using a session to store persistent state information, or just for authentication? I think it's a good idea to avoid the notion of "sessions" in a restful API, and just pass authentication parameters by header.
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.
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
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
comment How to explain design decisions when refactoring code
I actually do have an extension method on my ICacheProvider that does something similar.