Reputation
2,749
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~83k people reached

Jun
23
comment is JS a gradually typed language?
JavaScript is dynamically typed. TypeScript is a gradually typed JavaScript dialect.
Jun
17
comment Constructors, Ignore Arguments
As an alternative you could consider some kind of builder of factory.
Jun
17
comment Constructors, Ignore Arguments
You can use optional parameters and overloads as with every other function. But only the last parameters can be optional, so only making type optional doesn't work. If both type and doors are optional, you could use named parameters to only specify doors but not type.
Jun
16
comment static or non-static, that is the question?
1) I'd make this a method of ReportCard. If you need this on the student, you should forward the call to ReportCard. 2) You should use a generic averaging method which takes a sequence of numbers and outputs a number. Such as Enumerable.LINQ 3) I wouldn't use float on the report card. Either go with decimal or with integers representing fixed point numbers.
Jun
16
comment static or non-static, that is the question?
Your function is called median but computes the arithmetic mean/average.
Jun
13
comment Why/how does Java use a controlled mechanism to pause threads for GC?
Perhaps they want to avoid suspension at arbitrary points in the code. With code the suspension can only happen at a few well defined points.
Jun
13
comment Why/how does Java use a controlled mechanism to pause threads for GC?
@delnan On windows there is SuspendThread
Jun
11
comment How to name a method that both performs a task and returns a boolean as a status?
This kind of exception handler is rarely a good idea. Only catch specific exceptions you're expecting, not all of them. And if possible avoid throwing it in the first place, eliminating the need to catch it.
Jun
11
revised Shortcomings of using dynamic types in C#
edited body
Jun
10
comment Snapchat clone: How do I secure pre-downloaded notifications so that they cannot be opened outside of the app?
You're trying to solve the DRM problem which can't be solved with software. You can only throw lots of obfuscation at it and pray.
Jun
10
comment What are the differences between a while loop and a for loop?
Which language are you talking about? In pascal your argument has some merit (hardcoding a large number as limit is ugly), but in C you can use arbitrary conditions with for. No difference between for(;xxx;) and while(xxx).
Jun
10
comment What are the differences between a while loop and a for loop?
Which languages are you talking about? C style? In pascal for loops are quite different from C for loops and in some other languages for also allows you to write for each loops.
Jun
7
comment Should you keep a copy of all the code you write?
Related article: Did Goldman Sachs Overstep in Criminally Charging Its Ex-Programmer?. This is also a good example that even if you win in the end, the legal battle itself can hurt a lot.
May
24
comment Refactoring a 1500 LOC method that only builds the graphical UI
One thing I'd change is separating the static setup from the dynamic state.
May
23
comment Why are strong names optional?
Most programs should not be installed into the GAC in the first place. So there is little reason for strong naming in those programs.
May
22
awarded  Nice Answer
May
18
comment Terms in conditions in installer or is on website ok
One important point for including them in the installer is that it's clear which version of your ToS / EULA your user agreed to.
May
16
comment Coding: conciseness/efficiency vs readability
I hope the SecondToken function is a joke.
May
14
comment c# naming - What are common conventions for a suffix to distinguish between read-only and writable interfaces
@KChaloux The latter is a wrapper and can still change its contents through the underlying collection. So it's only readonly, not immutable.
May
14
revised c# naming - What are common conventions for a suffix to distinguish between read-only and writable interfaces
added 15 characters in body