Live data from Hacker News

Building .NET projects is a world of pain and here's how we should solve it

blog.maartenballiauw.be

31–40 of 49 posts

Re: Building .NET projects is a world of pain and here's how we should solve it

#31
post #20

Building .Net projects cannot really be solved in a way that compares well with nix systems. - Windows had no programmability until recently with Powershell. On Linux, I can script literally everything from database installs to component updates. - Powershell. Unfortunately they got their design wrong. Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't…

>Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't have such a concept.

Why is this a problem? Why would I want to use awk when I can use the powershell object pipeline? Do you even know how powershell works?

Re: Building .NET projects is a world of pain and here's how we should solve it

#32
> Let’s look at the Node.js community and how they manage to do things.

I think NuGet is much better then npm. When you download something from NuGet you get a dll file that is injected in your References. When you download something with npm --save-dev you get 1000+ files.

Just sayin'

Re: Building .NET projects is a world of pain and here's how we should solve it

#33
post #20

Building .Net projects cannot really be solved in a way that compares well with nix systems. - Windows had no programmability until recently with Powershell. On Linux, I can script literally everything from database installs to component updates. - Powershell. Unfortunately they got their design wrong. Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't…

So where is the problem? Installing stuff? Yeah, it's not as easy, as for example `sudo apt-get install make autoconf automake libgif-dev libtool g++ gettext libglib2.0-dev libpng12-dev libfontconfig1-dev mono-gmcs git libx11-dev libexif-dev libjpeg-dev libpng-dev libtiff-dev`. But it doesn't change the fact that everything needs gazillion of other dependencies. I have no problem installing MSI files on production se…

I think you can install via script just fine these days.

http://docs.nuget.org/docs/reference/package-manager-console...

Re: Building .NET projects is a world of pain and here's how we should solve it

#34
post #20

Building .Net projects cannot really be solved in a way that compares well with nix systems. - Windows had no programmability until recently with Powershell. On Linux, I can script literally everything from database installs to component updates. - Powershell. Unfortunately they got their design wrong. Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't…

The best programmers are the ones able to deliver what the customer wants regardless of the required tooling.

Re: Building .NET projects is a world of pain and here's how we should solve it

#35
post #20

Building .Net projects cannot really be solved in a way that compares well with nix systems. - Windows had no programmability until recently with Powershell. On Linux, I can script literally everything from database installs to component updates. - Powershell. Unfortunately they got their design wrong. Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't…

I am not exactly Windows biggest fan, but one of my pet peeves is talking to a Unix developer who assumes that Windows doesn't do something because it doesn't do it how Unix does it, or who blindly assume that the Unix version is superior by definition of being Unix.

Windows has had programmability for a long time. In Unix, programmability means programs that eat text and generate text. On Windows, it means COM objects. Specifically, most programs--everything from big, end-user focused ones, like Word and Excel, to server components like IIS, to low-level stuff like the Ethernet configuration--is exposed through COM objects. While this was consumable from C++ and Visual Basic since Windows 3.1, Microsoft provides the Windows Script Host, or WSH, since Windows 98 and Windows 2000 (with optional installs back to Windows NT 4 and Windows 95) that allows trivially scripting them using much simpler languages. Specifically, two languages come by default (JScript and VBScript), and plugins exist for every traditional Unix language I can think of (Tcl, Perl, Python, Ruby, and even PHP). You can also use any language that has COM bindings (most of them) to use these interfaces if you don't like what WSH provides.

Is this different from Unix? Yes. Is it worse than Unix? That depends. You can have strongly typed rich data, which is a big improvement on text streams for bigger workloads. You can trivially interact with running applications, which is something that is intermittently available on Linux through DBus, the use of SIGUSR, and the like (program-dependent). You can easily work with data that are not trivially represented by text, like nested dictionaries. On the flip side, I do understand that COM and DCOM are more complicated than text streams, but I think that's a trade-off, not an immediately gimme.

Now, the one thing annoying here is that WSH is based on COM, whereas most modern Windows is based on .NET. .NET allows a much richer object system than does COM, so Microsoft replaced WSH with PowerShell so that users could still use a common scripting language, but easily work with the .NET type system. bash/Cygwin would not have been an appropriate choice here. Modeling PowerShell on those systems was; if you look at the language, you'll find it takes heavy inspiration from traditional shell scripting languages, including bash and Perl, but it differs again due to the focus on objects v. text.

