|
Is the UK still in the EU?
|
|
|
|
|
public class SomeLocationData
{
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.");
}
THAT CHECK.
|
|
|
|
|
That's the most horrible thing I've seen today.
Regards,
Rob Philpott.
|
|
|
|
|
TBF 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.
|
|
|
|
|
Looks like a buggy check... what if all 3 are specified?
That's will throw the error, that's what!
|
|
|
|
|
I think that's what it's supposed to do.
Either one or the other needs to have a value, not both and not neither
|
|
|
|
|
well perhaps.. but then the error message is misleading!
|
|
|
|
|
How is
Either someAreaId or coordinates must be specified.
misleading, it doesn't say AND?
|
|
|
|
|
Mmm.. maybe the nuance of English are lost on me.. not being a native...
This message doesn't seem to imply to me that it is wrong to have both condition true...
|
|
|
|
|
It's the very definition of "either... or..." (a.k.a. XOR)
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#.
|
|
|
|
|
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
Sander 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?
|
|
|
|
|
|
|
Ouch!. My bad. Thanks
modified 23-Jun-22 21:01pm.
|
|
|
|
|
It's old school rock!
I remembered how to MessageBox (in Client) some texts on ASP.NET...
protected void ShowMessage(string message)
{
string msg = "alert('" + message + "');";
base.ClientScript.RegisterStartupScript(base.GetType(), "jsShowMessage", msg, true);
}
Yeah!
|
|
|
|
|
Has anyone played with Outerrnet/Othernet? What were your experiences with it?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Out of this world!
[EDIT] I just realised it's a real thing!
Were you asking about it?
|
|
|
|
|
looks like just another version of NAS over wifi
=====================================================
The grass is always greener on the other side of the fence
|
|
|
|
|
I HAVEN'T MESSED WIH nas EITHER. dID YOU ACTUALLY USEoUTERNET? OR JUST READ THE WEBPAGE?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
If you are interested in crashing software projects, be prepared to invest some time:
“Anthem is the game you get from a studio that is at war with itself,” said one former BioWare developer.
kotaku.com/how-biowares-anthem-went-wrong
"If we don't change direction, we'll end up where we're going"
modified 5-Apr-19 9:40am.
|
|
|
|
|
BioWare
The saddest part, as we all know, is that management gets golden handshakes while the developers get the blame (and mental issues)
|
|
|
|
|
I had a "trouble shooter" CEO come in to a company I was managing at. Part of our management incentive was an annual retention bonus. The company was in trouble due to insane management decisions (and likely fraudulent activity at HQ), but the retention bonus helped keep the churn down. Now we all knew that he had a $5 million bonus waiting if he made it two years and that SOB had the nerve to cancel the retention bonus explaining "no one should get a bonus for showing up to work."
That was a very quiet management meeting - I think we were all waiting to see if a) he was joking or b) lightning would strike. lol
Commence hemorrhaging leadership team and most of the developers.... end of company
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
|
Both these designs suck big time, especially the Mac, but it only has a slight edge in ugliness over the Windows 10 one! The Windows XP calculator is way better than either of them (or even the Windows 7 one).
- I would love to change the world, but they won’t give me the source code.
|
|
|
|