Life In 19x19
http://www.lifein19x19.com/

Choosing a Programming Language
http://www.lifein19x19.com/viewtopic.php?f=18&t=2345
Page 1 of 5

Author:  nagano [ Thu Nov 11, 2010 4:34 pm ]
Post subject:  Choosing a Programming Language

I have a mind to try and create a go database program, something similar to Mastergo or Moyogo, but better. I don't have any real experience with programming yet, but based on what I've read C++ sounds like the best choice for this type of program. I'd be curious about your opinions about this. And yes, I know I'm insane to be so ambitious. :)

Author:  wms [ Thu Nov 11, 2010 5:03 pm ]
Post subject:  Re: Choosing a Programming Language

Ummmm...you know the dangers of asking the internet about the best programming language, don't you? It could get very hot in here very soon...

Author:  nagano [ Thu Nov 11, 2010 5:59 pm ]
Post subject:  Re: Choosing a Programming Language

Yes, but I'm not asking for the "best" language... I guess what I'm looking for is a language that would be simple enough to code but also be faster than something like Java and versatile enough to deal with databases and server connections well.

Author:  imabuddha [ Thu Nov 11, 2010 6:45 pm ]
Post subject:  Re: Choosing a Programming Language

C++ is not a simple language.

Author:  schilds [ Thu Nov 11, 2010 6:48 pm ]
Post subject:  Re: Choosing a Programming Language

What platform are you targeting? I assume it'll have a GUI?

The latter 2 issues you listed (databases, networking) will have similar library support whichever language you choose as long as it's reasonably mainstream. I think platform and tools/libraries are the first things you need to consider.

Author:  fwiffo [ Thu Nov 11, 2010 6:52 pm ]
Post subject:  Re: Choosing a Programming Language

Since you don't have much programming experience, I suggest Python. It's a very good learning language, and fun to work with.

C++ has its place, but it is much more difficult.

Author:  Suji [ Thu Nov 11, 2010 8:10 pm ]
Post subject:  Re: Choosing a Programming Language

imabuddha wrote:
C++ is not a simple language.


No, it isn't. However, there is a learning curve to every programming language.

fwiffo wrote:
Since you don't have much programming experience, I suggest Python. It's a very good learning language, and fun to work with.

C++ has its place, but it is much more difficult.


Just a random question, isn't python web-based?

Nagano: You might want to consider PHP, too.

Author:  fwiffo [ Thu Nov 11, 2010 9:20 pm ]
Post subject:  Re: Choosing a Programming Language

Python isn't web based in the way that PHP or something is. There are web frameworks for it, of course.

Author:  nagano [ Thu Nov 11, 2010 10:12 pm ]
Post subject:  Re: Choosing a Programming Language

schilds wrote:
What platform are you targeting? I assume it'll have a GUI?

The latter 2 issues you listed (databases, networking) will have similar library support whichever language you choose as long as it's reasonably mainstream. I think platform and tools/libraries are the first things you need to consider.

I am mostly focused on windows, though I would like it to have as wide a compatibility as possible. Of course it will have a GUI! :shock: I'm aware that most languages can support those features, but I read that languages such as Java or Python are slower than C++ and not necessarily as good with data intensive applications. I don't know if its just because many of those applications haven't been coded well, but I've noticed Java applications tend to run slower than most other programs on my computer. I'm talking about very large databases here, think Chessbase (>1 million games). As for the libraries, I don't know enough about the differences to really say. I guess that's one of the areas I could use some help. Question: what was Chessbase written in?
Suji wrote:
Nagano: You might want to consider PHP, too.

I want the program to be accessible offline. Is that possible with PHP?

Author:  usagi [ Thu Nov 11, 2010 10:36 pm ]
Post subject:  Re: Choosing a Programming Language

fwiffo wrote:
Since you don't have much programming experience, I suggest Python. It's a very good learning language, and fun to work with.

C++ has its place, but it is much more difficult.


Nods to python. Personally I used to be a big C++ programmer but the syntax became laborous. It always ended up feeling more like C.

Nowadays I stick to Java for one reason only; it's the only language that lets me code a mind map (I prefer idea based, top down design).

