Hot answers tagged

61

You are right to point out that the users are the most important thing, in the end. But here's the point I think you've missed: Other developers are users of your code. It's as important what they see as what your application users see. Now if it was a tradeoff -- if improving your code made the user experience worse -- then I'd have to say pay attention to ...


42

A service runs in the background, even if no-one is signed on to the machine. Anything you can imagine wanting to do without relying on a person to start an app and click a button is a good candidate for a service. For example, monitoring a folder and whenever a file is written to it, process it in some way. Any "server" you can think of - web server, ftp ...


30

If there's some consistency, I try to overlook it and move on. There's no need to be a perfectionist. But if the developer who wrote the code was careless, then he or she may not understand that other developers will need to read their code, and if the developer doesn't understand the concepts of readability, then this tells me something about this developer ...


25

I don't think I'm understand what you mean by drag and drop. I don't use .NET, but I do use Qt for user interfaces, and use Qt Creator for creating the layout of widgets. I don't think this makes me less of a programmer, as the actual logic of the program is all done elsewhere, and I just use the Qt Creator to make things line up in a way which is: much ...


19

A programmer should work as a limited user with admin access. That is, the programmer should be the admin of the machine, but while working, he should always use a limited user account. If you need elevated rights to work, for anything but installing software, you're doing something very wrong. Worse, if you work as a power user or disable UAC prompts or ...


17

Setting up unit testing in VS2010 is fairly easy. Add a new project to your solution and select the Test Project template from the New Project dialog box. Usually you create one test project for project you want to test in your solution (ie. BusinessLogic.proj would have a mate called BusinessLogicTest.proj, just as an example). Once you have the ...


17

I fix whichever unit tests aren't working. If they are all passing, then I write a new one.


16

Yes. Taking a sample set of 50+ developers I have worked with, I have yet to come across a developer who is consistently sloppy in their formatting yet has outstanding output in terms of code correctness, and meets all functional requirements and non-functional requirements consistently and effectively. Sloppy formatting is a sign of a lack of attention to ...


15

It was written using WPF, so that would be XAML and (most likely) C#. Wikipedia just states: The IDE shell has been rewritten using the Windows Presentation Foundation (WPF), whereas the internals have been redesigned using Managed Extensibility Framework (MEF) which doesn't help with the non XAML part. I suspect that there will be C++ elements in ...


15

No, it wouldn't help. C# and C++ are quite different languages, they might have similar syntaxes but that's where their similarities stop. Now, if you were already familiar with C++, yes, that knowledge would be useful (but not required) while learning C++ or any other language, really.


14

Dragging visual images around is just one of many development tools to make your life easier -- same as a debugger, or something that auto-generates getter and setter functions -- and there's nothing inherently wrong with that. It's like using a calculator. If you rely on it too much as a kid then you might not ever get good at your times tables. However, ...


14

The main shortcoming is that you throw away one of the main properties (not necessarily advantages) of C# - that it is statically typed (and for most part type safe). The problem with dynamic typing is that it often hides bugs that would be otherwise revealed during compilation. Such bug then only manifests on run-time, which of course makes it much harder ...


11

Since this could be a long ongoing project, I want to get the structure right from the beginning It's pretty tricky to know up front what the correct structure for a collection of code should be, especially where the project is essentially an R&D effort (for which read: you haven't personally built such a system before1). So don't bother; instead, ...


10

I'm not sure what kind of shortcomings are you looking for, but if you want to know about features that work with static typing, but not with dynamic, there are few: Extensions methods don't work. This is probably the biggest one. If you have dynamic collection, you can't use code like collection.Distinct(). That's because available extension methods ...


10

I think that in a way you are partly asking yourself the wrong question. Is the code readable? Can you understand what it is supposed to be doing at a glance? Code formatting is something that allows people who are unfamiliar with your code to feel comfortable. In some ways this is a good thing, that you might look at someone else's code and have it feel ...


9

You could always use the "Build Version Increment" open source add-on for visual studio to do it for you. ...I've tested the addin with Visual Studio 2005/2008 on C#, VB.NET and C++.NET projects under Windows XP/Vista SP1. Functionality Different auto increment styles can be set per major, minor, build or revision number. Supports C#, ...


9

At the beginning of each day, I have a text file called Todays Goals.txt, and then each day, I add the date like this. Friday 02/25/2011 Goals Then I write down each project I am working on, and what I have to get done today, or to complete it. Then at the end of the day, I write down stuff to be done tomorrow. This daily process helps me remember ...


9

Services on Windows are basically programs that run without a GUI. Web servers (such as apache), database servers (such as mysql & sql server), anti-virus engines, and application/'middleware' servers are all practical examples of applications that often run as services. There may be GUI client to allow you to interact with the service, but the service ...


9

Disclaimer: I work in both languages (and a few more) on a daily basis. When I was studying CompSci at University (studying Comp Sci & Games Development), the curriculum they used taught us C# in the first year (to get the basics of CompSci and Software Development), we moved onto C++ in the second year (so that we could study, what you are calling ...


8

it's simple: drag and drop when it works, hand-code when it doesn't it's not an either-or situation!


8

Basically I never forget what I am working on. Visual studio pops open at the last file you were working on anyhow, or, I never close down Visual Studio at all and just hibernate. I place NotImplementedExceptions at abstractions/implementations that aren't necessarily important to continue developing what I was working on. I do place a lot of TODO's in my ...


8

The Express editions of Visual Studio allow commercial use, so this is not a problem, one way or another. I believe the only commercial use not allowed is using VS Express in a hosting service. The original FAQ article that said so seems to have gone AWOL and this forum thread seems to be the next best thing (thanks @Anna Lear).


8

OK, you have to use Assert and all that, but the other answers don't answer the actual question. Maybe you have your reasons (as I have mine, which is how I found this question). This might help you a little: It turns out to see a test’s output, you just double-click on the test summary line, and all the output is down at the bottom of that window. ...


8

I can't help thinking that coding is all about details. Every detail of our code is important - for correctness, for readability, for extensibility, for maintainability. While the examples given are not disastrous in themselves, to me they speak of a lack of attention to detail that I would consider to be worrying - particularly in a tool like Visual Studio ...


7


7

The caveat with measuring maintainability is that you are attempting to predict the future. Code coverage, bug count, LOC, cyclomatic complexity all deal with the present. The reality is that unless you have concrete evidence that the code is not maintainable as is..ie...fixing a bug caused N amount of hours of un-needed time due to un-maintainable ...


7

You are programming, it's just that you have less control over the generated code, which is usually why you would prefer hand coding. You could have the best of both worlds: use drag & drop to make a quick prototype, then fine-tune it by hand.


7

There are only a few differences between 3.5 and 4.0. The book should be fine for learning. I would definitely use VS2010 if you can though -- it is far more stable than VS2008. The Xaml editor crashes and has other issues in VS2008, even with SP1. The major differences with 4.0 from 3.5 are minor data binding changes, adding x:Reference, and having a ...



Only top voted, non community-wiki answers of a minimum length are eligible