« first day (3347 days earlier)      last day (1603 days later) » 

5:02 AM
It sounds quite and nice here. Good night folks!
 
 
2 hours later…
7:17 AM
Good morning ))
 
8:13 AM
@CopperKettle Break it up. Assign card1[0] to a char variable on one line, assign cardrankin[i] to a variable on the next, and compare in another. That will make it easy to debug.
Either do that initially, and after your code is stable merge them into a single statement (refactoring tools like Resharper can do that for you easily), or write it in one statement, but when you get exceptions, break it up to separate statement and debug those (again, R# can do it quickly)
Some other tips that I find help readability, which in turn help spotting problems:
1) Spaces inside for loops! Helps all three parts be more distinct and readable.
2) Instead of the more complex `i <= cardRanking.Length - 1`, you can simply do `i < cardRanking.Length` - both because less-than is a simpler operation to follow, cognitively, than less-than-or-equal, and also because you don't need the additional subtraction. Also, the parentheses aren't necessary either and add more visual (and thus cognitive) clutter.
@CopperKettle Zip is one of the underappreciated Linq operators. It lets you take two sequences (say, two different strings) and merge them together like a zipper (hence the name). You specify the two sequences and the operation that takes an item from each and produces a new, unified item.
var seqA = new[] {1, 2, 3};
var seqB = new[] {10, 20, 30};
var zipped = seqA.Zip(seqB, (fromA, fromB) => fromA + fromB);
// zipped now contains [11, 22, 33]
 
8:30 AM
@AvnerShahar-Kashtan Thank you!
For the advice
 
Man, I'm going to miss LINQ in my next job.
 
8:47 AM
@mr5 I don't know if anyone responded but yes it's entirely normal
Morning friends
@AvnerShahar-Kashtan Why wont you get to play LINQ?
 
@CaptainObvious Because I'll be writing C++.
 
Never fear
Rx contains a Linq implementation in C++. All is not lost
Also, sorry for your loss.
 
@CaptainObvious We'll see what libraries the team and codebase use before I start pushing in innovations.
Yeah, well, languages are just languages. You learn'em, you get used to'em.
 
9:06 AM
I think Rx is fairly commonly used so you may be in luck that it's already there
 
Yes, well, Google isn't well known for using common libraries. However, there's a good chance that their home-brewed libraries are pretty good.
 
 
1 hour later…
10:10 AM
As I understood, C++ and C are still used for the most demanding projects, and C# is not, because it lacks the necessary "power" (which comes with proneness to bugs).
Maybe I"m wrong
 
@CopperKettle Not really, no. "power" is a very vague term. C# is much more powerful than C and C++ if you measure it by "productivity", or the ability to write more features faster and safer. C++, and C, can give you a lot more control over resources, memory allocation and runtime, but it comes at a price - it's easier to make mistakes and the language does a lot less to prevent them.
But these things really are very situational. C++ performance gains might not be relevant to a system that mainly does UI or network I/O, where most of the time is spent waiting for a user to act or for a network call to return.
C#, especially modern C# with Span<T> and Memory<T>, has made many performance improvements and can compete with C++ in many places, performance-wise. Similarly, newer C++ versions have made many improvements with usability and expressiveness, and isn't as messy and bug-prone as it used to be.
 
10:32 AM
For example, most of my projects are 99% of the time bottlenecked (users aside) by I/O, mostly database or file (the network itself here is not bad at all)
Basically any time I try to do any optimisations I'm usually faced with "90%: StreamReader.Read()" or something to that effect
C# is plenty fast enough (especially with new additions like Avner said) for most purposes
 
11:15 AM
I'm pretty sure the project in my next job will be about 25% low-level code that will actually benefit by being in C++, and 75% code that might as well have been C# or Java, but the team was already a C++ team, so, you know, might as well.
 
11:54 AM
I thought Google spent most of their development in meme languages, the likes of which @Wietlol would use
 
like switching to rust from C++
 
@CaptainObvious Mostly C++ and Java, with some Go gaining traction.
Although specific products might use other languages, these are the common ones.
 
 
9 hours later…
9:24 PM
@AvnerShahar-Kashtan no JS?
 

« first day (3347 days earlier)      last day (1603 days later) »