|
wwb posted:^^^^ this. It is basically the only plugin I use and I'm honestly not sure if I could use visual studio without it. Every time I use VS without ReSharper, I have this moment of shock. "I'm supposed to remember what namespace things are in and add using directives? Lame!"
|
# ? Jun 26, 2013 21:40 |
|
|
# ? Jun 5, 2024 03:04 |
|
To be fair, Visual Studio has the built-in Shift+Alt+F10 that will do the same thing. But it's much slower and requires explicit action, unlike ReSharper which will pop up that nice thing where you just have to hit alt+enter.
|
# ? Jun 26, 2013 21:42 |
|
I've never used it / we don't use it in the office, looking over their webpage I don't think I understand their Navigation features tab. How is it different from simply right click -> Go to definition with "vanilla" VS, or as you pointed out Ithaqua, often it seems like VS will know what the proper namespace is if I start to type something and right click -> Resolve.
|
# ? Jun 26, 2013 22:00 |
|
The shirts jetbrains is handing out here say "Keep calm and hit alt-enter". JetBrains rocks. Edit: ^^^^ no idea except that is a relatively new feature in Visual Studio, I think 2010 got it first.
|
# ? Jun 26, 2013 22:00 |
|
Orzo posted:To be fair, Visual Studio has the built-in Shift+Alt+F10 that will do the same thing. But it's much slower and requires explicit action, unlike ReSharper which will pop up that nice thing where you just have to hit alt+enter. Not that I dislike ReSharper, but isn't "hitting Alt+Enter" an explicit action? "Ctrl+Period, Enter" will add my using directives just fine and seems like the same amount of work, no?
|
# ? Jun 26, 2013 22:42 |
|
Hey guys, I apologize as I know this has been answered a number of times already, but what is a good library for logging errors, both client side and server side? I'd prefer something that can store the logs in a sql azure database or even azure storage. This is a Silverlight app so my options may be limited. Am I right in thinking there is a better tool/library for this kind of thing than just pushing it into a database myself? Google is bringing up quite a few such as elmah, log4net, etc. I know logging has come up before, but I don't know if it was specfic for error logging or if it was application wide logging. Is it worth looking into logging actual application use and is that something that any of you do? How you would decide if it was worth it or not? Number of users, distance of users? That's very open ended but I would like to know some of your thoughts when deciding things like that.
|
# ? Jun 26, 2013 22:57 |
|
Visual Studio also didn't add usings until vs2008 or so. Current versions are so vastly superior to what came before it isn't even funny. Go try and use VS2003 or 2005 without resharper and let me know how it feels. With the caveat that I know very little about silverlight outside of visceral hate, you might want to go look at NLog or log4net on the server side. I suspect nlog might have a silverlight client. Either of those tools are capable of logging to a DB via configuration.
|
# ? Jun 26, 2013 23:14 |
|
wwb posted:With the caveat that I know very little about silverlight outside of visceral hate, you might want to go look at NLog or log4net on the server side. I suspect nlog might have a silverlight client. Either of those tools are capable of logging to a DB via configuration. NLog looks pretty good, thank you! And yep it works with Silverlight.
|
# ? Jun 26, 2013 23:43 |
|
I have to do a 90 minute web presentation on TDD in July. I figure I'll talk for 10-15 minutes and burn through a few slides, then dive into a live demo where people get to watch me write some code. I'm trying to decide what to do... I'm thinking of running through Roy Osherove's string calculator, but I'm open to other suggestions. I hate giving web presentations. I did an async/await talk at a user group a few months ago and that was great, because I could look at the audience and gauge their reactions and adjust accordingly, and also have them interrupt me to ask questions. If anyone's interested in attending to watch me make an rear end out of myself, PM me and I'll send you the URL. I'd just post a link but I'm kinda reticent to post anything here that ties me back to my employer.
|
# ? Jun 27, 2013 01:48 |
|
Ithaqua posted:I have to do a 90 minute web presentation on TDD in July. I figure I'll talk for 10-15 minutes and burn through a few slides, then dive into a live demo where people get to watch me write some code. I'm trying to decide what to do... I'm thinking of running through Roy Osherove's string calculator, but I'm open to other suggestions. I used the string calculator test as the technical test for my last batch of interviews. It is pretty solid, but make sure you introduce requirements one at a time and explain how the test process can help you deal with mutating business requirements without a regression bug. By the by, you wouldn't believe how many applicants knew nothing about the string manipulation stuff built in to .net and went for the begins with and ends with methods. Plan out your code ahead of time and if you use stuff off the beaten path, maybe give a quick word on the static string methods. I need to figure out where the good developers in this city are hiding.
|
# ? Jun 27, 2013 01:55 |
|
Dietrich posted:I used the string calculator test as the technical test for my last batch of interviews. It is pretty solid, but make sure you introduce requirements one at a time and explain how the test process can help you deal with mutating business requirements without a regression bug. Yeah, that's my plan. I'm going to "spoiler" the specs and reveal them one by one, and for every test go through arrange/act/assert, then "red, green, refactor". With emphasis on refactor, because I hear people complain all the time that TDDed code is ugly because it was developed without a plan. I'm also going to run through the kata tomorrow and make notes to refer to during the live coding part.
|
# ? Jun 27, 2013 04:51 |
|
epalm posted:Not that I dislike ReSharper, but isn't "hitting Alt+Enter" an explicit action? "Ctrl+Period, Enter" will add my using directives just fine and seems like the same amount of work, no?
|
# ? Jun 27, 2013 05:07 |
|
Orzo posted:ReSharper pops the suggestion up automatically if the unresolved symbol is anywhere on your screen--it also highlights it red immediately. VS requires you to click on it, and even then it's a tiny little accelerator underline under the first character or something. I know this sounds pretty trivial but the difference is fairly dramatic in terms of usability. Anyway, that's just one thing out of about 100 that ReSharper does awesomely. One thing ReSharper calls out that I love is code simplification. I frequently end up doing something silly like foo.Where(bar=>bar>10).First(). ReSharper will call that out and fix it so it's just foo.First(bar=>bar>10). It's also great for removing unnecessary using directives, calling out naming convention violations (which we all know that I'm anal about), converting foreach->LINQ and vice versa, reminding you when something can (and probably should) be readonly, finding unused methods/fields, and warning about accessing modified closures (which has absolutely saved me from shooting myself in the foot). It's one of those tools that does a ton of stuff and everyone has a different thing they love best about it. I installed it and was in love after about 5 minutes. And it's really pretty cheap, especially if you can get an employer to foot the bill.
|
# ? Jun 27, 2013 05:27 |
|
Or the best four shortcuts. CTRL+n CTRL+shift+n CTRL+alt+shift+n CTRL+alt+space when typing any class name from any dll.
|
# ? Jun 27, 2013 07:44 |
|
Ithaqua posted:Yeah, that's my plan. I'm going to "spoiler" the specs and reveal them one by one, and for every test go through arrange/act/assert, then "red, green, refactor". With emphasis on refactor, because I hear people complain all the time that TDDed code is ugly because it was developed without a plan. I also love Resharper. I feel like its made me a better programmer, with easier to read code and I find myself automatically sticking to conventions. I'm pretty sure that the next time I interview, I'm going to ask about Resharper during the process.
|
# ? Jun 27, 2013 13:54 |
|
ASP.NET MVC goons! I'm catching up on the framework features and am not really sure how to avoid ending up with a /Views/Shared/EditorTemplates folder that's a mile long. The project I worked in before started nearly as soon as the framework was released, so we wrote our own binding, validation, and HTML helpers. I want to start using the built in stuff, though. Before, I just used partial views to achieve the same thing, (which was easy to keep organized across a big application) but can't here. Any tips?
|
# ? Jun 27, 2013 20:14 |
|
glompix posted:ASP.NET MVC goons! I'm catching up on the framework features and am not really sure how to avoid ending up with a /Views/Shared/EditorTemplates folder that's a mile long. The project I worked in before started nearly as soon as the framework was released, so we wrote our own binding, validation, and HTML helpers. I want to start using the built in stuff, though. Before, I just used partial views to achieve the same thing, (which was easy to keep organized across a big application) but can't here. Any tips? It would help if you specified the actual problem you are trying to solve/solving. Personally I've only used EditorTemplates for formating DateTimes to different stuff... But I guess I have similiar "problems", I tend to get a lot of shared partial views that are needed everywhere.
|
# ? Jun 27, 2013 21:16 |
|
zokie posted:It would help if you specified the actual problem you are trying to solve/solving. Personally I've only used EditorTemplates for formating DateTimes to different stuff... But I guess I have similiar "problems", I tend to get a lot of shared partial views that are needed everywhere. Good call. This seems like it should be really basic. Here's a model: code:
code:
One caveat is that I'm working with a really lovely database schema where the children are defined on the parent table like "Child1Prop1, Child1Prop2, Child2Prop1 ..." for 6 children. I'm using NHibernate and have Children as an unmapped collection and just build it when the parent is constructed.
|
# ? Jun 27, 2013 21:39 |
|
I have a button that needs to toggle once clicked. It kicks off a process that will complete and return the button to normal, a click between that time it'll kill the process. It's functionality changes and the user needs to know in a big, obvious way. Right now I'm just setting the .BackColor and it looks terrible. There's a white border between the BackColor and the edge of the button, just looks janky. I thought it would look more like Qt's "background-color: green". What's the best way to change the visual style of a button?
|
# ? Jun 27, 2013 21:57 |
|
JawnV6 posted:I have a button that needs to toggle once clicked. It kicks off a process that will complete and return the button to normal, a click between that time it'll kill the process. It's functionality changes and the user needs to know in a big, obvious way. Right now I'm just setting the .BackColor and it looks terrible. There's a white border between the BackColor and the edge of the button, just looks janky. I thought it would look more like Qt's "background-color: green". The best way? Use WPF, then you have an insane amount of control over how your UI appears. Why not just change the text to "Cancel" and display a never-ending progress bar to show that it's "working"?
|
# ? Jun 27, 2013 22:44 |
|
The user will hear the process happening, it's out in the real world making widgets move. When they hear it going off the rails I want an obvious go-to for them to cancel it. The button right underneath their cursor when they kicked it off is a good spot. I just need a non-crappy way to show that if they happen to look at the screen. Are you saying plain old windows forms can't color a stupid button all one shade?
|
# ? Jun 27, 2013 22:49 |
|
JawnV6 posted:The user will hear the process happening, it's out in the real world making widgets move. When they hear it going off the rails I want an obvious go-to for them to cancel it. The button right underneath their cursor when they kicked it off is a good spot. I just need a non-crappy way to show that if they happen to look at the screen. Checkboxes have a property that makes them appear as toggle buttons. I change the backcolor as an indicator on them all the time. Looks fine to me. Especially if you use the operating systems original theme style and not that classic windows 95 crap
|
# ? Jun 27, 2013 23:04 |
|
Is there a decent reference I could refer to understand like, enough of C++ that I can read documentation on Win32 stuff and understand it well enough to work with it in C#? I mean in particular I have trouble understanding what all the data types for arguments to functions are supposed to be.
|
# ? Jun 28, 2013 00:57 |
|
If you're trying to wrap your head around P/Invoke stuff, the piece you're missing isn't C++ knowledge. P/Invoke is just a pain. Maybe give something like this a shot? Otherwise I don't understand your question.
|
# ? Jun 28, 2013 01:01 |
|
RICHUNCLEPENNYBAGS posted:Is there a decent reference I could refer to understand like, enough of C++ that I can read documentation on Win32 stuff and understand it well enough to work with it in C#? I mean in particular I have trouble understanding what all the data types for arguments to functions are supposed to be.
|
# ? Jun 28, 2013 01:06 |
|
GrumpyDoctor posted:If you're trying to wrap your head around P/Invoke stuff, the piece you're missing isn't C++ knowledge. P/Invoke is just a pain. Maybe give something like this a shot? Like look at this: http://msdn.microsoft.com/en-us/library/windows/desktop/bb530498(v=vs.85).aspx I don't really know what HWND, LPCWSTR, or DWORD are supposed to be and I feel like I'd probably understand it better if I had some basic knowledge of Windows C++ programming? I mean you can look these things up one-by-one I guess, but that's a pain and leads to a really shallow understanding.
|
# ? Jun 28, 2013 01:32 |
|
This page has a table which maps Win32 types to CLR types. It can come in handy since even pinvoke.net is full of small errors like mapping DWORD to int.
|
# ? Jun 28, 2013 02:15 |
|
RICHUNCLEPENNYBAGS posted:Like look at this: http://msdn.microsoft.com/en-us/library/windows/desktop/bb530498(v=vs.85).aspx A "really shallow understanding" is pretty much what you want with P/Invoke - time spent getting a deep understanding of it is not well spent. If you're having to do so much detailed P/Invoke work that it feels like learning it really well is worth it, there's likely a better way to do what you're doing. (Common ones include digging around for a poorly-documented .NET interface, creating your own with C++/CLI, or grabbing someone else's code that's already solved the problem.) Plus - and I can see why this might not be obvious - Microsoft's stable of typedefs aren't indicative of a whole new programming paradigm that you need to learn to be able to talk to their APIs. They just like typedefs. Here's the extremely technical documentation for a DWORD. It's even worse for a LPCWSTR. If you have some specific P/Invoke thing you're trying to do, post it here and we'll try to help you out.
|
# ? Jun 28, 2013 02:27 |
|
JawnV6 posted:The user will hear the process happening, it's out in the real world making widgets move. When they hear it going off the rails I want an obvious go-to for them to cancel it. The button right underneath their cursor when they kicked it off is a good spot. I just need a non-crappy way to show that if they happen to look at the screen. You can put an image in a button and swap a big green go button for an equally big red stop image. Munkeymon fucked around with this message at 17:36 on Jun 28, 2013 |
# ? Jun 28, 2013 15:34 |
|
Quick resharper question. My WPF project has a folder named src, where App.xaml.cs is located. Its namepsace is namespace MyProj.src, but resharper tells me Namespace does not correspond to file location, should be: 'MyProj' The file location is MyProj/src/App.xaml.cs, so why is resharper complaining?
|
# ? Jun 28, 2013 16:16 |
|
epalm posted:Quick resharper question. My WPF project has a folder named src, where App.xaml.cs is located. Its namepsace is namespace MyProj.src, but resharper tells me Namespace does not correspond to file location, should be: 'MyProj' Why on earth would you put a "src" folder within your project? That doesn't make any sense. And having it included in the namespace is even worse. The namespace should be organizing your classes, just like folders are for organizing your classes. Thus it follows that your folder structure is equivalent to your namespace. But if you were to compile your code and distribute it, is the "src" namespace going to make sense? Nope! It offers no organizational value, and shouldn't be part of the namespace. I think what you're seeing is actually a bug in ReSharper. I was having the same thing happening until I moved the file out of the folder, then used ReSharper's quick fix to create the folder and move the file into it. After that, it was correctly identifying folders as part of the namespace. New Yorp New Yorp fucked around with this message at 16:44 on Jun 28, 2013 |
# ? Jun 28, 2013 16:42 |
|
Can't you just uncheck the namespace provider property of the folder? Sometimes I do that when I need folders to organize it for myself but still want stuff to have the same namespace. It will still gently caress it up when making a new class with Alt+C though... Edit: I read good after just eating way too spicy food.
|
# ? Jun 28, 2013 17:03 |
|
zokie posted:namespace provider property I never noticed that before. That's the problem epalm is having, then.
|
# ? Jun 28, 2013 17:19 |
|
When will .net developers learn that tinkering with defaults causes problems?
|
# ? Jun 28, 2013 18:25 |
|
Tinkering with defaults is the only way to ensure no one will ever mess with your stuff.
|
# ? Jun 28, 2013 18:44 |
|
I think step 1 in most of my projects is "delete all default settings" I'm also masochist.
|
# ? Jun 28, 2013 20:23 |
|
Is there any reason to use the ToString method on, say, and integer instead of just appending an empty string (ie. myInt + "") when something wants a string? I feel like they accomplish the same thing, but I wasn't sure if there was some added security to the ToString route instead.
|
# ? Jun 28, 2013 22:23 |
|
Sab669 posted:Is there any reason to use the ToString method on, say, and integer instead of just appending an empty string (ie. myInt + "") when something wants a string? I feel like they accomplish the same thing, but I wasn't sure if there was some added security to the ToString route instead. Because ToString is one of the few methods that's exposed on System.Object and is available to every single object in the entire language. Using it shows your intent. "I want to get the string representation of this object." Adding an empty string to an object is just silly and doesn't tell me anything about your intent.
|
# ? Jun 28, 2013 22:27 |
|
What's the best way to indicate when writing a virtual method that overriding is fine but that you need to call the base version of the method as well? Or is there a better pattern for this? I know Dispose's pattern uses two methods but even there unless the extending class defines a third to mimick the second for anything that might extend from there, you'll still run into the problem somewhere down the line if your inheritance goes that far. I kind of feel like a protected event might be the safest route but that just seems like overkill. Sab669 posted:Is there any reason to use the ToString method on, say, and integer instead of just appending an empty string (ie. myInt + "") when something wants a string? I feel like they accomplish the same thing, but I wasn't sure if there was some added security to the ToString route instead. A few other things is that what you wrote might make concatenation happen, which would be more resource intensive, but not by a significant amount and the compiler's probably smart enough to remove the + "" anyways. Also, that would call myInt's implicit cast to string, which probably calls ToString from there and I can't imagine what code wouldn't but with what was said above, there's no reason not to risk it. Mr.Hotkeys fucked around with this message at 22:43 on Jun 28, 2013 |
# ? Jun 28, 2013 22:41 |
|
|
# ? Jun 5, 2024 03:04 |
|
Just out of habit, I almost always use Convert.ToString(object) unless it's a value type. This is probably coming from years and years of working with untyped ADO.NET DataTables in a terrible architecture, though. If I don't have to handle a check for null, it's a win.
|
# ? Jun 28, 2013 22:56 |