Reputation
84,221
Next tag badge:
213/100 score
19/20 answers
Badges
20 199 338
Newest
 Nice Answer
Impact
~2.2m people reached

Apr
19
comment HTTP Status Code for “Still Processing”
@MatthewHaugen: when you do the GET part, don't think about it as a incomplete request, but as a request to get the result of the operation. For instance, if I tell you to convert a video and it takes you five minutes to do it, requesting for a converted video two minutes later should result in HTTP 404, because the video is simply not there yet. Requesting for the progress of the operation itself, on the other hand, will probably result in an HTTP 200 containing the number of bytes converted, the speed, etc.
Apr
19
comment HTTP Status Code for “Still Processing”
@MatthewHaugen: I don't think GET is a good idea anyway in this context. You said that the request “queu[es] long-running tasks”, which should be done through POST (otherwise, you'll end up queuing the same item multiple times, or not queuing it at all). As for telling the client that the response isn't ready yet during polling, a simple HTTP 404 would work.
Apr
18
comment How to write correct loops?
@MichaelKjörling: when you use LINQ, the loop is there, but a for(;;) construct wouldn't be very descriptive of this loop. An important aspect is that LINQ (as well as list comprehensions in Python and similar elements in other languages) makes boundary conditions mostly irrelevant, at least within the scope of the original question. However, I can't agree more about the need to understand what happens under the hood when using LINQ, especially when it comes to lazy evaluation.
Apr
17
comment How to write correct loops?
I wouldn't be so assertive about the skills of OP. Making boundary mistakes is easy, especially in a stressful context such as a hiring interview. An experienced developer could do those mistakes as well, but, obviously, an experienced developer would avoid such mistakes in the first place through testing.
Apr
17
comment How to write correct loops?
Well, from your original question, I have an impression that the choice is on one hand using TDD and getting the correct solution, and on the other hand skipping the test part and getting the boundary conditions wrong.
Apr
17
comment How to write correct loops?
@CodeYogi: don't you think the interviewer would be delighted to learn that you know TDD? So why wouldn't you show that during an interview?
Apr
15
comment How costly is DB data transfer as compared to data storage?
@nprensen: beware of premature optimization. Using tinyint instead of int to store a percentage is just common sense. On the other hand, using smallint to store the PKs of the products just because you believe that your e-commerce website will never be too successful and never reach 32 768 products makes little sense. If you have to transfer billions of numbers per hour, the actual type could be a bottleneck; otherwise, there are probably more crucial optimizations to do.
Apr
13
comment Simple UI layer Design VS ASP.Net Mvc
You have explained the context, but the question itself is missing. This is a Q&A website; if you need an answer to a specific aspect of your architecture, consider adding the question. If you just need a review of your architecture and don't have any specific question, I'm afraid that this is off-topic here.
Apr
9
comment How to do an “Automatic DB monitor” and notify the client
@CA55CE37: why don't you know when the values are changed? As explained in the answer, if the database is accessed by multiple applications, so one cannot necessarily know when another one changes the data, using a common web service and a message queue would do the trick.
Mar
30
comment Should all PHP requests be centralized?
@Maurycy: if I want to change the core, I'll change the corresponding class which, through the chain of includes finds its way into the 30 PHP files which are actually serving the requests. I partially agree with the second part of your comment, although a reverse proxy can do a great job of transforming the requests when code moved from one PHP file to another.
Mar
30
comment Should all PHP requests be centralized?
“is decidedly old school PHP”: indeed, but why? I mean, if it's just fashion, it's one thing. If there are serious performance hits or an actual proof that maintenance becomes a nightmare, or some other good reason, it's a very different story.
Mar
27
comment Using multiple languages
By talking about microservices and REST, you are being too specific. More generally, every SOA approach would work, and could use both REST and SOAP. Of course, SOA is only one of the multiple approaches: there are also RPC, message queue services, etc.
Mar
24
comment How many injections is acceptable in one class when using dependency injection
@MarjanVenema: because it makes life much easier. If you know exactly the maximum LOC per method or the maximum number of methods in a class or a maximum number of variables on a method, and this is the only thing that matters, it becomes easy to qualify the code as good or bad, as well as “fix” the bad code. This is unfortunate that the real life is much more complex than that and many metrics are mostly irrelevant.
Mar
24
comment How many injections is acceptable in one class when using dependency injection
@Telastyn: not necessarily. What IoC changes is that instead of relying on static classes/singletons/global variables, all dependencies are more centralized and more “visible”.
Mar
24
comment How many injections is acceptable in one class when using dependency injection
Measuring the quality by numbers is usually as bad as being paid by lines of code you write per month. However, you included the actual example of the dependencies, which is an excellent idea. If I were you, I would reformulate your question to remove the concept of counting and of strict limit, and to focus instead of the quality per se. While reformulating it, be careful to not make your question too specific.
Mar
23
comment Why are people so strongly opposed to #region tags in methods?
Possible duplicate of Are #regions an antipattern or code smell?
Mar
19
comment Dealing with API rate limits
@AedonEtLIRA: no, it shouldn't. Stack Overflow is not a replacement for Steam support. The author should start by contacting Steam in order to have reliable information about the limitations of their API. If there is an actual limit of 15 minutes, the OP should not seek ways to violate Steam Subscriber Agreement.
Mar
18
comment Can I alter the code while adding logging?
Nothing indicates that the OP wants to log only at the boundaries of the method and not inside the business logic itself. While AOP has benefits, I find it unfortunate to see it mentioned for anything related to logging, as it was a silver bullet.
Mar
17
comment Why use Razor Syntax?
You're welcome. Also, make sure you have a good grasp of MVC itself. If you've already used MVC with other languages, check for the differences, since there could be different practices. For instance, I've seen a few non-.NET projects where MVC models contained a lot of business logic. In .NET, this is very rare. But in ASP.NET MVC, models often contain validation rules, which is not necessarily the case in other frameworks/languages.
Mar
17
comment Why use Razor Syntax?
See also: Biggest advantage to using ASP.Net MVC vs web forms as well as When to favor ASP.NET WebForms over MVC.