The worst thing is that it is probably a global variable (disguised as a non-static "field" shared by public methods) which is just set somewhere else and possibly at some different point of time.
Lutoslaw
Posts
-
I think my WTF per minute counter just overflowed... -
Something's missing... (WCF and WF forum)Another missing thing is the Soap Box. The "Posting rules for The Lounge" links to it, though.
-
Why oh whyGot a new job. And also a serious case of déjà vu. - Hey, I've cloned a repo and managed to compile the project. Just wondering... where are tests? - Well, look for it... (...) - So, the client didn't want to pay us for tests. - And for last three months you've been doing nothing but bug-fixing? - Pretty much. Look, we all know what you mean, but in the end of the day it's up to the financial department. They pay me for my time. If I'm wasting it on doing shish because of their bad decisions, it's not my problem. I just... gave up. It's all the same everywhere. :~
-
reading text file as an array by using streamreaderMember 14571520 wrote:
MandW = new matrix(x,2); /* Mass and Weight Matrix*/
Unless
matrix
is an actual class name, I think you wanted something likeMandW = new double[x,2]; /* Mass and Weight Matrix*/
Class names should by UpperCamelCase. Also I'm not sure if you should call Read() in a constructor... let external code decide when does it want to do this
-
what is CAT programing ? can anybody help me?$ cat mouse > /dev/null
-
Images gone from an article published on 23 Nov 2009Uh, now I see them too in all browsers. A weird glitch that was indeed.
-
Images gone from an article published on 23 Nov 2009Huh? How is that possible? Actually... I've just opened the site in Tor and I see them too. On Edge, there are two of them, and there is a placeholder in a place of the third one (with a label "Image 4").
On Chrome, there is only one (after cleaning cache and refreshing CTRL+F5).
...I've just noticed that they are lazy loaded. Might that cause a problem?
-
Images gone from an article published on 23 Nov 2009Well I know it's kind of old... but anyway: the article with 2 of 3 images missing: Data-controlled Processes Application Design[^] google cache version which still has all images: Data-controlled Processes Application Design (cached)[^] The article is more about a theory than technical details, so it's not as obsolete as it seems. The diagrams are essential, though.
-
Stupid user tricks (double-click = double postback)grralph1 wrote:
However this system was a shared station that is in each outlet. So all users in each outlet used the same machine for the function that it was designed for.
grralph1 wrote:
Faster, Higher, Stronger or Stupid.
I mean, some of them might be stronger than others. Pro tip: Maybe some testers should get high too.
-
XOR is for the weakIt's java.
-
XOR is for the weakSander Rossel wrote:
Actually, I don't think the code is that bad. I think a lot more programmers can read that than an XOR, which is far from common in C#.
OK so I don't need to duck & cover if I say that I have left it as it was? :-O
-
Node.js : Non-blocking thingEddy Vluggen wrote:
This might be news, but CodeProject has more .NET related articles
Well now it's Code Project: For those who code. But when I joined the community back in 2005 it was Code Project: Your Visual Studio and .NET home page. So yeah maybe it roars like a lion now, but nonetheless still a kitty inside.
-
XOR is for the weakTBF it's an IDE's "autofix". I've written a condition:
isValid = (someAreaId != null) ^ (longitude != null && latitude != null);
if (!isValid) { ...Which literally translates to "either someAreaId is not null or both coordinates are not null". This is a required business logic and it doesn't seem to be a way around it. And then I got a "simplify boolean" and "inline variable" quickfixes. If you pass the initial "WTF" feeling, then it starts to make sense.
-
XOR is for the weakpublic class SomeLocationData
{
// fields...public SomeLocationData(Long someAreaId, String longitude, String latitude) { if ((someAreaId == null) == (longitude == null || latitude == null)) { throw new IllegalArgumentException("Either someAreaId or coordinates must be specified."); } // ... init fields
THAT CHECK. :cool:
-
Readable code, taken too far (too Swift)?My point was that language designers spent time to add a future which enforces some stupid rule on developers, instead spending that time implementing an IDE plugin which does the job (likely faster and better than developers anyway). Because everybody uses IDE nowadays, right? Uhm... wait. And for the recored, no-single-liners and no-assigment-in-comparison policies suddenly started to make sense... idiots.
-
Readable code, taken too far (too Swift)?Why Apple? Idea is Jet Brains'.
-
This code is evilWell,
object->method()
could be a recursive call so it's not that bad. -
Readable code, taken too far (too Swift)?IMHO it's requiring coders do what's basically IDE's job. See the "Parameter name hints" in this Idea manpage: View code reference info - Help | IntelliJ IDEA[^]
-
Win10 Strikes again: More Bad (new) UI/UX...seriously? Not saying that I know every XKCD comic, but I totally do... and that solution reminds another one: xkcd: Command Line Fu[^]
-
English spelling for beginners...I learnt two new words today, both medical (I'm not native)! :) At first I though that "phthisis" is a misspeled "phthitties".