Free Go/ Discussion

Sub-page of FreeGo

Brent: .NET? I guess I am out of luck since my computer does not harbor any Micro$oft products. (I run Debian GNU/Linux.) Aren't there some sort of cross-platform libraries you could use instead? (Knowing full well that I will probably not convince you to change platforms at this point, but I just thought I would register my disappointment that I will not be able to run your cool program...)

Niklas: There are several open source implementations of the .NET standard. Maybe .GNU, Portable .NET or Mono can help you?

Bildstein: Duly noted. You're right that I won't change platform now, but I'll tell you what - when I finish version 0.2, I'll polish the code a little and then release it. Perhaps someone else will be generous enough to port it.

Bisqwit: The source file, FreeGo.zip, seems to be broken. I downloaded it with wget (the server says content-type is application/zip, size 134489 bytes), but when I try to decompress or test it (with InfoZIP UnZip 5.50), it complains of CRC errors, and hints that the file might have been broken in an ASCII FTP transfer.

Bildstein: Probably my fault. I'm using Windows XP command line FTP to transfer files, and it seems to default to ASCII mode. I've uploaded it again, and tested downloading and opening it. Thanks for taking an interest, by the way. I appreciate it.

Bisqwit: I'm not a Windows user and I don't have a C# compiler installed, but I looked at the source code because I was interested to read it.
Excluding the menuitem/dialog related code, it looks quite nice and readable. However, I'm not sure why your Stone class does distance checks as if they were square objects, whereas the game functions use Sqrt...

Darrell: Since there seems to be more people here interested in giving political rants than in helping you, I thought I would take a look at the code. You seem to have a good grasp of C#, though you don't use much more than ArrayList from the .Net framework. In the commercial world, no one thinks "C# vs Java", it is ".Net or J2EE" and the language is just a tool to exploit the framework. Other observations:

  • You don't have any properties. You use public members, GetXX methods, and even implicit operators that return data, but no properties. Try to use properties instead of all of these.
  • Don't use implicit operators. C# is an explicit language.
  • Maybe you were just practicing with delegates, but the BestPositionFunction stuff is usually done with a Strategy design pattern.
  • (ret.GetType() == typeof(Stone)) is better expressed (ret is Stone)

Bildstein: Thanks for having a look at my code. I really appreciate it.

Issue 1: Point taken.

Issue 2: Can you give an example? What's an implicit operator?

Issue 3: What's a "Strategy" design pattern? (Or where can I find out about it for myself?)

Issue 4: I'd have to double check the code to be sure for every instance, but the difference between (ret.GetType() == typeof(Stone)) and (ret is Stone) is that the latter returns true for every subclass of Stone. I think this was what I was trying to achieve. Of course, the fact that this wasn't obvious means that I haven't commented the code well enough ;)

Darrell: Issue 2, from FreeGoGame.cs:

public static implicit operator long(Ordinate o)
{
  return o.Value;
}

Bildstein: I see. I guess this is the C++ programmer coming out in me. Hmm. I wonder why I even bothered with an Ordinate class. Oh yeah, so it could be null. There's got to be a better way to do this than how I'm doing it. Unfortunately I don't have time at the moment to delve back into the code. When I do have time, though, I'll make sure to come back to these issues.

Issue 3, Design Patterns are to object-oriented programming what joseki is to Go - how the experts handle a situation. A Google search on "Strategy Design Pattern" yields lots of results (though I don't know how many are helpful). There are several design patterns books as well. Basically in Strategy, the different algorithms are implemented as method overloads in subclasses. You pick an algorithm by picking a subclass. I'm not saying your way doesn't work - just that the experts do it differently.

Bildstein: Yeah, I know what design patterns are, but I've never consciously used one (although in practice I'm sure I have plenty of times). I did actually do a Google search as you suggested (but I figured I'd leave my post here anyway because I was interested in what you had to say), and the impression that I got was that the Strategy design pattern was about representing a particular solution to a problem (i.e. a strategy for solving the problem) as an object, and perhaps classes of solutions as classes (I'm not entirely sure). It seems like a good idea. Perhaps I should read a book about design patterns.

