Use of var keyword in C#

I still think var can make code more readable in some cases. If I have a Customer class with an Orders property, and I want to assign that to a variable, I will just do this: var orders = cust.Orders; I don’t care if Customer.Orders is IEnumerable<Order>, ObservableCollection<Order> or BindingList<Order> – all I want is … Read more

PHPDoc type hinting for array of objects?

In the PhpStorm IDE from JetBrains, you can use /** @var SomeObj[] */, e.g.: /** * @return SomeObj[] */ function getSomeObjects() {…} The phpdoc documentation recommends this method: specified containing a single type, the Type definition informs the reader of the type of each array element. Only one Type is then expected as element for … Read more

What is the scope of variables in JavaScript?

TLDR JavaScript has lexical (also called static) scoping and closures. This means you can tell the scope of an identifier by looking at the source code. The four scopes are: Global – visible by everything Function – visible within a function (and its sub-functions and blocks) Block – visible within a block (and its sub-blocks) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)