|
I always forget about that one because it is new -- added in .NET 4.0.
It is a bit different from the original FindFirstFile too -- you could easily cancel the work of enumeration on the original one. This call just seems to run. How would you cancel it?
However you have inspired me to work with this method and learn more about it.
It is interesting since it could run on one thread I suppose and you could iterate the list on another thread?
|
|
|
|
|
newton.saber wrote: How would you cancel it?
Usually by terminating a loop.
newton.saber wrote: iterate the list on another thread?
Or several if you like.
|
|
|
|
|
I can't do anything else than approving the termination of the unary plus operator
I fully agree on the IEquatable<> and IComparable<> interfaces implementation nightmare; considering the fact that we have to deal with structs and classes differently, we end up with four different ways to do basically the same thing.
I also agree on the fact that two concepts that do not overlap should not be implemented in a single object (ex: integers/bit arrays, enums/flagged enums). Having a consistent system for bit-arrays handling would be a great improvement.
I had never imagined that using increment and decrement operators could be a problem. I use them pretty much. Maybe there are better ways to achieve the same goals, but I never had a readability problem with them; they just make a lot of simple expressions very concise.
It would also be very painful to me if I had to give up on the for loop.
while (true) {
continue;
}
|
|
|
|
|
phil.o wrote: I also agree on the fact that two concepts that do not overlap should not be implemented in a single object (ex: integers/bit arrays, enums/flagged enums). Having a consistent system for bit-arrays handling would be a great improvement. I see this a lot, but they do overlap. A lot of the power of using an int as a bitarray comes from the ability to use operations that aren't strictly bitwise, for example x & -x selects the lowest set bit (if there is one) without having to look for it,
x & x - 1 removes the lowest set bit (used also as part of determining whether a number is a power of two), or to take a more practical turn, the o^(o-2r) trick in chess engines.
Meanwhile integers that we pretend aren't bitarrays (they still are) benefit from bitwise operations, for example testing whether it's a power of two (as above), rounding up/down until it is a power of two (involves a bunch of shift/or), rounding down to a known power of two (eg x & -16 is the canonical way to round x down to a multiple of 16), and even knocking off the lowest set bit (as above) in the indexing of a Fenwick tree (it's not a bag of bits there, it's an index), the FFT bitreversal (again an index, not a bag of bits).
Arithmetic operations and bitwise operations are not two different worlds, they mix in useful ways.
|
|
|
|
|
phil.o wrote: termination of the unary plus operator
NO! That would violate the Orthogonality Principle! (Or is it the Regularity Principle?)
Heathens at the gate! Heathens at the gate!
|
|
|
|
|
I'm surprised there's nothing on the overuse of ?.
MyClass item = passedIn != sentinel ? otherItem : defaultValue;
item = item ?? otherCouldBeNullValue;
item?.DoSomething();
|
|
|
|
|
Pete O'Hanlon wrote: MyClass item = passedIn != sentinel ? otherItem : defaultValue; Should the inverted question mark, unicode U+BF ¿ flip the sense of the boolean?
Pete O'Hanlon wrote: item = item ?? otherCouldBeNullValue; Why doesn't unicode U+2047 ⁇ work like the double ?
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton
|
|
|
|
|
You mean that several various operators contain a question mark? Meh, I'm OK with that -- at least until I see
MyClass item = someitem ?? otherCouldBeNullValue != sentinel ? otherItem?.DoSomething() : defaultValue;
I don't blame the designers for abuse.
|
|
|
|
|
Exactly - and you know that sooner or later people will start accepting R# suggestions that end up producing horrors like that.
|
|
|
|
|
Many engineers develop some bad habits over their years of forging code. Here are seven career-breakers software engineers need to ditch. Collect the whole set!
|
|
|
|
|
Here's the 8th: being a patronizing git, just like the author of the article.
|
|
|
|
|
Most of these aren't habits of the developer, but consequences. Passion gets killed easily if you have no say in what you are doing, and saying "NO" is one of the most important skills a dev can have.
Scope-creep is one of the reasons why a lot of projects go beyond their deadline. Learn to say no, we got a product to ship.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
This article is intended to highlight some of the key advantages and disadvantages typically experienced by enterprises. It then presents the key questions to be contemplated by your enterprise in determining whether Git is right for you and what you need to consider in moving to Git. To Git, or not to Git. Whether 'tis nobler in the mind to rebase the branches...
|
|
|
|
|
Regardless if you opt for Intel's latest platform and DDR4, or go for last season's Haswell range with more affordable DDR3 memory, you'll likely ask yourself: "Should I get 8GB or 16GB of RAM?" Is more always better?
|
|
|
|
|
I did not ask, I just went for 16GB.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Me too. I don't want to have to think before debugging a mobile client using Android Studio and a web app using VS2013 simultaneously. My GigaByte BRIX (4th gen i7, 16G RAM, 500G SSD) flies!
/ravi
|
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: Android Studio is an idiot IDE in manner of memory-consumption; Hmm, it seems to work well for me. Seems faster and more robust than Eclipse.
Afzaal Ahmad Zeeshan wrote: 1TB HDD *Beat ya!*. A 1TB SSD? Nice!
/ravi
|
|
|
|
|
In case of Eclipse and Android Studio, indeed, it is a better IDE for Android programming. But I was comparing it with Visual Studio.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
IMHO, *nothing* compares to Visual Studio. I wouldn't marry a woman who said she didn't like VS.
/ravi
|
|
|
|
|
We're now requesting 512GB and 36 cores -- for database (SQL Server) servers anyway. I got no response when asking about a similar desktop.
|
|
|
|
|
PIEBALDconsult wrote: for database (SQL Server) servers anyway Makes sense. One of the reasons why SO is insanely fast is that it runs in RAM.
/ravi
|
|
|
|
|
Runs in RAM? I thought RAM was supposed to save the data.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
32GB because ... Batman!
Decrease the belief in God, and you increase the numbers of those who wish to play at being God by being “society’s supervisors,” who deny the existence of divine standards, but are very serious about imposing their own standards on society.-Neal A. Maxwell
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
64 GB.
Not upgrading for a while.
|
|
|
|