Issue 4, Hmm, if you purposefully want the master class to be treated differently than the subclass, I would say that you are negating one of the benefits of subclasses (and making your code harder to read). Perhaps you are better off making them separate classes that implement a common interface? Or making the master class virtual and have only subclasses?

Bildstein: It warrents attention, for sure. It's very inelegant. Again, when I get time, I'll look for a more OO way of doing it. In truth, I can't even remember the details of why I did it or where it was in the code.

It is very impressive that you are so open to review/criticism - maybe a habit learned from Go? I should add this to Sebastian/All I need to know I learned from Go.

Bildstein: Thanks ;) But I think it's almost impossible to distinguish between things that you learned from Go and things that you already knew, that gave you a predisposition towards learning Go. On this issue, I would say that there probably is a connection, but I have no idea which came first. My first thought, for what it's worth, was that it's only in the past two months that I've had stronger players around who could teach me anything. Before that, I was living in Tasmania, where the only people I played Go with were nameless, faceless people who didn't speak English, on IGS (and a few who did speak English on Dragon, most notably Mmlvx).

Discussion

Make suggestions! I'm doing it in a way that I think is reasonable, but if you have any ideas for improvements, I'd love to hear. Just make sure your ideas aren't already scheduled for inclusion in future versions.

Also, now that I'm releasing the source code, I'd live to hear what people think of my (GUI and/or OO) design and coding. Yes, that's right, I'm asking for criticism ;) I'd espescially like to hear from any C# programmers out there, who could tell me how I'm not taking full advantage of what C# has to offer (be that in terms of language constructs or the object model), because this is my first C# project.

Peterius: I apologize for this comment, but I simply must say it. This sounds like an interesting idea but I will not use a program that is based on .NET or C#. They are Microsoft attempts to monopolize and control an entire programming language and they should not EVER be used. They should be strongly boycotted by every free programmer out there. If this is rewritten in C++ or C like it should have been in the first place, then I would consider looking at it. I mean no offense to say this but using .NET and C# hurts all programmers, everywhere, and hurts computer science in general. I'm sure you didn't know so its forgiveable. ;-)

Bildstein: I understand your argument and your stance on .NET/C#. It is a position that I have seen a few times, but I do not agree. I can't see how Microsoft can monopolise and control C#. As I understand it, and correct me if I am wrong, Microsoft has made the details of .NET and C# freely available, and they are allowing other people to create their own compilers and run-time environments that are compatible with Microsoft's own.

(Funny, I never thought I'd see the day when I would be defending Microsoft.)

Even if you are right, and .NET/C# is an attempt by Microsoft to monopolise the industry, it will not stop me from using it. I am a professional software developer, and skills in C# and .NET are valuable to me, so I will continue to hone these skill by developing in and for .NET.

But I do respect your opinion, and your passion, and I'm interested to hear what else you have to say about the issue. When this discussion gets older or bigger or concluded, we can move it to /Discussion.

And of course, thanks for your interest :)

