Reputation
4,360
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
1 12 21
Newest
 Yearling
Impact
~130k people reached

Jan
17
awarded  Yearling
Jan
7
comment How to create a manager class without global variables nor singletons?
@LegendLength - In software; names matter, a lot. It really isn't just what you called it. If you choose the proper names then decisions become much easier; new people learn the system much, much, much faster; you won't have to spend days relearning what you did 6+ months ago when they decide your app is worth updating. If you give an object/module a concrete name then it is clear what that module should and shouldn't do. If you tack on the word manager, then all of a sudden anything even tangentially related is valid to throw in the pile. So instead of 1 place to look, you'll have dozens.
Nov
18
comment How narrow or broad should constant names be?
All good points for enhancing the answer but for me the main takeaway was "Will the constant name...make it immediately obvious what it means". That "is" the answer to the OP's question.
Nov
17
comment When are enums NOT a code smell?
@Jules - "If you're sure a new tick type will never be added..." That statement is wrong on so many levels. A class for every single type, despite each type having the exact same behavior is about as far from a "reasonable" approach as one could possibly get. It isn't until you have different behaviors and start needing "switch/if-then" statements where the line needs to be drawn. It is certainly not based on whether or not I might add more enum values in the future.
Nov
12
comment In general, is it worth using virtual functions to avoid branching?
Your question misses the entire reason behind using virtual functions. If all you care about is speed then don't use functions, and don't use if-then. Don't branch if possible, copy and paste often, repeat and rinse this process over and over. That method will generally result in faster code. However, be fully prepared to spend lots of time debugging applications because of missing conditions and bug fixes as new functionality is added. Which, BTW, avoiding those issues is the reason for using virtual functions.
Nov
12
comment Requirements and Documentation in Agile
What you are doing is fine, with one variation that have made waterfall-like projects work quite successfully for decades. You do the requirements and top-level design and estimating like you have been doing. Instead of having one delivery at the end, you define multiple deliveries/iterations. It gives the customer something to play with earlier and you time to change direction (if needed). It helps avoid the rework that agile frequently incurs. IOW, use waterfall similarly to what agile proposes. The successful waterfall developers have been doing it this way long before agile was conceived.
Nov
10
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
@DavidArno - Having code that is easy to understand and is well tested doesn't do me much good if it doesn't work the way I need it to work. Thus, "It works" can never be removed from the #1 spot. But I totally understand how "it works" can be abused because that is the main reason used by people who just hack stuff together. Unfortunately, despite a desire to not have "it works" as #1, there is no other option. An ugly ball of mud that does what it is supposed to do is better than a beautifully architected, well-designed and easy-to-test masterpiece that can't do what it needs to do.
Nov
10
comment Using compound statements (“{” … “}” blocks) to enforce variable locality
@DavidArno - it depends on your goal. If ease of understanding is a goal then lots of small classes is absolutely not the way to go. Having had to lead teams in the past when transitioning them from non-OO to OO development I can make that statement with 100% certainty of its truth. It just so happens that I have a list of desirable attributes in software. #1 - It works. #2 - It is easy to understand, are the top 2 choices. So while SRP may be an often preached mantra, that mantra is purely a naive view that at best is just a guideline. Certainly not worthy of using the word "Principle".
Nov
9
comment UML class diagram symbol for a top-level function
The answers below are good. However, rather than call the class or stereotype "global" I think "StandaloneFunction" is better as it is very explicit to your intent. With that said, IMO even better would be to put the "top-level" functions in a well named namespace which allows for organizing of the functions and then gives you a class to put them in. Thus, putting the function in a namespace called UrlUtilities is far superior to just having this be a "top-level" function. But then again, at this point you may as well put it in a UrlUtilities class as a static method which is the best option.
Nov
3
comment UML: Should an asynchronous request-response message exchange be modelled as two ports/interfaces or one
@Claude - I don't want to sound antagonistic because I am not trying to be. I am truly trying to understand your thinking because maybe I will learn something. With that said: I see how the different diagrams could have different goals but with the example, what useful information do you hope to convey with the component diagram that wouldn't be more usefully conveyed in a sequence, collaboration or even activity diagram? By "useful" I am referring to being of benefit to the designer/programmer. (ie. the people that will actually use the diagrams)
Oct
29
comment UML: Should an asynchronous request-response message exchange be modelled as two ports/interfaces or one
I can't say that I've used the component model for these types of diagrams. And in looking at the diagrams, I can say that I never will. Where's the value over sequence diagrams? You are eventually going to create a sequence diagram covering the same information. It seems like double work to me. What am I missing? Anyways, I use option 1 in my sequence diagrams.
Oct
28
comment Is it always possible to separate multiple conditions in an IF statement into individual statements?
"if (foo or bar) then action" is not equivalent to if (foo) then action if (bar) then action. If both foo and bar are true the your example calls action twice.
Oct
28
comment UML: Should an asynchronous request-response message exchange be modelled as two ports/interfaces or one
IMO, unless you are going to jump through all the hoops to attempt to create executable models then your diagram is supposed to help explain how the system works. Thus, it seems obvious to me that initiating commands and their responses are most easily understood when in the same diagram. How you implement that in code is another matter entirely which depends on your architectural design. A single method call with the response as the result means the caller is going to block. This may or may not be desirable in your system.
Oct
22
comment Explaining concepts
You are calling it a "property title" which connotates that your co-worker is misusing the field. Is that the actual name of the property "Title"? If not then is it possible that you are viewing the property "title" as simply a title while your co-worker views it as a "key". In that case, your co-worker isn't wrong. If that's the case then you are both right and both wrong at the same time. That's why it is a good idea to write a data interface document when multiple developers are exchanging data over an interface. If you had that then at least one of you would have been obviously wrong.
Oct
15
comment Exception to the 'Nested types should not be visible' rule?
From the description it seems like TandAOLLGroup has a dependency on TandAOLL. Likewise, TandAOLL has a dependency on TandAOLLGroup. IOW, a circular reference. Circular references are really bad because a change in either class can break everything that depends on the other class in addition to what depends on the class that changed. There's always a better way than to do circular references.
Oct
15
comment Interface Design: Specific vs General parameter (A Minimal design vs anticipated use variation)
So what is stopping you from creating a IWarrantyPopup interface that contains only the information you need?
Oct
15
comment Exception to the 'Nested types should not be visible' rule?
Now all you need to do is fix the circular reference issue which is a bigger problem than your original.
Oct
15
comment Creating menu structure using DB - is that fine?
While I agree with Michael's "Never" comment, I think where Prc was going is that this sounds like a really clear case of "Over-Engineering". It is taking a simple problem with simple solutions and making it convoluted. I can guarantee with almost 100% certainty that this approach will turn into a maintenance nightmare once the original developers are off to greener pastures. With that said, there may be situations where the database approach is the only one that make sense, but I'd consider that the last resort option, not the "going into" initial plan.
Aug
20
awarded  Famous Question
Jul
13
comment Determining game item prices based off of player trades/in-game economy
Not that gbjbaanb's answer isn't good, but it is generally a good idea to wait a few days before accepting an answer in order to encourage more answers. Once an answer has been accepted then people tend to not add their own answer unless they feel particularly strongly about their own opinion.