New project MVC 5 (why ?)

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

New project MVC 5 (why ?)

Post by Henk »

I was already using visual studio 2013 express for a while and the conversion from 2012 - 2013 gave no problems. But I was not using all of 4.5 framework. For instance I did not use the latest layout and style sheets. So I created a new project Skipper2. But that gives quite a lot of extra work. For all folders need to be created again and all source files need to be copied to the right directories. Problem was that I did not copy everything for I thought I did not use some source files anymore. Result hundreds of compile errors.

Also the new layout style sheet which is called bootstrap.css makes a mess of my chess board.

I stored some games in a database so I also need to port that too. The data model is incomplete for it does not store player data. So maybe it's best to create a new data model and a new database.

I doubt if this is all worthwhile. I remember the transition from asp.net to asp.net mvc was terrible too. And before that there was a Winforms version.

Microsoft is creating new versions all the time and it is difficult to catch up.
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: New project MVC 5 (why ?)

Post by cdani »

I my work we mostly ignore the new versions unless we win something important, like compatibility with a new server version, or anything.
Older versions of Visual Studio are very good also for what we do.

And for Andscacs I had no problem going to 2013 because is plain c++.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: New project MVC 5 (why ?)

Post by Joost Buijs »

Maybe I'm old fashioned but I still use MFC when I need to build a graphical interface, it almost never gives me problems. The only problem I had was when MFC switched to Unicode only, somewhat later Microsoft felt this was a mistake and they released a separate MFC library which is still compatible with char and multi-byte.

I don't like it when my programs depend upon dynamically linked libraries and runtime modules, this gives all kinds of problems with separate versions of the libraries installed (makes me think of Linux), the MFC library can be linked statically, and this is what I always do. Computer memory is so large nowadays that I don't see any advantage in linking on runtime.
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: New project MVC 5 (why ?)

Post by Henk »

With web development it is even more terrible. First they came with SOAP. After that it was web services. But that was not good enough so they invented WCF. But now WCF is also obsolete and it should be web API. So no matter what you build on the web it is old fashioned within two years.

Also security model in MVC 4 is obsolete and replaced with a new one in MVC 5. They want us to keep busy with learning obsolete technology. When they introduce it they say it is fantastic and everybody should use it. And a few years later they make you think you are a fool if you are still using that old stuff.

With languages it is the same: C, C++, C#.

C# language is not that easy as it used to be because of generics, lambda expressions and LINQ build in. With generics it is easy to create complicated nested type definitions.

Also design patterns can make your code difficult to understand. With design patterns you only see interfaces and abstractions and you wonder where you can find the concrete code that is executing here.
Joost Buijs
Posts: 1563
Joined: Thu Jul 16, 2009 10:47 am
Location: Almere, The Netherlands

Re: New project MVC 5 (why ?)

Post by Joost Buijs »

In practice I use a mixture of C and C++, some C++ extensions like templates and user defined operators come in very handy for the things I want to do, but I try to keep away from the STL as far as possible.

The concept of managed code doesn't attract me at all, that is why I never looked at C# with more than one eye.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: New project MVC 5 (why ?)

Post by lucasart »

Henk wrote:I was already using visual studio 2013 express for a while and the conversion from 2012 - 2013 gave no problems. But I was not using all of 4.5 framework. For instance I did not use the latest layout and style sheets. So I created a new project Skipper2. But that gives quite a lot of extra work. For all folders need to be created again and all source files need to be copied to the right directories. Problem was that I did not copy everything for I thought I did not use some source files anymore. Result hundreds of compile errors.

Also the new layout style sheet which is called bootstrap.css makes a mess of my chess board.

I stored some games in a database so I also need to port that too. The data model is incomplete for it does not store player data. So maybe it's best to create a new data model and a new database.

I doubt if this is all worthwhile. I remember the transition from asp.net to asp.net mvc was terrible too. And before that there was a Winforms version.

Microsoft is creating new versions all the time and it is difficult to catch up.
Goes to show these bloated IDEs are not really more user-friendly than a simple command line... bash + gcc + gedit (or vim if you're a real geek) are all you need.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: New project MVC 5 (why ?)

Post by emadsen »

Also the new layout style sheet which is called bootstrap.css makes a mess of my chess board.
Henk, are you writing a GUI?

I agree, the pace of change can be dizzying. A healthy dose of skepticism helps (Do I really need dependency injection containers? Can't I just pass interfaces to class constructors and be done with it?) As well as making a conscientious decision when taking dependencies on frameworks or language features (A queryable object model is great, but LINQ makes it difficult to see the actual SQL query that's executing).

There's so much buzzword BS out there and bloated design, you have to be careful not to believe all the received wisdom. Sometimes a hammer is best- you don't need a damn hammer factory.

Being modern (using all the latest and greatest tech) has its cost. I mean, the whole point of a framework is to leverage code someone else has written. If it eliminates writing a lot of boilerplate plumbing code, is secure, and performs satisfactorily, it's a win. Save the investment (time spent rolling your own) but pay the tax (dependency / tech lock-in, updates).

You're under no obligation to re-code for v2.0 just for the elegance of it. If you get no benefit from 2.0, you're just creating work for yourself.
My C# chess engine: https://www.madchess.net
Henk
Posts: 7216
Joined: Mon May 27, 2013 10:31 am

Re: New project MVC 5 (why ?)

Post by Henk »

Yes a GUI, an engine and a database. Just an ASP.NET MVC exercise. But not much worth if your engine plays below average. And trying to improve the engine takes far most of the time. So I better had started with tic tac toe.

By the way my project is using an ISearchFactory.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: New project MVC 5 (why ?)

Post by kbhearn »

Joost Buijs wrote:Maybe I'm old fashioned but I still use MFC when I need to build a graphical interface, it almost never gives me problems. The only problem I had was when MFC switched to Unicode only, somewhat later Microsoft felt this was a mistake and they released a separate MFC library which is still compatible with char and multi-byte.

I don't like it when my programs depend upon dynamically linked libraries and runtime modules, this gives all kinds of problems with separate versions of the libraries installed (makes me think of Linux), the MFC library can be linked statically, and this is what I always do. Computer memory is so large nowadays that I don't see any advantage in linking on runtime.
The major advantage to runtime linking is that any library bugs that get fixed don't require you to issue a new compile to be fixed in your executable. If it's a common enough library that it's used from a shared location you may well not have to worry about it at all. As an example let's say you were using openssl in a program when the heartbleed bug became public. If you had staticly linked in the openssl library then you have to patch, recompile, and get all your users to update your program. If you were using a shared library then their system security updates would take care of it for you.

There is also of course the advantage in some sorts of low level libraries that the 'many different versions' may take advantage of local hardware differences without you having to explicitly code for them yourself. As long as you're using the libraries in the intended manner (and avoiding extremely new features unless you really need them), the existence of difference versions should not bite you too hard/often.
User avatar
emadsen
Posts: 434
Joined: Thu Apr 26, 2012 1:51 am
Location: Oak Park, IL, USA
Full name: Erik Madsen

Re: New project MVC 5 (why ?)

Post by emadsen »

By the way my project is using an ISearchFactory.
I played around with that, but decided it was not required, not even to implement UCI_LimitStrength. I do not fundamentally change the way MadChess searches positions when limiting strength. I simply remove chess knowledge, limit search speed, and use MultiPV to select a sub-optimal move.

I think it makes sense to implement a search interface if you include radically different search techniques in your engine, such as Alpha Beta and Monte Carlo, selectable by a UCI parameter.
My C# chess engine: https://www.madchess.net