|
It's like the old "Why do we park in driveway and drive on parkway".
In other words, "Because".
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Well now you're getting into American / British English again, and look where that got us in CCC today! I've never driven on a parkway in my life (not knowingly, anyway...)
|
|
|
|
|
A parkway (in NY, at least) is a road designation, typically but not certainly, a highway) that does not allow commercial vehicles. Essentially cars only.
The original plan also had a lot of trees involved, making them a rather pleasant place to drive, visually (traffic notwithstanding).
As for UK vs US English. We are on this side of the Atlantic. Just another pleasant reminder that we have 3000 miles to separate us from the soccer hooligans and "The Guardian" - so embrace it!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Cheers, wasn't aware of that meaning of "parkway". I can't see it catching on over here (the concept, not the word) - there'd be endless arguments over the definition of a commercial vehicle. Where I live there are rules that prevent commercial vehicles parking in certain places overnight, and that causes no end of problems. (e.g. freelancers who use their only vehicle as their "car" yet it's a van; or people who drive half-cabs / pickups because it suits their lifestyle etc.). Presumably if you break down on a parkway you have to push your car off??
Wish I was separated from the Grauniad [sic] by 3000 miles...
|
|
|
|
|
NY State, at least, makes it pretty clear. No trucks, a pickup, though, is a personal/family vehicle (see "redneck"). Now any vehcile can become a commercial vehicle by getting commercial plated instead of passenger plates. They differ by the big word "commercial". If you have those plate, even on a car, your out of luck (if they notice and stop you). Motorcycles are aloud. Cars with trailers (like a U-Haul or boat) are not allowed).
Now as for emergency service - such commercial vehicles are allowed when needed to attend an emergency - they're classified as emergency service vehicles and so common sense reigns (or rains or reins, if you prefer!).
Anyway - bring the classification before parliament and you will keep them busy enough to prevent them from doing other harm, elsewhere.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
then wouldn't skittles skip?
To err is human to really mess up you need a computer
|
|
|
|
|
|
Because when they miss, the manufacturer can point to the name as a disclaimer.
|
|
|
|
|
And why do we always refer to a "near miss" when we really mean a "near hit"?
|
|
|
|
|
What is the love affair with var? I see sample code where they do something like
var url = "http://someapi";
This feels lazy to me but I am open minded and am curious if I am missing something. Is there some benefit to declaring most things var instead of what they actually are? In the case above, a string.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
The only benefit is that if you don't understand types then there is a chance your code will work using var even though you don't know why. Also I've found some common style tools dictate you should use var. I don't mind it for
var name = "Blah";
or
var people = new List<Person>();
but I hate it when people use it for things like
var data = SomeFunction();
|
|
|
|
|
In C++
auto i = small integer
auto v = some complex STL type
auto l = some big elephanting lambda
"If we don't change direction, we'll end up where we're going"
|
|
|
|
|
I use auto , the C++ equivalent, whenever it will deduce the correct type.
- It forces you to initialize the variable.
- If the variable is initialized by calling a function, and that function's return type changes, the code might not even be affected.
- Some type names are long or complicated, and I hate spilling lines.
Some argue that it makes the code harder to understand because the reader has to figure out the type. My counterargument is that the reader doesn't understand how the code fits into the system if this is the case.
|
|
|
|
|
You are going on a dangerous path. It leads you to the days when an insignificant dot was significant:
auto i = 2;
auto j = 3;
auto k = i/j;
auto f = 2./j;
Besides "auto" has four letters and "int" has three; it's not energy efficient
Mircea
|
|
|
|
|
Not very dangerous unless one ignores compiler warnings. Then again, I don't use floating point very often.
The main one I have to watch for is
for(auto i = 0...
which makes i an int when what might actually be called for is a size_t .
|
|
|
|
|
The advantage of var is if "http://someapi" was a variable or class instance instead of a string literal and you changed its type, you would not then need to refactor the code elsewhere.
In your example it's just a case of habit probably, however it's obvious from what is on the right that it's a string.
It can sometimes make it harder to debug issues as jumping to the class definition might not always be supported in the IDE you use to debug the var url value with or have to wait for the IDE to resolve the type that the var is.
That's my take on var ...
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: The advantage of var is if "<a href="http://someapi">http://someapi</a>" was a variable or class instance instead of a string literal and you changed its type, you would not then need to refactor the code elsewhere.
Absolutely not true. Changing a data type and then attempting to use it elsewhere is guaranteed to cause you to have to modify code everywhere it's used. Fortunately the VS IDE is smart enough to identify those spots for you.
|
|
|
|
|
obermd wrote: Absolutely not true. Changing a data type and then attempting to use it elsewhere is guaranteed to cause you to have to modify code everywhere it's used. Even when changing from a short to a long ?
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: The advantage of var is if "http://someapi" was a variable or class instance instead of a string literal and you changed its type, you would not then need to refactor the code elsewhere. "O, that way madness lies; let me shun that!" (King Lear)
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Tell me about it, I have been coding in Kotlin for an Android application and in Kotlin pretty much every type is inferred.
So the code is peppered with it when referring to a property and it can be pretty much anything.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
ZurdoDev wrote: This feels lazy to me but I am open minded and am curious if I am missing something. Is there some benefit to declaring most things var instead of what they actually are? In the case above, a string.
I felt the same way initially, and I agree, for something simple like a native type, I rarely use var.
However:
var complicatedDictionary = new Dictionary<SomeKey, List<KeyValue>>();
and worse, I like definitely like it.
|
|
|
|
|
Marc Clifton wrote: var complicatedDictionary = new Dictionary<SomeKey, List<KeyValue>>();
and worse, I like definitely like it. I can see that.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
I'd actually prefer it is you could do this:
Dictionary<SomeKey, List<KeyValue>> complicatedDictionary = new *();
To me, that would be a more natural way of showing what the type of complicatedDictionary actually is.
As it is, I find var is mainly over used by the lazy-and-don't-care script kiddies ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is one place where VB has a better syntax:
dim complicatedDictionary as New Dictionary(of SomeKey, List(KeyValue))
I'd prefer to see the < and > symbols used around the type information as this would make it clear what is type information vs. New parameters/arguments.
|
|
|
|
|