So no, it is not fair to say that Windows is not programmable. I also don't think it's obvious that forcing bash to play nice with Windows would've been better than PowerShell, which would've either resulted in giving up a lot of Windows programmability, or forking bash to work better with the Windows way of doing things--neither an improvement.

Re: Building .NET projects is a world of pain and here's how we should solve it

#36
post #20

Building .Net projects cannot really be solved in a way that compares well with nix systems. - Windows had no programmability until recently with Powershell. On Linux, I can script literally everything from database installs to component updates. - Powershell. Unfortunately they got their design wrong. Unix is a text and file based OS; you can script any server configuration with tools like awk. Windows apps doesn't…

Even before PowerShell, Windows had thousands of COM objects in the system that can invoked within a scripting language like .vbs or any language that has APIs for accessing com objects like ActiveState perl. The Windows Explorer shell, Windows Media Player, not to mention Microsoft Office applications, have object models that are exposed and available to programmed against. I am not so sure that UNIX has anything be…

I'd just like to add to this that *nix developers don't appreciate COM for what it really added to windows.

In Linux you only generally call C functions from higher level languages (and sometimes C++). Python programmers use python libraries and sometimes C libraries. Ruby programmers use ruby libraries and sometimes C libraries.

Never will you see someone calling in to a Ruby library from a Python program.

On windows via COM you get Perl calling in to C++ calling in to C# calling in to VB.NET.

Re: Building .NET projects is a world of pain and here's how we should solve it

#37
Not that I'm really against this article, but psake (https://github.com/psake/psake) is a more realistic end-goal to handle the kind of flexibility you really need in projects. (It's accomplishable through MSBuild pre/post actions, but those are murder to edit anywhere but Visual Studio.) The problem with it, which is potentially a big one, is that psake uses PowerShell, and is therefore Windows-only. I'm hopeful that PowerShell can be ported to Unix soon as part of the general open-sourcing of Microsoft's .NET stack. I wouldn't use PowerShell as a replacement for bash, but as a cross-platform equivalent to Groovy/CRaSH, it'd be very handy for exactly this kind of thing. (Think of how Gradle fits into the Java world.)

Re: Building .NET projects is a world of pain and here's how we should solve it

#38

Earlier quoted context omitted.

That is not entirely true. For example the Windows Azure SDK has to be installed. Database tools have to be installed if you want to be able to compile a database project. There are many of the new things that do not follow this approach (hopefully: yet).

Added a P.S. to the post to reflect this: P.S.: A lot of the new packages like ASP.NET MVC and WebApi, the OData packages and such are being shipped as NuGet packages which is awesome. The ones that I am missing are those that require additional build targets that are typically shiipped in SDK's. Examples are the Windows Azure SDK, database tools and targets, ... I would like those to come aboard the NuGet train!

It doesn't seem to have been widely publicized, but as of NuGet 2.5 it's been possible to include custom .targets files in NuGet packages which are automatically pulled into a project when the package is referenced: http://docs.nuget.org/docs/reference/support-for-native-proj...

Re: Building .NET projects is a world of pain and here's how we should solve it

#39
post #37

Not that I'm really against this article, but psake ( https://github.com/psake/psake ) is a more realistic end-goal to handle the kind of flexibility you really need in projects. (It's accomplishable through MSBuild pre/post actions, but those are murder to edit anywhere but Visual Studio.) The problem with it, which is potentially a big one, is that psake uses PowerShell, and is therefore Windows-only. I'm hopeful t…

If you want to run on both Windows and UNIX-style systems, try FAKE (https://github.com/fsharp/FAKE). It's rapidly becoming a popular choice for building all sorts of .NET projects. Scott Hanselman recently covered it on his blog: http://www.hanselman.com/blog/ExploringFAKEAnFBuildSystemFor...

Re: Building .NET projects is a world of pain and here's how we should solve it

#40

Instead of node I would say look at Maven, I never had a problem with a java project that used maven, all I ever needed was maven, and a JDK. It may not be the best out there but to me seems pretty good considering it is as simple as download source code, and run "mvn package".

IMO maven in nowhere near in comparison with how npm works with modules.
Post reply on HN