I think the choice of language should come mainly based on how you are thinking of writing your program. If it's a giant project and you hope to actually finish it, and you're not an extremely experienced programmer, I could only recommend a strongly typed object oriented language. Possibly completely object oriented. I'm trying to stop myself from saying ruby. Maybe Java.

FWIW I never did ever finish anything I ever wrote in C or C++. But I finished everything I tried writing in Java....

Author:  schilds [ Thu Nov 11, 2010 10:42 pm ]
Post subject:  Re: Choosing a Programming Language

php would normally imply some kind of web application served through a browser (php on the server end).

With regards to speed, you're somewhat correct, but it's more a question of what sort of processing you're doing and how much of it. If you're trawling through a million games, disk i/o might end up being the bottleneck, rather than calculations, in which case you could pick a language based on comfort (or whatever).

Do you know what sort of number crunching is involved? Might something like R (http://www.r-project.org/) provide appropriate libraries?

Author:  emeraldemon [ Thu Nov 11, 2010 10:55 pm ]
Post subject:  Re: Choosing a Programming Language

fwiffo wrote:
Since you don't have much programming experience, I suggest Python. It's a very good learning language, and fun to work with.

C++ has its place, but it is much more difficult.



Quote For Truth. I program regularly in C++ and python (and some other things) but if you don't know any programming language, I'd say learn python first. Second choice would probably be Java. Yes, python is slower than good C++. But if you actually get the whole thing working and it's just too slow, you can use a python/c api to speed up the critical sections. I doubt that will be your main problem, though.

That said, whatever language you choose, good luck! The best way to learn programming is to have a project you're interested in.

Author:  Li Kao [ Fri Nov 12, 2010 3:05 am ]
Post subject:  Re: Choosing a Programming Language

C++ is a quite complex language and has many pitfalls. I'd rather avoid it as a beginner.

I'd use either C# or Java for this project. Java is currently better supported on platforms other than windows and has more libraries in certain areas, and C# is the more powerful language. In particular C# supports custom value types and Linq.

The performance of programs written in either language isn't too bad compared to C++ (they are statically typed and thus easy to compile to efficient code), but they usually use quite a bit more RAM than a comparable C++ program. But that's more relevant if you write a background program running all the time, which isn't the case for you.

You could use a dynamically typed language such as python. They typically create slower programs since it's hard to optimize dynamically typed code. They miss the safety net of static typing, i.e. many errors are only noticed at runtime and not at compiletime which is the reason I personally don't like them much. On the plus side they are more flexible and code written in them is usually a bit shorter.

Performance is C++ > C#/Java > Python&co

Personally I'd recommend C# since you are working on windows and it's powerful and a good compromise between performance and ease of use. With Visual Studio Express you also get a good IDE for free. (If you decide to use Java you probably want to use Eclipse which is free too). It is possible to use C# programs on Linux with the Mono runtime.

And use version control even if you are the only developer. I currently use Git with the SmartGIT GUI and prefer it over Subversion since it's less intrusive and doesn't litter .svn directories everywhere.

Author:  tj86430 [ Fri Nov 12, 2010 3:14 am ]
Post subject:  Re: Choosing a Programming Language

If you are developing only for yourself, then it's fine to develop to the platform you are using (although you might kick yourself if you decide to switch later). If you are targeting a wider audience, I see no reason to limit the usage to one platform. Choose an universally available platform (I'd go with Java).

As many have pointed out, C++ is not easy. You may be able to write the program in about the same time, but as you are not an experienced programmer, you will spend at least one order of magnitude more time on debugging and hunting down all those weird errors caused by incorrect pointer arithmetic etc.

e: WRT Java IDEs NetBeans is a good, also free, alternative to Eclipse (and you can use the same IDE for JavaFX, Ruby, PHP, Groovy and C/C++ as well)

Author:  Gilles [ Fri Nov 12, 2010 3:25 am ]
Post subject:  Re: Choosing a Programming Language

nagano wrote:
I have a mind to try and create a go database program... I don't have any real experience with programming yet...
You will end with a huge amount of experience.
nagano wrote:
something similar to Mastergo or Moyogo
You forget kombilo (python) and libkombilo (c++). Both are open source.

By the way, Moyogo, as Drago, is written in Delphi.

