|
Ta.
Dare say there will be some story about it on elReg soon.
|
|
|
|
|
Perhaps this[^] is also affecting things on that side of the wet?
TTFN - Kent
|
|
|
|
|
|
I did not know this:
Concatenating a null string is legal[^]
This works:
string s=null;
s+="Hello World";
Oddly (as someone in the link above points out):
int? i = null;
i+=1;
results in i==null.
Interesting stuff. Sort of rubs the fur the wrong way.
(BTW, those that replied to my best practice question, I'll get back to you soon, the responses are awesome!)
Marc
|
|
|
|
|
Seems like string is a special child for microsoft
Tim Toady Bicarbonate
|
|
|
|
|
Or we could make it an option[^]
It's an OO world.
public class SanderRossel : Lazy<Person>
{
public void DoWork()
{
throw new NotSupportedException();
}
}
|
|
|
|
|
The int? behavior is the expected one. When an int? is null, its int equivalent is 0 (int's default). Since string is a reference type (with some value semantics), you'd expect its default to be null (which is so), but for concatenation they changed it to default to String.Empty. Although it does make sense to do it that way as the most useful behavior (for most or all scenarios).
|
|
|
|
|
Nish Sivakumar wrote: When an int? is null, its int equivalent is 0 (int's default).
Which is why I don't understand why i+=1 != 1 in that case.
Nish Sivakumar wrote: Although it does make sense to do it that way as the most useful behavior
I don't know -- I would think it should throw a null reference exception. Though now that I think about it, I think other places, like in printing to the console, a null string is also handled as an empty string.
Marc
|
|
|
|
|
Marc Clifton wrote: Which is why I don't understand why i+=1 != 1 in that case.
Ah, missed that. Yeah that does seem rather counter-intuitive.
|
|
|
|
|
A string is an array of char.
An empty array has an assigned memory space of the structure of the array with a null stack, adding a char to an array adds the value to the array.
A null int is a variable without a memory space.
|
|
|
|
|
Marc Clifton wrote: Sort of rubs the fur the wrong way.
The thing that rubs me the wrong way in PHP is this...
<?php
for($x=0; $x<10; $x++)
{
$a = $x;
}
echo $a;
?>
Or...
<?php
for($x=0; $x<10; $x++)
{
$aa = $x;
}
echo $a;
?>
Now I like how PHP handles types and variables to make things easy, but ya know this is taking it a bit too far.
Jeremy Falcon
|
|
|
|
|
I've been doing a lot of wordpress work, which I consider a pretty solid product, my wife has a web design firm that I help out with. I think they nailed a CMS API that is really easy and straightforward to customize. HOWEVER, I f$#@$ing hate PHP.
My day job involves a lot of Javascript (and WebForms) and I chose to start using AngularJS, which is a framework that seems to pick the default option that I would have picked which is awesome. PHP picked the opposite direction at every turn, except they have a decent associative array that everyone uses, that is the saving grace.
|
|
|
|
|
Andy Brummer wrote: HOWEVER, I f$#@$ing hate PHP.
Ironically, I think it's a fantastic language. On the web, I'm a total Unix person, so it's Unix-y roots are appealing. It has a TON of functionality. It's fast. And it's dumbed down just enough for most people to use it with relative ease. But sometimes, just sometimes it would be nice to have to declare a variable.
Andy Brummer wrote: and I chose to start using AngularJS
I was looking at that, but still not clear on exactly what it does. I'm assuming it's like jQuery but instead uses it's own DOM right? From what I know it's supposed to be nice to manage client-side state with right?
Jeremy Falcon
|
|
|
|
|
Angular isn't like jQuery. jQuery makes a few things easier and consistent. It adds a few functions that makes many things easier to build.
AngularJS is a complete framework that completely changes the way you write interactive pages. It includes client side templating, 2 way data binding, routing, xhd wrapper, animations through attributes, and a whole host of other features. I normally hate frameworks because they end up making the easy stuff a little easier, and the hard stuff impossible. I haven't run into that with angular.
|
|
|
|
|
I can live with the nullable int example. In my opinion if something starts as a null value then it can only have a new value by a specific assignment.
But then what about this:
int? inotnull = 1;
inotnull += null;
Inotnull ends up as null. Now that is counter intuitive IMHO.
Peter Wasser
"The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." - Bertrand Russell
|
|
|
|
|
A major difference between the two examples is that you are comparing a number to an array.
A string variable is an array of char, a null array is different then a number without an assigned memory space.
|
|
|
|
|
|
Now, before start off, here are few things to make note of:
1. You cannot call it bad just because of content. If that was the case, you should dislike CP as well considering amounts of rants about Q & A here.
2. If you have had a bad experience with random friend request, it is not FB's fault.
3. If you are annoyed with game requests, you should consider choosing FB friends carefully rather than blaming FB.
4. If you think content there is just idiotic, remember it is not just for people like you. Kids to old people use it. There will be everything there. Again you need to choose what you want to see.
5. If you do not like their UI, for few things I am with you.
|
|
|
|
|
I don't know about anyone else, but for me... As with so many "Web apps" (including this one), it just keeps changing for the sake of change -- you never know what the UI will be from one visit to another.
You'll never get very far if all you do is follow instructions.
modified 19-May-14 14:45pm.
|
|
|
|
|
|
I prefer to pick and choose which changes I get (and when) rather than have them shoved down my throat against my will.
You'll never get very far if all you do is follow instructions.
|
|
|
|
|
for software I pay for I agree with you. This is software that is paid for by the advertisers. I think we forget that the users are NOT the customers for Facebook. They are pandering to exactly who they should be pandering too.
I don't like FB that much either. But I am on it. Mainly because my kids are on it and I need to keep a close eye on them.
To err is human to really mess up you need a computer
|
|
|
|
|
I'm not a hater of anything, but I generally dislike online services, be it FB or anything else, because:
a) They appear and disappear at random. You never know when something you like is suddenly gone.
b) When they disappear, you typically get a very short window to grab your data, if you want it and it's your only copy.
c) Privacy policies change at will.
d) UIs change at will.
It is easy to say that if you're not paying, then you're not the target, just the product. But this implies that if you were paying, then your voice should be important.
That leads to two questions:
1) Are paid services really any better, or do they just do the same stuff anyway?
2) If there is no option to pay, then how do you get a service that is what you want, where you are the target and not the product?
I don't want to be a product, I want a service that is useful to me. I don't find it useful to me for random changes in UI or anything else. I don't need and don't want services I can't rely on. As a result, I use very few online services. Most of the stuff that crops up, I just don't care, any more than I care about the lastest javascript framework of the hour.
For some services, like email, I want services that are like a wrench - it was a 15mm silver wrench 5 years ago, and it's a 15mm silver wrench today. Same colour, sits in the same box, does the same thing. Why on earth do I need new shiny features in my email? It's such a basic thing, it should rarely change.
Sometimes things are done just right. A great example of doing it right is online banking. You pay for your online banking thru fees, you are the target, your feedback actually goes into the next version. They do a big change maybe once every 3-5 years, and otherwise stay the same, it's more like a desktop boxed product. And that upgrade is actually better by any reasonable definition, not just shiny and cool and glittery. This is exactly what I want - I'm just paying bills and tracking my expenses, the same stuff I was doing 5 years go with online banking. And I don't get damned ads pestering me every frigging visit.
For free services, I like CP for the same reasons. I just use it to follow articles on the news section about quasi-programming related stuff. Works pretty much the same as it did when I started, get a list of articles, pick a few, read them.
Why is it so hard to find more services like this? Why do they all have to obsess over glittery coolness and one-upping each other like schoolyard children? I don't give a s**t about the latest animation techniques when using a service. I want substance over form any day.
Is it just me, or do others here feel the same way?
|
|
|
|
|
|
bantling: i just want to applaud your insightful and well organized thoughts about the economic tradeoffs between free and paid services.
|
|
|
|