|
ShaunO posted:Use var everywhere, IMO. var life 4 eva
|
# ¿ Jul 10, 2014 20:38 |
|
|
# ¿ May 8, 2024 07:25 |
|
Null propagation yesssssssss one more battle won in the war against null.
|
# ¿ Nov 13, 2014 08:15 |
|
Are you stuck with having to use the database directly? Because it sounds like you're trying to implement full-text search which you'd be better off using a tool that already does this like Lucene or elasticsearch, or an RDBMS that supports full-text search (I believe postgres has recently added support for this). They will support stemming, pluralization, etc out of the box. This is a problem with a huge amount of edge cases and natural language-aware logic that is gonna be pretty hard to get right yourself.
Dr Monkeysee fucked around with this message at 04:31 on Jan 8, 2015 |
# ¿ Jan 8, 2015 04:22 |
|
Run two instances of VS, one debugging the website and one debugging the WCF service.
|
# ¿ Sep 2, 2015 20:19 |
|
Cuntpunch posted:At happy hour with a colleague recently we discussed how nice it would be to have a Java Extension for Linq Querying. You mean Java 8 streams are or you referring to something like the weird sql syntax? Or IQueryable?
|
# ¿ Aug 26, 2016 19:17 |
|
22 Eargesplitten posted:What's the point of a getter and setter if the syntax for calling them is the same as getting the variable if it were a public variable? I thought the point of getters and setters was to make sure that nothing outside that class could access the variable without going through a specific method call. It feels like no one addressed your *specific* concern here so I'll throw in my two cents: Properties in C# are syntactic sugar over the exact same get/set pattern you use in Java. So the following code is equivalent: C# code:
Java code:
When you use them the C# code is exactly equivalent to the Java code (in fact the intermediate bytecode language is virtually identical to the Java code): C# code:
C# code:
Finally in C# 6 they introduced an additional bit of syntax. Sometimes you want to initialize your property to something other than the default. Autoproperties won't let you do that because you don't control what the name of the underlying field is (it's auto-generated) so there's no hook to initialize it. So now you have "auto-implemented properties". C# code:
C# code:
The point is these are all equivalent. C# properties are just syntax over normal get/set in Java. Behaviorally it's exactly the same.
|
# ¿ Sep 21, 2016 17:42 |
|
ljw1004 posted:The question of "which ones are run asynchronously" is pretty unpredictable... Seems like there's a much simpler answer to this question which is: as the caller you'd have to know which statements throw before the first await in the method body and which statements throw after the first await in the method body. Which is... madness. That would be completely unworkable the second you hit an async method that isn't your own code.
|
# ¿ Oct 21, 2016 18:09 |
|
You guys are using "inheritance" in two ways. Static members are part of the inheritance chain for the purposes of symbol lookup, which is why you can call parent class static members from a child class (or even from an instance of a class). Static members are not overridable and therefore don't participate in the dynamic-dispatch portion of inheritance. Hence referencing a static member from a child class isn't really invoking that child class as far as the CLR is concerned.
|
# ¿ Jan 24, 2019 01:40 |
|
|
# ¿ May 8, 2024 07:25 |
|
I agree this is surprising behavior though. It makes perfect sense when explained but seems extremely easy to overlook when you're just banging out code. In general you just don't want to mix static data and class inheritance if you can help it.
|
# ¿ Jan 24, 2019 01:48 |