Author:  averell [ Fri Nov 12, 2010 4:14 am ]
Post subject:  Re: Choosing a Programming Language

I don't know what your main goal is, but if this is mainly to broaden horizons and further your education you should consider functional languages as well, like haskell or something like scheme. If you stick with programming you will never regret learning one of these.

Also, the project does indeed seem quite ambitious, maybe if you start with only an SGF parser you will be busy for a few weeks, and decide to switch languages based on your experience then :)

If you only want something to put into your CV, Java is still your best bet. Same goes if portability is an issue. The performance will not be an relevant with normal sized databases (<100k), or at least not due to language limitations.

Then again i mainly use C++ and it does have it's advantages, and for a go playing engine it would be my first choice.

If you do think you can stick with such a large project, i cannot recommend any scripting language such as Python, Ruby or Perl. These are the modern day Visual Basic in my opinion, good for small scale stuff and quick hacks, easy to learn and more lenient with some bad practices but unsuitable for any large application.

Author:  Mike Novack [ Fri Nov 12, 2010 6:51 am ]
Post subject:  Re: Choosing a Programming Language

I agree that learning programming "functional" rather than "procedural" not necesarily a bad idea (the "functional" programmers usually know that they can prove equivalent but the "procedural" programmers usually haven't clue about the "functional" alternative)

But I disagree that this is necessarily a matter of choice of language. You can treat C as a functional language even though 99% of C programmers/programs use it procedurally. After I retired and began doing things like learning C and on a list where a language argument broke out I got challenged to rewrite one of my learning exercises as a pure function. Wasn't that hard. BTW -- you can ignore my use of C instead of C++. Just means I'm one of the old hands who would be writing the object defintions for a project. So I'd normally "roll my own". Hey, in the original C book the exercises were constructing your own definitions for the functions that came built in (the "standard library").

Programming languages is not the place to start. You need to learn how to design programs (algorithms or functions) irrespective of in what language they will be implemented. It's normal to learn this in the context of a particular language but that's only because you need some way to try out what you are learning. If at the end you only can conceive of doing it in that language (too concrete) then you haven't learned programming.

Don't try to run before you can walk. You will need to start out with simple problems.

Author:  flOvermind [ Fri Nov 12, 2010 7:45 am ]
Post subject:  Re: Choosing a Programming Language

nagano wrote:
... but also be faster than something like Java ...


Java is faster. Seriously. If you want faster than Java, C/C++ is pretty much your only option, but only if you know how to exploit the performance advantages of C++. If not, Java is faster.

Author:  rubin427 [ Fri Nov 12, 2010 8:02 am ]
Post subject:  Re: Choosing a Programming Language

fwiffo wrote:
Since you don't have much programming experience, I suggest Python. It's a very good learning language, and fun to work with.

C++ has its place, but it is much more difficult.


I agree with fwiffo.

Even though I am typically a C++ zealot.

People get down on python because interpreted languages are "slow". I once wrote a serious project in python for work. The philosophy was we would rapid prototype in python, and when we finally hit the performance wall, we would re-implement key algorithms in c++ for speed. guess what? We never had performance issues. the final product shipped 100% python code.

Even though at the start of the project I was an experienced C++ programmer, but a first day beginner to python. I know for a fact that the total time to learn python AND complete the project was faster than if the team had done the project in C++ from the start.

Author:  fwiffo [ Fri Nov 12, 2010 9:19 am ]
Post subject:  Re: Choosing a Programming Language

Quote:
People get down on python because interpreted languages are "slow". I once wrote a serious project in python for work. The philosophy was we would rapid prototype in python, and when we finally hit the performance wall, we would re-implement key algorithms in c++ for speed. guess what? We never had performance issues. the final product shipped 100% python code.

^^^ This

95% of the time if your project is running too slow it has nothing to do with your choice of programming language. It could be IO bound. It could be a badly designed algorithm. It could be computationally intractable. Premature optimization is usually a bad idea (you should get it working correctly, then optimize), and preemptive optimization through choice of language is particularly bad.

@nagano: Given that you don't have much programming or CS background, this might be a pretty ambitious project for a first programming project. Searching a database of go games efficiently is something I would describe as a Hard Problem. You might want to choose something simpler for a first project.

Page 1 of 5 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/