Reputation
2,159
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
1 7 13
Impact
~43k people reached

20h
comment Is creating a new List to modify a collection in a for each loop a design flaw?
In Java there are Iterator (works as you described) and ListIterator (works as you desire). This would point that in order to provide iterator functionality over a wide range of collections types and implementations, Iterator is extremely restrictive (what happens if you delete a node in a balanced tree? Does next() make sense anymore), with ListIterator being more powerful due to having less use cases.
20h
comment Is creating a new List to modify a collection in a for each loop a design flaw?
@ElDuderino msdn.microsoft.com/en-us/library/dscyy5s0.aspx. Don't miss the You consume an iterator from client code by using a For Each…Next (Visual Basic) or foreach (C#) statement line
Jul
26
comment ASP.NET MVC : How asp.net mvc view engine bind model and render data in html form in browser?
The framework "remembers" (or can "reconstruct") the fact that x.Name ended rendered as an input element whose id and name were "Name". When the form is submitted and the URL has a "Name" parameter, it gets assigned to x.Name. What is difficult with that?
Jul
21
comment Should client side have a log?
Only give users information about the errors/situations they may solve themselves ("your password is wrong", "You are not allowed to perform that operation"). "Connection is lost" is somewhat borderline, depending of which side has the issue. For all of the others, "Internal error" and send the log to support.
Jul
21
comment How to handle mismatched request body and content-type header?
Generic responses (without HTTP status codes) will not be understood by many clients; they will assume their message was ok and just fail to decode your answer. Worse yet, they can just send you a message and just ignore the answer ("Server answers status is 200: Ok, so my message was correctly processed; that is all I need to know")
Jul
12
comment Why can't I refer to an interface inside of generic brackets in a variable declaration?
IIRC the terms you should google are covariance and contravariance. In short words, List<String> is not an instance/subclass of List<Object> because if it were then issues arise from using the generic type instance as parameters or return types.
Jul
12
comment Is there a name for this pattern?
It is not a pattern, it is a consequence of evaluating an assignment expression with the value being assigned (instead of, say, void).
Jul
5
comment Why don't open source projects pay more attention to backward compatibility
Additionally, when I was in a business developing software for third party, testing compatibility with open source projects meant a lot of headaches because of the multitude of distros and forks. We ended settling for a policy (may it have been right or not) of just checking against the last version of several Linux versions, because "the customer can migrate to it for free"
Jun
27
comment Should you write your back-end as an API?
I have had to maintain a project where the logic was put in the UI layer, calling the same shared data structures. I have had to fix one bug thirty times because of that ("if we need to use the same logic again we will copy & paste! no need for an API"). Had been there a logic layer (now there is) it would have been enough with just one fix.
Jun
27
comment Should you write your back-end as an API?
I have had to maintain one system designed with YAGNI in mind; since it used Struts the previous developer put dependencies to Struts in almost all the code (and most of the business logic in Struts dispatcher classes). If you build a system with a good tiered design the API appears almost automatically (as the separation between presentation and business logic), if you don't then shit happens down the road.
Jun
17
comment Client-Side JavaScript Business Logic in .Net Solution Stack
Note that the point is not JS vs .Net but "on our servers" vs "on someone else's hardware". A .Net desktop client would be again the wrong solution, for exactly the same motives.
Jun
16
comment Is the semantic contract of an interface (OOP) more informative than a function signature (FP)?
Without any additional clues... maybe it is why the documentation is part of the contract?
Jun
2
comment Is there a hashCode()-like method that can be used for state checking?
You may implement hashCode so it only depends of the state, it will be still a valid implementation. It might be undesirable to use in maps (apart from being mutable) because of a possible high number of collisions. Or maybe I am missing your point.
May
26
comment Libraries and licenses
Note that many products offer dual licencing; in essence if you do not want issues from using the open source licence, you buy a "closed" licence from the developers that would allow for redistribution.
May
22
comment Where should my team start with becoming “modern”?
@omouse I was just pointing a risk that has hit myself sometimes, when doing research. Certainly I do not see that risk in the situation that you describe, but the form in which the OP describes his research ("first I started with... then I quickly moved...") made me add that caution. Note that I do not claim that the OP is not doing his assigned work properly (that is something I simply do not know, and that is his boss'job), I just warn him to make sure that he does not get too carried away.
May
22
comment Where should my team start with becoming “modern”?
@winkbrace for the boredom bit, it depends of your personality and what you are looking for in a job. It is sensible to try to land in a job position that satisfies you, rather than go anywhere and try to change the organization to your tastes. And usually big corporations (except for R&D departments) are not the place for people who likes to test a new technology each few months.
May
22
comment Where should my team start with becoming “modern”?
@winkbrace I do not claim that you should not try to improve (in fact I state the opposite). But pushing those changes without management support and without the authoritas of some seniority may be quite difficult and cause some resistence; add to that the OP not being quite an expert himself and may have troubles with the actual implementation. It would be nice if the OP could volunteer to a research/prototyping team to properly introduce changes; but barred that he should be careful in chosing the right approach to promote those and be patient.
May
12
comment In Agile SCRUM, how do you handle even distribution of work in a sprint between “experts”?
But... should the OP tell upper management that he is doing pairing and that maybe performance will be reduced (at the gain of less risk)? Or should he just do it and "hope nobody notices" (after all, who is gonna tell them how many actual men/days have been produced)?
May
6
comment What data structure would you use to represent an organic compound?
I think you should ask a chemist. They may not know how to program it, but they sure know how to represent compounds, and have though about most of the possibilities (for example, they represent bencene just with an hexagon). Also, there are some abstraction levels (a protein is described as a sequence of aminoacids, not as a group of atoms). Once you understand how to represent it in paper, the programming part should be quite straightforward
Apr
29
comment Is it okay to have objects that cast themselves, even if it pollutes the API of their subclasses?
Additionally, the example is flawed. There is a Member interface, but it only serves to check the access qualifiers. Typically, you get a list of methods or properties and use that directly (without mixing them, so no List<Member> appears), so you do not need to cast. Note that Class does not provide a getMembers() method. Of course, a clueless programmer might create the List<Member>, but that would make as little sense as making it a List<Object> and adding some Integer or String to it.