You are a god send, your material is better then so many of the paid options out there. I finally feel like I have a channel in which I can lean on to help my efficacy with C#.
@40:00 Code Clean If you use ctrl+K+E before saving the document, it will perform the clean-up The sequence I use is ctrl + K + E + S + F4 clean-up code page (ctrl + K + E) save changed code page (ctrl + s) close code page (ctrl + F4)
Hi Tim. I like your videos and can't image who are that guys that dislike your videos. Thank you Tim, every time I (re)watch you videos I'm learning something new. Now I really liked feature with Intelly Code customized for specific project, already applied on mine, that's cool:) Please keep doing such material, because this is a golden info:) Thanks a lot and have good time:)
Hey Tim, I have been implementing "javascript like" format in my VS, because I though that is like a "general" programming thing, but you just explained it here @21:42 and now I have to change it to default, thank you for this "format clarification" :D
Brilliant, thanks as always. Not sure how this channel does not have 1 million subs. Maybe try add some different styled C# videos such as C# interview questions, videos like this may go viral and attract a lot more to the channel
@@IAmTimCorey so its a compatibility issue, due to browsers with old versions of JavaScript or something like that? Hmm... I have some Android Java code where I decided to use the new line format. I better keep this in mind in case it might be relevant there as well.
You're awesome! The paste JSON as class is really going to save me a lot of headache. These keyboard shortcuts are also great, and I look forward to watching the rest of this playlist.
For those of you with the latest version of visual studio 2019 I couldn't find intellicode within VS you had to add it through visual studio installer and search in individual components and install it from there. Although I couldn't figure out how to get the intellicode model window to appear. I'm also not getting ticks next to my files that have been changed and I don't have the option to compare the unmodified.
Sorry guys, i have a problem: (at video: 19:00 ) When i change the severity (from "Refactoring only" to "Suggestion") the edge of this box became red, and if i confirm with ok button, it reset all the changes; so i can't change anything... Someone che help me?
@@IAmTimCorey We love to hear it from you. Can you tell us why? Btw I'm still using goto labels. instead of nested if statement. but will always defined in the scenario.
Cool video, thanks. 21:20 I like calling it "C formatting". The current C# style is a generalization of the old "K&R C formatting" which I never liked (but adopted it since, well, Microsoft defaulted to it). 47:22 That's one thing I'm still battling, having programmed since the "Just like every method has a single entry point it should have a single endpoint" era it's pretty hard for me to apply it. I understand the rationale but I still find myself in several levels of indentment just to have a single method endpoint.
Pin properties in list, blew my mind! The setting around collapsing the hierarchy when opening vs is also going to be super useful, as i jump around projects a lot at work its common to open them up and have 5+ projects each with nested folders etc auto opened and cluttering the list. The one about automatically showing the selected file in the solution explorer also i think will be useful far too often i am just manually clicking the little button there that does it and getting confused between the 5+ app.configs.
Either create a snippet and add it manually or create new templates for your CS files that include the banner. I have videos on creating snippets and on creating template files on this channel.
Thank you for the video. Does Visual Studio have a similar key combinations that vi has? I really liked being able to move cursor up and down without having to look for down arrow and up arrow keys. I have looked online, but maybe I am not using the right term to search.
I have a question. How can somebody get a cleanup option to cases where you have a private field that did not have proper casing and you want the cleanup to even fix those. I know that refactoring works but would like a way to do via code cleanup. Is there a way to import additional fixes to code cleanup. I would suggest even having a video on how to create additional fixes so code clean up can be even more useful.
Would depend what the values for the case are... String, numbers, enums... If enum you could put the [Obsolete(true)] -- (from memory) but the true will make the warning an error. Now the compiler will force you to fix the invalid cases :) There was another post where a talked about the switch code snippet expanding all enum values, might look for that, real handy.
I'm ignorant - I admit it - but I wonder why "Track Active Item in Solution Explorer = checked" is even an option and not the default? I use this option all the time, and am lost in large solutions without it.
Interesting now many programmers i've pointed this feature out to that never knew it was there, i've used it ever since VS 2002, sad thing i've noticed the later version of VS don't handle or honor the setting as much as it use to in earlier version.
It's probably because it was a new feature at some point, and a change of behaviour by default when you upgrade is not ideal. Personally, I always found it a little confusing. I'd need to quickly dip into some implementation of something and suddenly the solution explorer shifts, and I find it trickier to get back to where I want to be. Instead I leave it off, and in those situations use the button on the solution explorer to select the active item. Of course, part of this is that, as an old fart, I still haven't quite become accustomed to the peek functionality which would solve the same problem for me.
@@JohnLudlow Actually i've been through most of the version of Visual Studio, if memory serves me correctly the "Track Item" was there even in VC++ 2.0, the first 32-bit compile IDE for NT an Win-32 development. Thought it has been there ever since, right along with "Enable Virtual Spaces" which i'd assert doesn't work right anymore...
Hi Tim. Thanks for the tips. I have a question. We can set up naming rules and generate editor config file from visual studio. Can we make this config like an extension so that everyone in a company has to stick to the same naming rules in their IDEs without pasting the config file all the time in the solution. Or do you have any other suggestion for this requirement?
You can create that editorconfig, set it up the way you want, and include it with the project. That will enforce the rules you want the way you want for everyone that uses that project.
@@IAmTimCorey I think he meant having a "global" (e.g., company-wide) scope so it is automatically included with future solutions. You implied that starting at 29:55 so I suppose an example of real-world usage would be good.
I find tab layout cool, your videos are awesome thank you sir for these tutorials tricks from scratch to finished you are awesome like kundu venkat, keep up the great work, good luck and best wishes
@@IAmTimCorey From your videos related .NET Core I created a dummy project for my learning with architecture you use (little change) and encouraging my friends to join your channel and learn.
Great video. One quirk I’ve found with IntelliCode is that it occasionally changes “string” to “String”. I haven’t been able to grok the pattern yet, but it is mildly irritating. Way outweighed by its usefulness, though.
Goto's have there place... Depending on the coding standards used, i've worked in places where a function must have only one return at the bottom of a function, not early returns.... Honestly i've never understood the reasoning behind the coding style but think FAA and some other government organizations mandate this coding style... With out a few well placed gotos the code get notoriously messy really really quick. I might never come up with hard fast rules for rules sake sometime the code might benefit from a goto at times...
@@dand4485 One entry, one exit is a good thing to follow, but I think there's other (better) ways to achieve that. Having said that, the way they are used in WiX C++ Custom Actions seems like a reasonable thing to do.
@@JohnLudlow Yep i hear ya but i'm more often about do what seems the best given the code you have. To have an arbitrary rule for one entry/exit, i've seen functions where the logic, unfortunately is just that twisted, and breaking it out into smaller functions isn't as easy as one might, but would agree this is more the exception than the rule... Guidelines and coding conventions are great if/when they help standardized, but just like everything hard to say "Always" with an "Absolute" constraint... I'm more about do what is best.
@@dand4485 I don't disagree with "do the right thing given your situation". But you gotta have a reason for doing something different - having tried the recommended way and determined it to be nonsense is a valid reason. I'm currently one of the few .NET developers on a team of mostly C++ developers, on a codebase where .NET is being introduced. Letting people do what felt right didn't go very well because they thought that writing C# is basically taking some C++ and removing pointers until the compiler stopped crying at them. So "don't use goto" and "one entry one exit" are both good rules, so if you're going to not follow them in some scenario, there should be a reason for that
null is a concept of not existing. For example, think of a class as a blueprint for building houses. When we build a house based upon the blueprint (instantiate a class into a variable), we put the address of the house into the variable (so "Person p = new Person()" builds a Person instance and puts the address of that object into the variable p). An object variable (like p in our example) that does not yet have the address of an instance is null. That means it is empty. It points at nothing. We cannot use it to store information because it is not pointing to an instance yet. That would be like trying to ship a package to an unknown address. It cannot be done. That is what null is. It is the absence of an address. Not all variables have this concept. An int variable always has a value (default is 0). We can create a nullable int by using "int?", which means we can say the value is not present when it is null.
There was one suggestion I had when I saw the TimCo for the loading and saving data. I would suggest creating a base abstract class you can inherit from. I went through the course for the hotel and did that and it worked great. So for each project, instead of copying/pasting everytime, you just inherit from the class and you always have the methods for loaddata and savedata.
@Andy Walter try this, it has served me well just need the [Serialized] attribute on the class to persist and given i'm using a generic should work for anything you have... public static T ReadFromBinaryFile(string filePath) { using (Stream stream = File.Open(filePath, FileMode.Open)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); return (T) binaryFormatter.Deserialize(stream); } } public static void WriteToBinaryFile(string filePath, T objectToWrite, bool append = false) { using (Stream stream = File.Open(filePath, append ? FileMode.Append : FileMode.Create)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); binaryFormatter.Serialize(stream, objectToWrite); } } Only think i might suggest is play around with it for your needs, think saveing out to json would be better, mainly you'll avoid versioning issues,
Why var? Did do try to analize your code without VS? Var it is source of total mess in code. Var feature was added to c# for support an anonimous types so why you try to use it everywhere? Yes, it fast to code but take long to find errors.... and usually we spent much more time to debug and support our programms than code it ... I personally do not want to support code from other programmers (within the same project) where var is used because my time costs much expensive that benefit you got from total var using. C# seems became like jscript :(: where programmer shold not think about the types
Couple things. First, it was a demo choice to show how it could apply var instead of the explicit types (that I had used, if you noticed). Some people like var, some like explicit types. I prefer explicit types normally because it does make it more readable without VS but var is a viable option. Second, it sounds like you are confusing what var is. Var in C# is strongly typed (meaning you can only assign one type to the variable) unlike other languages like JavaScript, where var is a loosely typed (meaning you can assign different types to the same variable).
Visual studio tip #1: avoid that permanently freezing, deprecated, super expensive piece of software Visual studio tip #2: Use rider, 100x faster, never freezing, modern, 20x less expensive piece of software
Um, huh? Visual Studio 2022 Community Edition is free for life. Oh, and it is the same as the Professional Edition. And usually the reason why Visual Studio freezes is because of the add-in Resharper (from JetBrains, maker of Rider). The thing is, the features people use Resharper for are mostly built-into Visual Studio. They just don’t learn how to use the tool. It sounds like you could benefit from learning about Visual Studio, since your “tips” are so incredibly wrong. You can absolutely like Rider, and it has a lot of great features, but it is more expensive than Visual Studio for most people and it lags behind Visual Studio every time the language updates, which is every year.
@@IAmTimCorey 1) Visual studio community is usable for free for 1% of developers, because you can use at max 2-3 licenses per customer and the max revenue is too low, so its mainly for self-employee juniors doing presentation webs (india). 2) Nope, do not lie to yourself please.., the reason why is Visual Studio freezing 2/3 of time is., because they are doing 90% of I/O work in main thread. YOu can use literally ANY solution bigger than 10 files and VS will freeze for 10sec... Do not try on me Microsoft notes, please. 3) YOur last argument is nothing more than JOKE, Visual studio is forcing people to buy NEW version of Visual studio literally ever 2 years for NO REASON, because of 2 new features thah are pretty easy to implement to older versions of visual studio.., But they better force the users to buy new one.. One example for all, is C# 10 and VS 2022... And BTW there is NO BIGGER pain than work fullstack in visual studio when there is javascript involved...
Look, I get you don’t like Visual Studio, but you are woefully incorrect on your reasons. Visual Studio is free for anyone on their own or working for a company making less than $1 million per year. The team limit is 5. If your company is making more than $1 million per year, they should be paying for their software (and don’t forget, you are arguing for Rider, which is paid for everyone). I’ve used Visual Studio for years for consulting with companies of various sized code based without these issues. In fact, Microsoft uses VS to build VS. If it was unusable, they wouldn’t be able to do their job. The idea that they are forcing you to upgrade is also laughable. VS can install side by side with previous versions and you can build .NET Framework projects on 2015, 2017, 2019, or 2022. Oh, and the most common licensing for VS is a subscription, where you get the latest edition for free as part of your licensing. Like I said, feel free to prefer Rider. Just don’t pretend you actually understand Visual Studio.
That “talk” is called context and context is how you learn to use something in the real world. Otherwise you are just learning theory. Besides, I covered 15 tips in an average of 5 minutes each, not counting the intro, conclusion, three bonus tips, and the preview features. That’s not exactly dragging my feet.
Minor adjustments to the existing time codes in the video description.
0:00 - Intro
2:08 - Intellicode
7:52 - Personalized Intellicode
13:37 - Code Styles
27:07 - Editor Config
34:36 - Solution Performance
38:43 - Code Cleanup
42:36 - Project/Solution-wide Code Cleanup
44:33 - Paste as JSON
46:29 - Quick Actions and Refactoring (more options)
50:03 - Discard Character
54:35 - XAML Hot Reload
58:32 - XAML Pop-out Option (bonus)
59:42 - Pin Properties in List
1:02:38 - Clipboard Ring
1:03:34 - Windows Clipboard Ring (bonus)
1:04:14 - Toolbox Code Storage
1:07:42 - Universal Search (Ctrl+Q)
1:10:07 - Vertical document tab layout (bonus)
1:12:12 - Preview Features
1:13:06 - Summary and concluding remarks
Thank you. Updated!
You are a god send, your material is better then so many of the paid options out there. I finally feel like I have a channel in which I can lean on to help my efficacy with C#.
I am glad it has been so helpful.
Hands the absolute best tips video on VS , thank you so much !
You are welcome.
Merry Christmas to you and your family Tim
Thank you. Merry Christmas to you and yours as well.
@40:00 Code Clean
If you use ctrl+K+E before saving the document, it will perform the clean-up
The sequence I use is ctrl + K + E + S + F4
clean-up code page (ctrl + K + E) save changed code page (ctrl + s) close code page (ctrl + F4)
Thanks for sharing.
Your content is so amazing, you don't know how much you have helped me to improve my career as a Dev. Thanks!!!!!!!!
Happy to help!
Hi Tim. I like your videos and can't image who are that guys that dislike your videos. Thank you Tim, every time I (re)watch you videos I'm learning something new. Now I really liked feature with Intelly Code customized for specific project, already applied on mine, that's cool:) Please keep doing such material, because this is a golden info:) Thanks a lot and have good time:)
Thanks for that. Some folks want less background talk and faster pace. I strive for balance. Your feedback helps me with that, so thank you.
Hey Tim, I have been implementing "javascript like" format in my VS, because I though that is like a "general" programming thing, but you just explained it here @21:42 and now I have to change it to default, thank you for this "format clarification" :D
I’m glad I was able to clear that up.
Really good tutorial for using visual studio!!! Thanks!!!!!!!
You are welcome.
Brilliant, thanks as always. Not sure how this channel does not have 1 million subs. Maybe try add some different styled C# videos such as C# interview questions, videos like this may go viral and attract a lot more to the channel
I appreciate the kind words.
In the video Tim says around 21:20 that JavaScript has a reason for not placing open braces on a new line. Can anyone explain what that reason is?
Because in some circumstances, the return can return void when the curly braces start on the next line.
@@IAmTimCorey so its a compatibility issue, due to browsers with old versions of JavaScript or something like that?
Hmm... I have some Android Java code where I decided to use the new line format. I better keep this in mind in case it might be relevant there as well.
Thanks Tim for making such an exceptional content. Earlier I used to go for short videos but they were of no use because great content takes time.
I am glad my content has been helpful.
This information is so valuable! Thank you for sharing it with us Tim!
You are welcome.
You're awesome! The paste JSON as class is really going to save me a lot of headache. These keyboard shortcuts are also great, and I look forward to watching the rest of this playlist.
Excellent!
For those of you with the latest version of visual studio 2019 I couldn't find intellicode within VS you had to add it through visual studio installer and search in individual components and install it from there. Although I couldn't figure out how to get the intellicode model window to appear.
I'm also not getting ticks next to my files that have been changed and I don't have the option to compare the unmodified.
Sorry guys, i have a problem: (at video: 19:00 )
When i change the severity (from "Refactoring only" to "Suggestion") the edge of this box became red, and if i confirm with ok button, it reset all the changes; so i can't change anything...
Someone che help me?
Helo, where can you turn on the reference notation before each method. I find that really useful. I had if on once and it disappeared
I believe you are asking about this: th-cam.com/video/morBKqtqmso/w-d-xo.html
@@IAmTimCorey Hello, yes thanks that works great too. But I was wondering how to turn on the references for the method not the parameters.
can toolbox code storage export to other solution?
How do you make it so it automatically adds a _prefix to member variables when using code cleanup or as a suggestion?
can we zoom in and out on a winforms app? I find it hard to work on the UI if the form is too big
21:00 that was a moment when i found out that goto even exist in C# xD
after 4 years of using it
Now forget all about it.
@@IAmTimCorey We love to hear it from you. Can you tell us why?
Btw I'm still using goto labels. instead of nested if statement. but will always defined in the scenario.
Cool video, thanks.
21:20 I like calling it "C formatting". The current C# style is a generalization of the old "K&R C formatting" which I never liked (but adopted it since, well, Microsoft defaulted to it).
47:22 That's one thing I'm still battling, having programmed since the "Just like every method has a single entry point it should have a single endpoint" era it's pretty hard for me to apply it. I understand the rationale but I still find myself in several levels of indentment just to have a single method endpoint.
You are welcome.
"...some really ugly styles here" had me cracking up! Great video, as always!
LoL - Thanks for watching and joining the conversation!
Preview Feature part, really helps me. Thank you 🙏
We appreciate you making Tim a part of your development journey
Pin properties in list, blew my mind!
The setting around collapsing the hierarchy when opening vs is also going to be super useful, as i jump around projects a lot at work its common to open them up and have 5+ projects each with nested folders etc auto opened and cluttering the list.
The one about automatically showing the selected file in the solution explorer also i think will be useful far too often i am just manually clicking the little button there that does it and getting confused between the 5+ app.configs.
I am glad it was so helpful.
Hi, How can I add copyright banner in each .cs file using visual studio 2022. Please help me.
Either create a snippet and add it manually or create new templates for your CS files that include the banner. I have videos on creating snippets and on creating template files on this channel.
@@IAmTimCoreyActually i have 40-45 file and I have to add copyright content banner in top.
when i slect a place to type, it makes me replace what I put. How can I make theselecting normal
I'm not sure what you mean. Sorry.
@@IAmTimCorey i fixed it by pressing insert
I meant if i went backwards in a line it would make me delete what was in front when I wrote
Thank you for the video. Does Visual Studio have a similar key combinations that vi has? I really liked being able to move cursor up and down without having to look for down arrow and up arrow keys. I have looked online, but maybe I am not using the right term to search.
Hey Tim amazing man, love your videos.
Thank you!
Wow thanks for the tips You help of us God Bless sir.
Thanks for watching and trusting Tim to help expand your skills
I have downloaded offline installer of vs19 but when I run setup it starts but silently close without showing workload window. What do the solution?
Check your event log to see if it shows what the error is.
@@IAmTimCorey how to see event log
Hit the Windows key and then type "event" and the first thing on the list should be the Event Viewer.
I don't have the same options as you. What am I missing? No Intellicode Refactoring option, no option to build a model under view-> other windows.
Are you on Visual Studio 2019 Community Edition (not Visual Studio for Mac or VSCode)?
Helpful tips. Thanks!
You bet!
Great video Tim - Thank you!
You are welcome.
I have a question. How can somebody get a cleanup option to cases where you have a private field that did not have proper casing and you want the cleanup to even fix those. I know that refactoring works but would like a way to do via code cleanup. Is there a way to import additional fixes to code cleanup. I would suggest even having a video on how to create additional fixes so code clean up can be even more useful.
Would depend what the values for the case are... String, numbers, enums... If enum you could put the [Obsolete(true)] -- (from memory) but the true will make the warning an error. Now the compiler will force you to fix the invalid cases :) There was another post where a talked about the switch code snippet expanding all enum values, might look for that, real handy.
I don’t think you can bring new cleanup items in. That sounds more like a separate extension.
I'm ignorant - I admit it - but I wonder why "Track Active Item in Solution Explorer = checked" is even an option and not the default? I use this option all the time, and am lost in large solutions without it.
Interesting now many programmers i've pointed this feature out to that never knew it was there, i've used it ever since VS 2002, sad thing i've noticed the later version of VS don't handle or honor the setting as much as it use to in earlier version.
It is a great feature. Not sure why it isn’t default.
It's probably because it was a new feature at some point, and a change of behaviour by default when you upgrade is not ideal. Personally, I always found it a little confusing. I'd need to quickly dip into some implementation of something and suddenly the solution explorer shifts, and I find it trickier to get back to where I want to be.
Instead I leave it off, and in those situations use the button on the solution explorer to select the active item.
Of course, part of this is that, as an old fart, I still haven't quite become accustomed to the peek functionality which would solve the same problem for me.
I wanted this feature since I saw it in vs code
@@JohnLudlow Actually i've been through most of the version of Visual Studio, if memory serves me correctly the "Track Item" was there even in VC++ 2.0, the first 32-bit compile IDE for NT an Win-32 development. Thought it has been there ever since, right along with "Enable Virtual Spaces" which i'd assert doesn't work right anymore...
Hi Tim. Thanks for the tips. I have a question. We can set up naming rules and generate editor config file from visual studio. Can we make this config like an extension so that everyone in a company has to stick to the same naming rules in their IDEs without pasting the config file all the time in the solution. Or do you have any other suggestion for this requirement?
You can create that editorconfig, set it up the way you want, and include it with the project. That will enforce the rules you want the way you want for everyone that uses that project.
@@IAmTimCorey I think he meant having a "global" (e.g., company-wide) scope so it is automatically included with future solutions. You implied that starting at 29:55 so I suppose an example of real-world usage would be good.
Excellent!
Thanks!
The Clipboard Ring does not come with VS by default, right?
It does come with VS by default.
@@IAmTimCorey I am using VS 2017 community version. I don't have Clipboard Ring or Universal Search. I wonder what do I need to add to have both?
Upgrade to the free VS2019 Community edition.
I find tab layout cool, your videos are awesome thank you sir for these tutorials tricks from scratch to finished you are awesome like kundu venkat, keep up the great work, good luck and best wishes
Glad you like them!
@@IAmTimCorey From your videos related .NET Core I created a dummy project for my learning with architecture you use (little change) and encouraging my friends to join your channel and learn.
Great video. One quirk I’ve found with IntelliCode is that it occasionally changes “string” to “String”. I haven’t been able to grok the pattern yet, but it is mildly irritating. Way outweighed by its usefulness, though.
Some conventions say to us String when using the attached functions like Format.
Tim: Don't use goto labels
Don't use goto labels
Don't use goto labels
I feel like Groot from Guardian of the Galaxy
Goto's have there place... Depending on the coding standards used, i've worked in places where a function must have only one return at the bottom of a function, not early returns.... Honestly i've never understood the reasoning behind the coding style but think FAA and some other government organizations mandate this coding style... With out a few well placed gotos the code get notoriously messy really really quick. I might never come up with hard fast rules for rules sake sometime the code might benefit from a goto at times...
Don’t use goto labels. :-)
@@dand4485 One entry, one exit is a good thing to follow, but I think there's other (better) ways to achieve that. Having said that, the way they are used in WiX C++ Custom Actions seems like a reasonable thing to do.
@@JohnLudlow Yep i hear ya but i'm more often about do what seems the best given the code you have. To have an arbitrary rule for one entry/exit, i've seen functions where the logic, unfortunately is just that twisted, and breaking it out into smaller functions isn't as easy as one might, but would agree this is more the exception than the rule... Guidelines and coding conventions are great if/when they help standardized, but just like everything hard to say "Always" with an "Absolute" constraint... I'm more about do what is best.
@@dand4485 I don't disagree with "do the right thing given your situation". But you gotta have a reason for doing something different - having tried the recommended way and determined it to be nonsense is a valid reason.
I'm currently one of the few .NET developers on a team of mostly C++ developers, on a codebase where .NET is being introduced. Letting people do what felt right didn't go very well because they thought that writing C# is basically taking some C++ and removing pointers until the compiler stopped crying at them.
So "don't use goto" and "one entry one exit" are both good rules, so if you're going to not follow them in some scenario, there should be a reason for that
Any link to these codefiles?
Sorry, not on this video.
What is null, please explain that
null is a concept of not existing. For example, think of a class as a blueprint for building houses. When we build a house based upon the blueprint (instantiate a class into a variable), we put the address of the house into the variable (so "Person p = new Person()" builds a Person instance and puts the address of that object into the variable p). An object variable (like p in our example) that does not yet have the address of an instance is null. That means it is empty. It points at nothing. We cannot use it to store information because it is not pointing to an instance yet. That would be like trying to ship a package to an unknown address. It cannot be done. That is what null is. It is the absence of an address. Not all variables have this concept. An int variable always has a value (default is 0). We can create a nullable int by using "int?", which means we can say the value is not present when it is null.
@@IAmTimCorey Please make a tutorial on the null variable, please
Very informative! Everytime I watch your vids, I always learn something new! Thanks for sharing your tips and making us a better dev.👏👏👍🤓
You are most welcome. Thanks for watching.
Thanks , Tim
You are welcome.
Did you say use goto label ? Nice ! always knew that was a good idea :)
Step away from the keyboard!
I really appreciate this, but honestly, reshaper really boosts your coding speed and style.
Sooo useful! Thank you :-)
You are welcome.
Thanks!
Thank you for watching!
Thank you so much
You are welcome.
Dev: I dont understand this linq
VS: convert to foreach
Dev: ok but I should commit smart looking code
VS: convert to linq
It covers you either way.
Thank you, sir.
You are welcome.
subscribed for ctrl-shift-v! :D
Glad you enjoyed it.
Great thank you
You are welcome.
Just one suggestion fonts are very small sometimes it's harder to read in small device.
I do try to hit a balance between big enough font size and what I can put on the screen.
You didn't show colored tabs!
Is that a built in option or an add in?
@@IAmTimCorey Oh it is Productivity Power Tools > Custom Document Well. I thought they made it native after giving us vertical tabs.
There was one suggestion I had when I saw the TimCo for the loading and saving data. I would suggest creating a base abstract class you can inherit from. I went through the course for the hotel and did that and it worked great. So for each project, instead of copying/pasting everytime, you just inherit from the class and you always have the methods for loaddata and savedata.
@Andy Walter try this, it has served me well just need the [Serialized] attribute on the class to persist and given i'm using a generic should work for anything you have...
public static T ReadFromBinaryFile(string filePath)
{
using (Stream stream = File.Open(filePath, FileMode.Open))
{
var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
return (T) binaryFormatter.Deserialize(stream);
}
}
public static void WriteToBinaryFile(string filePath, T objectToWrite, bool append = false)
{
using (Stream stream = File.Open(filePath, append ? FileMode.Append : FileMode.Create))
{
var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
binaryFormatter.Serialize(stream, objectToWrite);
}
}
Only think i might suggest is play around with it for your needs, think saveing out to json would be better, mainly you'll avoid versioning issues,
Between projects? It sounds more like a custom NuGet package, which is coming.
@@IAmTimCorey I actually created a nuget package that if you want to use my, then it would have those parts plus additional dapper helpers as well.
"That's kind of horrible but sure" lmao
lol
@TimCorey am sure if you did receive my email but i just wanted whens the next discount on your next full C# course please. Many Thanks
Something should come out tomorrow or the next day with info.
Why var? Did do try to analize your code without VS? Var it is source of total mess in code. Var feature was added to c# for support an anonimous types so why you try to use it everywhere? Yes, it fast to code but take long to find errors.... and usually we spent much more time to debug and support our programms than code it ... I personally do not want to support code from other programmers (within the same project) where var is used because my time costs much expensive that benefit you got from total var using. C# seems became like jscript :(: where programmer shold not think about the types
Couple things. First, it was a demo choice to show how it could apply var instead of the explicit types (that I had used, if you noticed). Some people like var, some like explicit types. I prefer explicit types normally because it does make it more readable without VS but var is a viable option. Second, it sounds like you are confusing what var is. Var in C# is strongly typed (meaning you can only assign one type to the variable) unlike other languages like JavaScript, where var is a loosely typed (meaning you can assign different types to the same variable).
Visual studio tip #1: avoid that permanently freezing, deprecated, super expensive piece of software
Visual studio tip #2:
Use rider, 100x faster, never freezing, modern, 20x less expensive piece of software
Um, huh? Visual Studio 2022 Community Edition is free for life. Oh, and it is the same as the Professional Edition. And usually the reason why Visual Studio freezes is because of the add-in Resharper (from JetBrains, maker of Rider). The thing is, the features people use Resharper for are mostly built-into Visual Studio. They just don’t learn how to use the tool.
It sounds like you could benefit from learning about Visual Studio, since your “tips” are so incredibly wrong. You can absolutely like Rider, and it has a lot of great features, but it is more expensive than Visual Studio for most people and it lags behind Visual Studio every time the language updates, which is every year.
@@IAmTimCorey
1) Visual studio community is usable for free for 1% of developers, because you can use at max 2-3 licenses per customer and the max revenue is too low, so its mainly for self-employee juniors doing presentation webs (india).
2) Nope, do not lie to yourself please.., the reason why is Visual Studio freezing 2/3 of time is., because they are doing 90% of I/O work in main thread. YOu can use literally ANY solution bigger than 10 files and VS will freeze for 10sec... Do not try on me Microsoft notes, please.
3) YOur last argument is nothing more than JOKE, Visual studio is forcing people to buy NEW version of Visual studio literally ever 2 years for NO REASON, because of 2 new features thah are pretty easy to implement to older versions of visual studio.., But they better force the users to buy new one.. One example for all, is C# 10 and VS 2022...
And BTW there is NO BIGGER pain than work fullstack in visual studio when there is javascript involved...
Look, I get you don’t like Visual Studio, but you are woefully incorrect on your reasons. Visual Studio is free for anyone on their own or working for a company making less than $1 million per year. The team limit is 5. If your company is making more than $1 million per year, they should be paying for their software (and don’t forget, you are arguing for Rider, which is paid for everyone).
I’ve used Visual Studio for years for consulting with companies of various sized code based without these issues. In fact, Microsoft uses VS to build VS. If it was unusable, they wouldn’t be able to do their job.
The idea that they are forcing you to upgrade is also laughable. VS can install side by side with previous versions and you can build .NET Framework projects on 2015, 2017, 2019, or 2022. Oh, and the most common licensing for VS is a subscription, where you get the latest edition for free as part of your licensing.
Like I said, feel free to prefer Rider. Just don’t pretend you actually understand Visual Studio.
haha you are joke.
talk talk talk. get to the point
That “talk” is called context and context is how you learn to use something in the real world. Otherwise you are just learning theory. Besides, I covered 15 tips in an average of 5 minutes each, not counting the intro, conclusion, three bonus tips, and the preview features. That’s not exactly dragging my feet.