Live data from Hacker News

Introducing Bing Code Search for C#

blogs.msdn.com

201–210 of 235 posts

Re: Introducing Bing Code Search for C#

#201

It's interesting that the example code shown is so clunky. It uses try-finally to manually dispose the resource when the idiomatic way would be to wrap it in a using block: using (var file2 = new StreamReader(file)) { while ((line = file2.ReadLine()) != null) Console.WriteLine(line); } It's possible this is a badly picked example but it shows one big downside of this -- the lack of discussion about the sample code th…

But with a 'using' you can't catch an exception. So in production I end up using ( ;-) ) try catch finally.

> with a 'using' you can't catch an exception

[Citation needed]

Re: Introducing Bing Code Search for C#

#202
post #5

C# and .NET get a bad rap for being created by Microsoft. But one thing that can't be ignored is how polished their development tools are. I absolutely love coding in Visual Studio.

Coming from Eclipse and Jetbrains world(Webstorm rocks), I have a pretty hard time adjusting to Visual Studio.

For example, I am used to having a class information(methods, variables, etc) or similarly Javascript function information in Structure window updated whenever my cursor moves in the code window.

In Visual Studio this apparently is not possible automatically, and you have to make a custom hotkey to force this behaviour.

http://stackoverflow.com/questions/546113/visual-studio-auto...

How do people work through someone's else's code in VS? Do they really read every single line or use Object Browser?

I understand that Jetbrains Resharper fixes many of these issues, but that is not vanilla VS then.

Re: Introducing Bing Code Search for C#

#203
post #82

Earlier quoted context omitted.

VS lock in is a very real thing. At my current employer, there is no way they could ever come off of VS and .Net because of the lack of polyglots in the office. There is one of us that does Java, 3 that do PHP (only in the last 6 months), and 6 that are set up for .Net MVC. Management just can't spare the costs to retrain, and none of these guys go home and code on non MS platforms.

I could switch languages more easily than I could switch dev environment. The lock in to me is bssically simply that there aren't many other good language+IDE combos out there. There are plenty of languages that are interesting but very few come with a great IDE. I'd love to do Rust or Haskell all day, but I'm sure as hell not going to vim/emacs/sublime from VS. I almost envy those who never started using and IDE and…

I'm curious. What do you find so great about Visual Studio? After working with it for a while, I came to the conclusion that while it's extremely fast, it's not particularly full-featured compared to Eclipse. The amount of refactoring you can do out of the box is minimal, and the search is ridiculously crippled.

I haven't lived with it long enough to find out if it's as easy to break as Eclipse when you install the wrong combination of plugins, though. Oddly enough, its vim emulator plugin is much better than what I found for Eclipse, which I find quite ironic.

Re: Introducing Bing Code Search for C#

#204

It's interesting that the example code shown is so clunky. It uses try-finally to manually dispose the resource when the idiomatic way would be to wrap it in a using block: using (var file2 = new StreamReader(file)) { while ((line = file2.ReadLine()) != null) Console.WriteLine(line); } It's possible this is a badly picked example but it shows one big downside of this -- the lack of discussion about the sample code th…

But with a 'using' you can't catch an exception. So in production I end up using ( ;-) ) try catch finally.

The using block compiles to the equivalent of a try-finally block. If you want to catch an exception you can do it inside or outside the using block.

Re: Introducing Bing Code Search for C#

#205
post #48

Earlier quoted context omitted.

I have done a lot of Java, Scala, etc. IntelliJ & Eclipse are both wonderful IDEs in their own right. A lot of things like ReSharper were in those IDEs before Jetbrains (maker of IntelliJ) made the plugin for VS. After trying VS for a couple of projects I found it completely baffling and backwards. And I don't think this is because VS is bad, but because the way I approach software is completely different. I want to…

It sounds like you just don't know Windows/VS/IIS as well as you know the other stacks which is entirely understandable since I'm guessing you don't work with them very often. For future reference you can compile VS projects from the command line if you want using MSBuild, that's all building in VS does. As far as IIS is concerned you can maintain all it's configuration via config files so an experienced Windows admi…

> For future reference you can compile VS projects from the command line if you want using MSBuild, that's all building in VS does.

Err, no - MSBuild, is basically a clone of Ant, except that it is meant to be generated by Visual Studio. This is completely backwards from what happens in say Java/Scala with Maven, SBT or Gradle.

