Visual Studio 2017: March 7th
-
@Maciejasjmj said in Visual Studio 2017: March 7th:
but you don't really know what the necessary functionality is for the caller
If you are doing OOP properly you aren't supposed to care.
It kinda like if you are doing encapsulation properly you aren't supposed to care how it works
e.g.
public interface Email { MailResponse Send(); }
That Send method could do the following
- light up a led on a redneck dashboard
- he prints it out.
- he gives the print out to an owl.
- the owl flys to the address in the email footer (the owl can read).
- that recipient once they receive the print out of the mail send a smoke signal.
- the guy types in "202" for accepted once he sees the white smoke.
- You return accepted to web front end.
Still satisfied the Interface definition.
In the same vain the consumer can do whatever crazy this they like with your return value.
I am sure there are also good TDD arguments for practising OOP properly.
-
@lucas1 said in Visual Studio 2017: March 7th:
@Maciejasjmj said in Visual Studio 2017: March 7th:
but you don't really know what the necessary functionality is for the caller
If you are doing OOP properly you aren't supposed to care.
Okay, now that's where I think we've
-
@masonwheeler said in Visual Studio 2017: March 7th:
@CreatedToDislikeThis said in Visual Studio 2017: March 7th:
@masonwheeler Yeah, could be.
But I think there's still a place for local functions alongside lambdas -
int doMyThing (int x)
{
... some code ..
}Just reads better than
var doMyThing = (int x) =>
{
... some code ..
}Yeah, C#'s lambda syntax is ugly. But then again, have you ever seen any language whose lambda syntax isn't ugly? :P
Rust.
|x| 2*x
. Can't get cleaner than that. Semantics are very clear - an anonymous type that implements function interface (Fn
,FnMut
andFnOnce
traits). Parameter and return types are inferred and captures are done automatically, making immutable borrow where possible and mutable borrow when needed. And if you need more lines in your function, remember that in Rust, code blocks are expressions too.
-
-
@Tsaukpaetra Sorry for promoting OOP best practive in a OOP language.
-
@lucas1 said in Visual Studio 2017: March 7th:
In the same vain the consumer can do whatever crazy this they like with your return value.
Except they can't, because you've crippled it by returning a type with less functionality than you could.
And the best OOP practice is, to me - for input parameters, ask yourself if you could accept a more general type here. For return values, ask yourself if you could return a more functional type here.
-
@lucas1 said in Visual Studio 2017: March 7th:
@Tsaukpaetra Sorry for promoting OOP best practive in a OOP language.
You should be! Where do you think we are?!
-
@Maciejasjmj No you haven't.
You keep on saying this.
So say we have
void IEnumerable myMethodThatReturnsIEnumWhatever() { var myList = new List(); //snip building a list return myList; }
They can still do this.
void doSomethingWithMyList() { myMethodThatReturnsIEnumWhatever.ToList(); //snip do some stuff }
How are they limited?
Oh they aren't
-
@lucas1 Isn't that the converse of the same argument? "I shouldn't force them to cast things into a list if I don't need the functionality" -> "They should be forced to cast things into a list if they need a list, even though I could return a list."
-
@RaceProUK I only wish they had a version for Linux. I would pay extra for it. CLion has been quite a disappointment so far (I was first excited about it because I think Pycharm is the best IDE for Python). On the other hand VS is getting better at any version, there is no better IDE for C++11+.
-
@lucas1 said in Visual Studio 2017: March 7th:
They can still do this.
But they don't know whether said
ToList()
will be a free (and unnecessary) operation, or will materialize a structure that takes a long time to build up (trust me, there's a nice LINQ solution to a challenge somewhere that takes over 15 minutes to doToList()
).And usually you can't do that with any interface and any concrete class,
IEnumerable
is pretty much an exception. You can't just take anyIPaperweight
and do aToComputer()
on it.
-
@Maciejasjmj
if (iterator is IList) { /*do listy things*/ }
-
You guys are all arguing in circles. The semantics of the interface are important here, nothing else. If what you will be returning is a list, logically, then declare IList as the return type. If it's an immutable sequence, declare IEnumerable and let them convert it back to a list themselves if they want to mutate it. Simple as that.
-
@Yamikuronue I don't think so. But tbh it is getting late and I am unsure.
-
@asdf said in Visual Studio 2017: March 7th:
You guys are all arguing in circles.
They might be; I'm debating in squares :P
-
@asdf Thankyou.
-
@Maciejasjmj I think this is something very specific to what you are doing at the time. I am speaking in generalities.
-
@RaceProUK said in Visual Studio 2017: March 7th:
@asdf said in Visual Studio 2017: March 7th:
You guys are all arguing in circles.
They might be; I'm debating in squares :P
Let's meet in the middle and form triangles, the math's easier to draw with. :P
-
@asdf said in Visual Studio 2017: March 7th:
If what you will be returning is a list, logically, then declare IList as the return type.
That's pretty much what I'm arguing. There are sometimes good reasons to declare
IEnumerable
even if you are returning a list, but this is a decision that should have a good rationale. For input arguments, it's the other way around - the decision to take aIList
even if you only do stuff you could do on anIEnumerable
is the one that needs an argument behind it.
-
@Maciejasjmj Okay fair enough.
EDIT: tbh what you said in the last post, we are both saying the same things but coming from different angles.
-
@Maciejasjmj @lucas1 Now bro-hug!
-
@Tsaukpaetra said in Visual Studio 2017: March 7th:
@Maciejasjmj @lucas1 Now bro-hug!
Can I let @asdf do that?
-
@Maciejasjmj We can do a 3 way.
-
Can't covariant return types easily solve both sides of this IEnumerable/IList/List discussion? Have the base interface specify the most generic return type and have implementers specify the most specific return type via covariance.
-
@Maciejasjmj said in Visual Studio 2017: March 7th:
@lucas1 said in Visual Studio 2017: March 7th:
you should return the most generic type and take the most generic type.
That would be
object
, I suppose?It boils down to what guarantees you do and don't want to make about your method, but if you're building a
List
and you know you'll always be building aList
there, there's no other reason to return anIEnumerable
than pissing off the caller who now has to pointlesslyToList()
your output.You shouldn't do this, really.
-
@LB_ said in Visual Studio 2017: March 7th:
Can't covariant return types easily solve both sides of this IEnumerable/IList/List discussion? Have the base interface specify the most generic return type and have implementers specify the most specific return type via covariance.
This is exactly what @Maciejasjmj was arguing for.
-
I could go to this:
But I probably won't.
-
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
-
@coldandtired said in Visual Studio 2017: March 7th:
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
And we now proceed to pound the server.
-
@coldandtired said in Visual Studio 2017: March 7th:
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
Give us a minute, we'll be done soon...
Interesting installation message.
-
Microsoft, testing in production.
-
@dcon said in Visual Studio 2017: March 7th:
@coldandtired said in Visual Studio 2017: March 7th:
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
And we now proceed to pound the server.
I want to download the layout...
- UAC
- blahblah 'Continue'
That's it, that's all. Guess the /layout option wasn't tested.
-
@RaceProUK No. It means that they are using legacy methods that require the jQuery Migrate plugin
As of version 1.4.0 this message is also shown with production builds. The use jQuery Migrate in production has performance impacts and can complicate debugging as it modifies the normal behavior of the version of jQuery being used.
-
@lucas1 That plugin's not meant to be used in production though: it's meant to be used in development and testing to update your code to work correctly with the new jQuery.
-
@RaceProUK Realistically that is never going to happen and the jQuery team should know that.
Also there is no way management, QA and code review is going to let you change every legacy call in the codebase, when you can potentially break a lot of things in unexpected ways.
-
@lucas1 said in Visual Studio 2017: March 7th:
@RaceProUK Realistically that is never going to happen and the jQuery team should know that.
I upgraded a site from jQuery 2 to 3, and I never deployed the Migrate plugin to production. But then I actually went through my code and fixed it to work properly.
-
@RaceProUK How big was your codebase? Yeah you can do that if is is less than a few thousand lines on the front end with a find and replace.
I've dealt with sites with upto 50,000 lines of jQuery Spagetti code, no testing other than manual regression testing. Also I had to interact with iFrames.
Or I could just include to the migrate function and not get shouted at by management when the deploy is rolled back. And keeping with the previous version of jQuery wasn't an option because we had to upgrade it because there were 3rd party libs that expected a newer version.
I don't want to be a dick. But if I fixed every instance of $('<selector>').live() was used, my code would have been rejected instantly by code review ... and quite rightly.
-
@dcon said in Visual Studio 2017: March 7th:
@dcon said in Visual Studio 2017: March 7th:
@coldandtired said in Visual Studio 2017: March 7th:
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
And we now proceed to pound the server.
I want to download the layout...
- UAC
- blahblah 'Continue'
That's it, that's all. Guess the /layout option wasn't tested.
Holy fucking hell. How retarded do you have to be to do this...
In order to download VS for layout, you must run the exe from the download folder. If you run it else where, it just sits for a while (doing something) and goes away. Running the exe from somewhere else but specifying the downloaded layout in Downloads also fails. Put the exe in Downloads and it works.
-
Installing 2017 on my VM and work machine. Seems you can update straight from the RC!
-
@Magus said in Visual Studio 2017: March 7th:
Installing 2017 on my VM and work machine. Seems you can update straight from the RC!
And the pinned icon retains the "RC"!
-
@Magus said in Visual Studio 2017: March 7th:
Seems you can update straight from the RC!
That makes updating my home machine easier
-
@dcon said in Visual Studio 2017: March 7th:
@dcon said in Visual Studio 2017: March 7th:
@dcon said in Visual Studio 2017: March 7th:
@coldandtired said in Visual Studio 2017: March 7th:
Page now redirects to the final version instead of RC: https://www.visualstudio.com/vs/whatsnew/
And we now proceed to pound the server.
I want to download the layout...
- UAC
- blahblah 'Continue'
That's it, that's all. Guess the /layout option wasn't tested.
Holy fucking hell. How retarded do you have to be to do this...
In order to download VS for layout, you must run the exe from the download folder. If you run it else where, it just sits for a while (doing something) and goes away. Running the exe from somewhere else but specifying the downloaded layout in Downloads also fails. Put the exe in Downloads and it works.
Oh cool. Downloading community. "The program has stopped working". sigh. If at first you don't succeed... (the download of MSDN's Pro on a different machine seems to still be working...)
Edit: Crashed again. Looked closer. Oh, I'm out of space (9G free wasn't enough). Way to handle the error. Obviously exceptional and unexpected.
-
@SlackerD said in Visual Studio 2017: March 7th:
@coldandtired said in Visual Studio 2017: March 7th:
Give us a minute, we'll be done soon...
Interesting installation message.
Sounds very harried, especially if "us" is read as a Britishism. You can picture the installer as a flustered lackey: "Arright! Arright! Give us a minute!"
-
So, I downloaded the installer. First thing it did? Update itself.
-
@RaceProUK Always is. The release is nice, since now we can have Productivity Power Tools again; And now Viasfora is one of my standard extensions :D
-
@RaceProUK said in Visual Studio 2017: March 7th:
So, I downloaded the installer. First thing it did? Update itself.
You mean the released version? Guess some updates didn't make the cut! (This is now the standard VS2017 process - been thru that multiple times during the RC process)
I'm still downloading the whole enchilada. Currently at 14.6 GB and counting. (No wonder it blew chunks on my machine with only 9G free.)
-
@dcon I had the RC installed already, which might be why it did what it did.
-
@RaceProUK Yup. Did that on mine too.
-
This post is deleted!
-
Browsing through some of the changes for C++ in VS2017 (and the previews). Saw the following:
Class types imitating pointers while wearing top hats and monocles are now accepted throughout more of the STL.