Lets say I have a class called Person, that Id like to make a new instance of. From my testing, both of theese examples work. var Mike = new Person();  seems to do the same thing as Person Mike = new Person();  My question is, what is the difference, and which one is &quot;generally better&quot;.
After discussion with colleagues regarding the use of the 'var' keyword in C# 3 I wondered what people's opinions were on the appropriate uses of type inference via var?  For example I rather lazily used var in questionable circumstances, e.g.:-  foreach(var item in someList) { // ... } // Type of 'item' not clear. var something = someObject.SomeProperty; // Type of 'something' not clear. var something = someMethod(); // Type of 'something' not clear.   More legitimate uses of var are as follows:-  var l = new List&lt;string&gt;(); // Obvious what l will be. var s = new SomeClass(); // Obvious what s will be.   Interestingly LINQ seems to be a bit of a grey area, e.g.:-  var results = from r in dataContext.SomeTable               select r; // Not *entirely clear* what results will be here.   It's clear what results will be in that it will be a type which implements IEnumerable, however it isn't entirely obvious in the same way a var declaring a new object is.  It's even worse when it comes to LINQ to objects, e.g.:-  var results = from item in someList               where item != 3               select item;   This is no better than the equivilent foreach(var item in someList) { // ... } equivilent.  There is a real concern about type safety here - for example if we were to place the results of that query into an overloaded method that accepted IEnumerable&lt;int&gt; and IEnumerable&lt;double&gt; the caller might inadvertently pass in the wrong type.  var does maintain strong typing but the question is really whether it's dangerous for the type to not be immediately apparent on definition, something which is magnified when overloads mean compiler errors might not be issued when you unintentionally pass the wrong type to a method.
Why are there so few robots in Star Trek? Okay, obviously beyond Data and the Soong-type androids. But seriously, we have more robots in our daily life now than there apparently are on Trek. Is there a canon answer why not? It seems like Star Wars is more on the nose in this regard - it’s unclear why all dirty/dangerous/boring work wouldn’t be done by robots (anthropomorphic or not). I have a layout similar to this:  &lt;div id="..."&gt;&lt;img src="..."&gt;&lt;/div&gt;   and would like to use a jQuery selector to select the child img inside the div on click.  To get the div, I've got this selector:  $(this)   How can I get the child img using a selector? Confusion between register size, address size, data size I started learning about pointers in C++ and I figured I should educate myself a bit on how memory works and is accessed. I read that when we say a processor is 64-bit, it has a 64-bit register and can access 2^64 address locations. I also read that it can fetch 64/8, so 8 bytes of data at a time, but the data bus is not the same thing as the register right? Do they need to be the same size or does that just happen to be the case usually? And is it the size of the register or the data bus size that determines what we refer to it as, such as 32/64-bit? Also is there a difference between register size and address size? How to create a Geometric Polygonal Art portrait I've been interested in creating Geometric Polygonal art illustrations, i.e. making polygons and shapes with different color shading represent a face, or an object, see  set of .  How are they achieved? Is there some script for Illustrator which alters the image adding the shapes according to the colors or shades? How would I transform a normal image of Marilyn Monroe for example, to a polygonal illustration of her? Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not? Are non-citizens of the Capitol permitted to permanently immigrate? Reading  got me thinking about permitted citizenship.  Are citizens of other districts allowed to permanently move to, or become citizens of the Capitol?   My gut says, "No." The citizens of the other districts are being punished, so it makes little sense to allow them a true, legal escape from their punishments. Even victors are only given new homes in their own districts, keeping them there. Why wasn't Sauron invisible when he wore the Ring? When Sauron is shown killing Elendil and then being destroyed by Isildur he is clearly not invisible and he is wearing the Ring.  But any time Bilbo or Frodo put on the Ring they went invisible without fail.  Did the Ring change after Sauron was destroyed or is Sauron capable of controlling the rings power unlike anyone else? Why is $X^4+1$ reducible over $\mathbb F_p$ with $p \geq 3,$ prime How can I backup my programs/applications, so that after I reinstall a new one, I can still use the backup-ed ones? Is there a way, that I could backup all my programs, all apps, put them in a directory or something, so that I could install them quickly next time, without having to manually going over the app center, downloading them from terminal, etc?  Note that I might import them from a distro other than the one I exported them on. So, say I'm in Ubuntu, exported some stuff, and then installed BT and wanted to import them from there. I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt: os.remove("/folder_name").   What is the most effective way of removing/deleting a folder/directory that is not empty? What do the nomodeset, quiet and splash kernel parameters mean? What do Kernel command line parameters (also also known as boot options) mean?  When you go to Ubuntu (or better, GRUB) options, you have things like nomodeset, quiet and splash. What do these options mean?  I am also interested in other parameters and would be interested to see descriptions of any kernel parameter (like acpi), but these are not essential. Let $x,y,z>0$ and $x+y+z=1$, then find the least value of ${{x}\over {2-x}}+{{y}\over {2-y}}+{{z}\over {2-z}}$ Let $x,y,z&gt;0$ and $x+y+z=1$, then find the least value of  $${{x}\over {2-x}}+{{y}\over {2-y}}+{{z}\over {2-z}}$$  I tried various ways of rearranging and using AM > GM inequality. But I couldn't get it. I am not good at inequalities. Please help me.  I wrote $x$ as $1-(y+z)$ and I took $x+y$ as $a$ and the others as $b$ and $c$. And I am trying. Basic desktop actions are not available on Ubuntu 20.04 In Ubuntu 20.04, on the desktop, there is a number of actions I wish I could do, such as, by order of importance :  use keyboard shortcuts such as select all, copy / paste. use drag &amp; drop with icons deactivate the &quot;mouse over&quot; highlight, and restrict the clicking area to only the icon, not the surrounding square  To put it simply, I'd like to have the exact same features as offered by the desktop of Ubuntu 18.04 (probably related to a specific version of GNOME, and not Ubuntu itself). Am I missing something obvious here? I actually see no reason why those actions are removed or deactivated on the desktop, since they all work in any Nautilus window. How to view the user's status? How did Harry breach the Statute of Secrecy? Something always bothered me with Fudge's accusations:     “Disciplinary hearing of the twelfth of August,” said Fudge in a   ringing voice, and Percy began taking notes at once, “into offences   committed under the Decree for the Reasonable Restriction of Underage   Sorcery and the International Statute of Secrecy by Harry James   Potter, resident at number four, Privet Drive, Little Whinging,   Surrey." - OotP Ch. 8 "The Hearing"   Harry cast the Patronus Charm, so he violated the Decree for Reasonable Restriction of Underage Sorcery alright - extinuating circumstances aside - but how did he breach the Statute of Secrecy?  The only witnesses were Dudley and Mrs. Figg, both of whom already knew that Harry is a wizard. Earlier, even Hermione gets it wrong (don't tell her!):     They haven’t even reported that you broke the International Statute of   Secrecy. We thought they would,... - OotP Ch. 4 "#12"   Yes, Harry does use magic in front of a Muggle, Dudley, but even Dudley is not so thick that the fact that Harry's a wizard would come as a revelation to him. Harry cannot breach the Statute of Secrecy to someone already in the know.  Shouldn't Dumbledore point out that glaring error in the indictment sooner rather than later? Or at least mention it, at all?  Is there maybe a source that mentions the Statute of Secrecy containing a clause, that even the mere possibility of magic being witnessed by an uninitiated muggle is sufficient for its breach?? Cause if so, wouldn't even adult wizards have a really tough time doing anything, ever.  Possibly related: Homomorphism between compact Hausdorff spaces. Can file uploads time out in PHP? How to switch between virtual console and GUI in Ubuntu? I wanted to see what key functions would allow me to switch between the two. How can I list installed packages by installation date?  I need to do this on debian/ubuntu. Answers for other distributions would be nice as well.  I installed a lot of stuff to compile a certain piece of code, and I want to get a list of the packages that I had to install. Break a long command to multiple lines I got a shell script and inside I got the command as below #!/bin/sh sh ../jboss/bin/standalone.sh --server-config=standalone-full.xml -Djboss.node.name=node1 -b 0.0.0.0 -bmanagement 0.0.0.0  How can I break the line to multiple lines for better understanding and management #!/bin/sh sh ../jboss/bin/standalone.sh    --server-config=standalone-full.xml   -Djboss.node.name=node1   -b 0.0.0.0   -bmanagement 0.0.0.0  Tried with backslash at the end of each line and it doesnt work.