The advantage of having the build process external, as happens with Maven and Maven-like environments, is that you can easily automate things by writing plugins, plus you're not tied to the IDE at all. You need to push your artifacts into a repository? There's a plugin for that. You need to sign your artifacts with a PGP key? There's a plugin for that. You need to automatically increment the version number on releases? There's a plugin for that. Etc, etc... and all of these can be used in continuos integration processes.

Plus, MSBuild doesn't handle dependency management, which is completely retarded. You've got NuGet now, but again, Microsoft had to over-engineer it, to make it IDE friendly and thus the ease of setting up your own Maven repository is gone.

And have you tried building MSBuild projects on top of Mono? Try it. It's fun ;-)

Basically only a .NET developer that never experienced other environments could claim that MSBuild/VS.NET is satisfactory, but for the rest of us, it's like trying to do software development with early-2000 tools and IMHO, that's where the entire .NET ecosystem is.

Re: Introducing Bing Code Search for C#

#206
post #190
post #169

Earlier quoted context omitted.

The old IIS is like you describe. But, the latest IIS is fast and easy. In all honesty this is what I find from most unknowledgeable Microsoft bashers. They tried out the MS development stack with Classic ASP, Visual Basic 6 and SourceSafe 15 years ago. Then in their head they're contrasting that to the latest RoR tools with github. Many are not even aware of ASP.NET MVC and how different it is from ASP.NET. Now, thi…

As a knowledgeable Microsoft basher, you're right. MVC is better but still a long step away from something great. Some of the internals are crazy bad from attribute thread safety to the numerous singleton piles of crud like the ViewEngines collection and route data. Not only that, the tooling really doesn't scale up well either. I can only say after managing a project with 400 controllers that it doesn't scale up to…

So you had an extremely large .NET project and complained it didn't scale.

And since you attribute those problems to .NET, your solution is a small project (which incidentally uses another technology).

Not dismissing your argument as a whole, but you have to admit you made at least one giant logical fallacy right there.

Re: Introducing Bing Code Search for C#

#208
post #198
post #190

Earlier quoted context omitted.

As a knowledgeable Microsoft basher, you're right. MVC is better but still a long step away from something great. Some of the internals are crazy bad from attribute thread safety to the numerous singleton piles of crud like the ViewEngines collection and route data. Not only that, the tooling really doesn't scale up well either. I can only say after managing a project with 400 controllers that it doesn't scale up to…

WTF? You complain about singletons, then prefer a language where the use of [sharedInstance] is extremely common. Objective-C is singleton hell. Both in third party code, and core libaries. C# is vastly nicer than objective-c, and I'm a iOS developer. I'd rather use C# or Scala with a IoC container to handle the lifetime of objects, rather than using singletons.

Yes exactly that.

The difference is that your Objective-C/iOS application doesn't consist of thousands of threads which require synchronised access to these objects. It's a pretty static thing with an event loop. Possible a couple of background worker threads.

For a desktop application or even mobile application it's fine but for a massively scalable back-end enterprise system it's a pain in the butt.

Singletons are not for managing lifetime as well. They are a container for an object -- nothing else. Lifetime should be managed separately i.e using a container/service locator or something. Everything I've seen Cocoa-wise is pretty decoupled so far. There are some crimes but only inexperience seems to require them.

Re: Introducing Bing Code Search for C#

#209
post #56

Earlier quoted context omitted.

Personally, it's because Microsoft development locks you in, and costs a lot of money. The OS costs money, the server OS costs money, the database costs money, the IDE costs money, everything costs money, and you have to use it, for the life of your app. To many young developers these days, and IIS server is the thing your company keeps in the closet to some sluggish legacy monstrosity which has been replaced for yea…

It is a lock in (most technology does lock you into certain dependencies) and it does cost money. But, it's all so easy to use now / saves you lots of time. You can roll out anything using PowerShell these days. Or just copy VMs with OS/IIS/SQL already set-up. Deploying everything can be one-click. VS even has git integration now. The old IIS is like you describe. But, the latest IIS is fast and easy.

[deleted]

Re: Introducing Bing Code Search for C#

#210
post #5

C# and .NET get a bad rap for being created by Microsoft. But one thing that can't be ignored is how polished their development tools are. I absolutely love coding in Visual Studio.

Personally, it's because Microsoft development locks you in, and costs a lot of money. The OS costs money, the server OS costs money, the database costs money, the IDE costs money, everything costs money, and you have to use it, for the life of your app. To many young developers these days, and IIS server is the thing your company keeps in the closet to some sluggish legacy monstrosity which has been replaced for yea…

Like any other commercial vendor I would say.
Post reply on HN