Reputation
2,444
Next privilege 2,500 Rep.
Create tag synonyms
Badges
6 13
Newest
 Yearling
Impact
~47k people reached

Apr
29
comment How much commenting is better for coding?
+1'd : I'd also include comments for documentation generators like sandcastle and phpDocumentor that can be used by IDE's to give useful hints to consumers of your function (even if that consumer may be you, five years from now).
Apr
29
revised Approach for inserting rows
Added PostgreSQL as per Bent's comment.
Apr
28
answered Approach for inserting rows
Apr
24
comment Does a license need to go at the top always?
@Phantom - what's the problem with creating a new file? If nothing else it keeps the imported content apart from your code should you want to keep up with changes in the original project.
Apr
20
comment How to write correct loops?
@Wildcard +1: "Show me the code" is, to me, an excellent indicator as to why this answer is right and that maybe I need to work on ways to better demonstrate that it's a human-factor / design problem that can only be addressed by changes in the human process - no amount of code could teach it.
Apr
17
revised How to write correct loops?
Updated example from Java to JScript thanks to Jules' feedback.
Apr
17
comment How to write correct loops?
@CodeYogi - you have and as pointed out by others you have broken the problem into sub-problems rather poorly, which is why a number of answers mention your approach to solving the problem as the way to avoid it. It's not something you should take personally, just experience from those of us who have been there.
Apr
17
comment How to write correct loops?
@Jules - the point was to illustrate that the languages offer ways to do what we need them to and it makes sense to investigate them rather than reinventing the wheel but I do take your point. In fact arraycopy would probably not be great either as we'd want to copy part of an array into itself which could have some fun consequences depending on the implementation, but that would be heading to chat territory.
Apr
17
comment How to write correct loops?
@CodeYogi ...and since you ask, I rarely get my looping and branching wrong because I make a point of having a clear understanding of what I need to achieve before I write code, it's not hard to do on something simple like a sorted array class. As a programmer one of the hardest things to do is concede that you are the problem, but until you do that you won't start writing really good code.
Apr
17
comment How to write correct loops?
@CodeYogi If you're having to do 'trial and error' and you're 'getting frustrated' and 'making the same mistakes' with your coding then those are signs that you didn't understand your problem well enough before you began writing. Nobody's saying you didn't understand it, but that your code could have been better thought out and they're signs that you're struggling which you have the choice to pick up on and learn from, or not.
Apr
17
comment How to write correct loops?
@MainMa - I think while Mark could have been more sensitive, I think he's right - There's interview stress and there's just hacking code together without due consideration to defining the problem. The way the question is worded points very strongly to the latter and that is something that can best be solved in the long term by making sure you have a solid foundation, not by hacking away at the IDE
Apr
17
comment How to write correct loops?
@BryceWagner - Absolutely true, but without a clear idea of what problem is that you're actually solving you're going to spend a lot of time thrashing about in the dark in a 'hit and hope' strategy which is by far the OP's biggest problem at this point.
Apr
17
answered How to write correct loops?
Apr
5
comment Why is XML called a “language” exactly?
Minor nitpick - "...in 1969, together with Ed Mosher and Ray Lorie, I invented Generalized Markup Language (GML) " according to Goldfarb (source: sgmlsource.com/history/roots.htm)
Apr
3
comment Why is XML called a “language” exactly?
programmers.stackexchange.com/questions/88405/… contains the answer: because the people who named it had a vote on various names and XML won.
Apr
3
comment Why is XML called a “language” exactly?
@MrLister - It's worth pointing out that XML (like HTML) borrowed heavily from SGML which borrowed heavily from IBM's GML (generalized markup language) which dates to the 60's. Having the ML demonstrates that there is some relationship between those languages. Plus given the dates involved, the definition you use for what denotes a language in computing is something that has changed to a great extent since the use was coined.
Mar
14
comment Is Model a better place to set HTTP status code?
@imel96 "But a lot of HTTP status codes are part of business logic ... right?" WRONG. No part of the business logic should be aware that it is operating as part of a web application, which means returning any HTTP status information from the model would be utterly inappropriate. As a rule of thumb, consider your model as if it were a separate dll to be reused in multiple types of application, not all of them HTTP based.
Mar
10
comment What is faster? Using REST API or querying a database directly?
-1. While there's no "need" to create an API, not creating a DAL often leads to enormous pain should a change of database backend be required. Also no reason why if you have the DB "offline" that the Rest service couldn't be made available there too.
Mar
5
comment Database error prevention
An XML Schema ought to be able to enforce rules like that. Not especially useful unless your database is abstracted behind a web service or something.
Mar
2
comment Trust .net compiler after Microsoft updates
It may also be worth mentioning that the .Net compilers are non-deterministic and have been for as long as I can recall So the same compiler, source etc running on the same machine is likely to yield subtly different results for each compilation.