Reputation
419
Top tag
Next privilege 500 Rep.
Access review queues
Badges
2 12
Newest
 Yearling
Impact
~5k people reached

  • 0 posts edited
  • 0 helpful flags
  • 71 votes cast
Jul
30
comment When should I instantiate a variable rather than grabbing it through a method?
Looks like a getter. My guess is getColumnCount returns the value of a private field in the meta data object rather than doing any strenuous.
Jul
29
comment How to avoid god controller classes and keep single responsibility principle?
You're trying to create an OOP migration script!?
Jul
13
comment Why are datatypes different in terms of bit size based on complier, and OS used
stackoverflow.com/q/589575/1734730 read that
Apr
21
comment provability of while loop vs for loop
For(;;) { cout<<"they're really not that different" <<endl;} . The biggest difference is that for loops let you easily keep a variable (i) at the scope of the loop.
Mar
22
comment Algorithm that generates a group of men and women who are each interested in everyone from the other gender
I might use an elastic search tool like lucene. Tag people with these fields (what they require and offer) and search on the basis of this later. May not work, but worth looking ar.
Mar
20
comment Why does C++11 developers prefer space before colon in range-based for loops?
The ":" and ";" are very different things. It's because the ":" is a binary operator here. It's a typical convention that unary operators lack spaces and that binary operators are given spaces. Some people hate spaces, but few hate only the first space and would write "x> y", or indeed "i: list". As for semicolons, they are statement terminators, so it's unsurprising they are treated as unary ops on a statement. However, you are no means bound by such rules, you can even write stuff like "x --> y" and the compiler won't mind.
Mar
19
comment Static functions vs classes
In this particular case I would say average was a reasonable method to invoke on any collection of numbers. So you could end up just giving all your number containers new names with a bit more functionality. Sounds like bad return on effort. This is what extension methods are for in c#, in java you're stuck with statics.
Mar
19
comment Static functions vs classes
@s4m. I think simple non-miscellaneous static classes fine and maybe the best choice for now (shame that java lacks extension method btw). But a "statsservice" isn't silly either. I could imagine having the need to change Average from mean to median to trimmed mean at runtime. I can ready imagine maths operations on lists of ints that produce entropy and would require a service for testability.
Mar
16
comment Should we estimate tasks during backlog grooming?
The problem is that if you can't estimate, then you can't decide the sprint commitments. At that point command and control management has murdered agile and is wearing its skin as a trophy. The core of agile is trusting good people to get on with it and the involvement and engagement of the team in delivery, not whiteboards, chairless meetings or jargon
Mar
16
comment Should we estimate tasks during backlog grooming?
@daveHillier exactly. Also "agile" isn't a particular methodology. Was it meant to be scrum for example?
Mar
16
comment Should we estimate tasks during backlog grooming?
Yeah. Nice cargo cult agile process you have there, but without the pesky self organising teams. Also sounds like putting this much effort into the backlog isn't very lean.
Mar
10
comment When do programmers use code first approach?
@jeffO sometimes, but it can be the other way round. Is the database key to your application, or do you just need to persist some. Net objects. You could probably replace a lot of code first DBs with (cheaper) object stores.
Mar
8
comment Can you “stop” a C program from being reverse engineered?
@JörgWMittag Have a bit of a browse on CodeGolf:SE and you may reconsider. The raw instructions must be recoverable, but the meaning and structure are harder to resolve.
Mar
3
comment Should code comments explain the control flow?
Explain other classes' implementations/intentions in the dependency. That's the S in SOLID we've just violated (to the extent comments count for anything) and it's those types of comment that are going to go stale. Make it clear what you're doing and comment your intentions in every method and it should fall into place.
Feb
19
comment c++11 random: why different range of int and real?
I think open intervals make more sense in the continuous setting in statistics since the probability of any one point is zero the difference melts away. However, since we are programmers and actually mean a fine grained discrete settings, yeah maybe half open is more natural, don't really know. Just my tuppence worth.
Dec
17
comment Are all magic numbers created the same?
@whatsisname It's an example. It's a nice equation with two well known constants. In a world where pi was exactly 3 I would prefer pi. I will agree there is a limit. If I'm manipulating bytes internally I'm not going to constant out numbers like 8. However, if was was converting file sizes I would. It depends on how business logic-y stuff is. I think Doval makes I good point in regard to the OP's example, but this answer is still misguided.
Dec
17
comment Are all magic numbers created the same?
No. A comment like the one in your "better" example is a massive red flag. It's code that doesn't even pass the readability test of the person writing it at the time. I'll give an example. e^i*pi = -1 is far more explicit (better) than 2.718^i*3.142 = -1. Variables matter and they're not just for common code. Code is written for reading first, compiling second. Also, specs change (a lot). While the 1024 probably shouldn't be in config the 3.5 sounds like it should be.
Dec
9
comment Using reflection vs creating a new class
Your friend is right. He is so completely right I doubt I can get to a real keyboard before someone else explains why.
Nov
20
awarded  Yearling
Oct
9
comment Choosing a Programming Language Systematically
@Robert Harvey Ahhh. Good point. I hadn't really counted a javascript, C#, SQL project as "multi-language" because it's minimal and all of it has purpose. I would say there's still a cetral point to what I said.