Top "Shorthand" questions

NSArray objectAtIndex: shorthand

Possible Duplicate: Is there some literal dictionary or array syntax in Objective-C? I have recently noticed that something strange seems …

ios objective-c nsarray shorthand
Try/catch oneliner available?

Just as you can convert the following: var t; if(foo == "bar") { t = "a"; } else { t = "b"; } into: t = foo == "…

javascript try-catch shorthand
Is there a shorter way to write a for loop in Java?

the code is for(int i = 0; i < max; i++) { //do something } I use this exact code many times when …

java for-loop syntax shorthand
How do I round millions and thousands in JavaScript?

I am trying to round large digits. For instance, if I have this number: 12,645,982 I want to round this number …

javascript jquery rounding number-formatting shorthand
c# shorthand for if not null then assign value

Is there any shorthand in c# now that will cutdown the following code: var testVar1 = checkObject(); if (testVar1 != null) { testVar2 = …

c# shorthand null-coalescing-operator null-coalescing
Using key-value pairs as parameters

Simple. If I use: public void Add(params int[] values) Then I can use this as: Add(1, 2, 3, 4); But now I'm …

c# shorthand
Subtracting 1 from a value and storing it in another variable

I vaguely remember running into this problem before, but I'm wondering if this just doesn't work in PHP: echo $counter; // …

php shorthand decrement
C++/CLI shorthand properties

How does a developer do the equivalent of this in managed c++? : c# code public String SomeValue { get; set; } I've …

properties c++-cli shorthand
In PHP, is there a short way to compare a variable to multiple values?

Basically what I'm wondering if there is a way to shorten something like this: if ($variable == "one" || $variable == "two" || $variable == "…

php variables comparison shorthand
Difference in C# between different getter styles

I do sometimes see abbreviations in properties for the getter. E.g. those two types: public int Number { get; } = 0 public …

c# getter shorthand coding-style