Peterius: I suppose I'm a bit of an anti Microsoft zealot in my defense of my distrust of C#, nevertheless:

  • First, I do know that Microsoft has forced C# on a couple colleges by giving them computer grants only if they use C#. Due to Microsoft's size and aggressive business policies, its impossible to really see if C# will stand on its own. There is a sudden preponderance of C# books in any large bookstore, almost equaling that of the other standard languages. One has to wonder why this happened so fast. But these could be considered minor complaints.
  • Two, as far as I know, C# is, at most, ever so slightly better than java and ever so slightly easier to use than C++. However, due to Microsoft's influence, it forces software developers to change languages for no good reason. This is a waste when someone may have been quite good with another, standard language. The world doesn't need more buggy, exploit ridden software. We were doing quite well at ironing out issues in the compilers and idiosyncracies of languages like java. C++ is a more extensive language and Java has more real world experience and support out there. And for most things, we should be using C anyway. Object orientation takes one away from the machine even if computers are now fast enough to overwhelm that. Computers are not object oriented, they are imperitive, so we should, when it makes sense, write that way.
  • Three, it seems to me that programming languages should be created by intelligent groups of people and by universities. For a company to make up their own language, nearly identical to two existing languages, a language that really serves no purpose whatsoever except to increase Microsoft's influence... that's pretty shady. And even if Microsoft allows "compatible" compilers, (They couldn't not if the language is public) you can bet that there are some strange copyrights on the language.
  • Four, everything Microsoft has ever made has been uniformly garbage. From buggy Mac OS X word software that has no backward compatibility whatsoever, to XP that sometimes has trouble probing even slightly atypical PCI setups to the years and years and billions of dollars spent dealing with issues created by the mediocrity of Windows. Over the years Microsoft has exploited users and developers by forcing people to use their poorly written software. They clearly cut corners everywhere and can get away with it due to their software monopoly. Have you ever looked through the assembly for something compiled with a Microsoft compiler like visual studio? Its total crap. Someone should do a comparison of runtime speed of Codewarrior or some other third party compiler and a Microsoft compiler with a sizeable program.

I'll admit, I'm choosing my points as I go along. I haven't argued something like this in a long time and its not going very well. ;-) But my basic feeling here is that C# serves no purpose except Microsoft's. Its not for the public good, we have plenty of similar languages that are well known, well liked, and well used. If one has to add one more silly syntactical feature to already overloaded languages, then academia should do a new standard like C99 for C, except for C++ or java. Why learn a language forcibly distributed by the worst, most ruthless software company in the world when there are a bunch of other languages in public use that are probably better in at least some ways, maybe all?

axd: I absolutely, wholeheartedly, unconditionally agree with this. Similar to what happened with javascript (and Java, by the way) Introducing C# is yet another attempt of purely commercial nature to control the market, and shove C++ aside. Microsoft Office is not bad, but I have the impression that their OSes are increasingly no more than libraries to support their software, rather than provide robust and independent platforms to run a computer. Microsoft is part of the C++ committee, so why would they put effort in a new language? Better is to contribute in making the language more stable, and concentrate on producing decent products. I think efforts should be made to avoid C# in a non-commercial environment; in the commercial one, C# is already invading and I think it is too late to revert this. Because if a dependency arises on C#, there is no guarantee that in the future this will not break code, for example. In C++, this has always been one big issue, but I never belive Microsoft can guarantee that: as long as revenue does not go down, they will do whatever they like with their language.

Bildstein: Well, thanks for your opinions, both of you. I guess if I'd have known there was so much anti-C# sentiment out there, I may have made the effort to develop my project in Java instead of C#. Let it be known that, although I disagree with you on some points, you do raise valid issues and I do respect your point of view.

Tas: The program won't work on my computer, it says "a nescecary file: mscorree.dll was not found".

Tas: arh, forgot to download the microsoft-crap, works now, no problem.

Tas: I've tested it a little. Too cool! Can't wait to try and play against an oponent. Its a bit slow, and there's plenty of helping functions that should be made, to help place the stones in the best way. But it is great already.Can you think of a way to make scoring continous to? So that the area of teritory counts direcly. The problem would be that walls surounding territory would have to be solidly connected, and that wouldn't always be possible to do. Maybe lines between centers of stones closer than sqr(2) times the radius (stones that cannot be cut) should sepperate territory to?

cipnrkorvo?: I tried the game and it's really a great application, based on a great idea! I'll speak about it at my university go club, see what they think about it. I hope it will catch on, and maybe someday be considered a good way for go players to practice differently, thinking out of the box. here are a few simple esthetic suggestions for the program:

1) the "auras" around the stones should be simple circles (one thin line). it would be less invading

2) the background should be a wood-like color, instead of green

3) if you could choose the diameter of the pieces, it would be like being able to choose the board size (13*13,19*19...). either it could be a number you enter, or simply the choice between "small, medium, big"

4) I agree with Tas, if you managed to implement continuous territory recognition, it would give an idea as to how big your territory is, AND it could actually show you by making your territory a certain color. the territory would look like the shape of a country, instead of having a little green line in the middle.

5) more than 2 players could work, in the same way it works in normal go. that could be an extra freedom FreeGo could offer.

Anyway, keep it up! This is a great contribution to the go community!


Free Go/ Discussion last edited by OscarBear on May 20, 2016 - 10:33
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
RecentChanges
StartingPoints
About
RandomPage
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Goproblems.com
Login / Prefs
Tools
Sensei's Library