Choosing a Programming Language

For discussing go computing, software announcements, etc.
phrax
Dies with sente
Posts: 92
Joined: Wed Apr 21, 2010 10:24 am
GD Posts: 0
Has thanked: 48 times
Been thanked: 6 times

Re: Choosing a Programming Language

Post by phrax »

The choice is obvious, Go http://golang.org/ :)

If you're primarily focusing on Windows, C# is nice to work with. There is also limited portability using Mono for other platforms. Disclaimer: I have no Mono experience, so I don't know how well this actually works.

It might not be the best choice for this particular project, but I'd be remiss if I didn't at least mention Perl :) It already has decent sgf libraries, and is cross-platform.
User avatar
Harleqin
Lives in sente
Posts: 921
Joined: Sat Mar 06, 2010 10:31 am
Rank: German 2 dan
GD Posts: 0
Has thanked: 401 times
Been thanked: 164 times

Re: Choosing a Programming Language

Post by Harleqin »

I use Common Lisp for almost everything I program. If you want to go that route, which I recommend, you should read "Practical Common Lisp" by Peter Seibel.
A good system naturally covers all corner cases without further effort.
User avatar
daniel_the_smith
Gosei
Posts: 2116
Joined: Wed Apr 21, 2010 8:51 am
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Location: Silicon Valley
Has thanked: 152 times
Been thanked: 330 times
Contact:

Re: Choosing a Programming Language

Post by daniel_the_smith »

I was going to advocate golang as it is easy to learn, compiled and statically typed, however you are on windows and want a gui, the two things golang does not do well yet. Otherwise I would recommend it. (I did my website backend in go, my website does some similar things to what you're talking about.)

I'll +1 python. C++ is great for what it's great for, and an ambitious first project ain't it. (I can say this, I do C++ for my day job.) Don't write something in C++ because you want it to be fast. Premature optimization is the root of all evil. You don't even know what will be slow until you write it, so write it in something easy to begin with. It's much easier to optimize correct code than it is to correct optimized code and all that.
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3374 times

Re: Choosing a Programming Language

Post by Bill Spight »

Forth language perfect, it is. Programmer excellent, I am.

-- Yoda

:)
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
Suji
Lives in gote
Posts: 302
Joined: Wed May 19, 2010 2:25 pm
Rank: DDK
GD Posts: 0
KGS: Sujisan 12 kyu
OGS: Sujisan 13 kyu
Has thanked: 70 times
Been thanked: 8 times

Re: Choosing a Programming Language

Post by Suji »

fwiffo wrote:Python isn't web based in the way that PHP or something is. There are web frameworks for it, of course.
Interesting.
nagano wrote:
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?
I'd be willing to bet it's written in either C or C++.
nagano wrote:
Suji wrote: Nagano: You might want to consider PHP, too.
I want the program to be accessible offline. Is that possible with PHP?
Not stock, no. So PHP might not be the best choice. If at some point you want it to be web-based, PHP is really the way to go (or perl).

I'm personally not acquainted with Python so I can't vouch either for or against it, but from what I've seen it's pretty friendly. I've also had a bad experience with Java, so I'm biased against it. Java would be fine as a first language and it has it's uses. C++ isn't a bad choice either, but make sure that the tutorials you go through are really, really good. Also, whatever language you do it in, stick with code you understand and don't try anything fancy.

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it."
- Brian W. Kernighan
My plan to become an SDK is here.
User avatar
fwiffo
Gosei
Posts: 1435
Joined: Tue Apr 20, 2010 6:22 am
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
Location: California
Has thanked: 49 times
Been thanked: 168 times

Re: Choosing a Programming Language

Post by fwiffo »

I have an anecdote relating to this subject...

At a previous job, I was involved in maintaining a big inventory management, CRM, order processing thing. It was mostly written in PHP with a web interface, with a PostgreSQL back-end, and also interacted with some legacy AS/400 systems. It was pretty terrible, but typical for the kind of code you see in the wild, written by incompetent programmers for an ossified, disorganized company.

There were certain reports generated by the system that would sometimes take hours to complete. Some very clever programmer in the distant past thought to themselves "Ah, well, this is written in PHP, and everyone knows C is much faster, so I'll rewrite this part in C and bolt it on." Sadly it didn't get any faster at all, and we were all left with some really crappy C code to maintain in addition to everything else.

The problem wasn't the choice of language. The problem was that the programmers didn't understand SQL at all, and SQL joins and subqueries specifically, and didn't know how to design a database schema that makes any kind of sense. Instead of using joins, they issued thousands of queries inside nested loops. It was something like:

Code: Select all

query list of customers
for each customer {
    query list of orders
    for each order {
        query list of parts in order
        for each part {
            query part information
            if order was in the last week and customer is a distributor {
                total_distributor_sales += whatever
            }
        }
    }
}
Once we rewrote it to just issue one query with joins, it took like 100ms to run instead of an hour, with 1/5 the number of lines of code.
User avatar
nagano
Lives in gote
Posts: 448
Joined: Wed Apr 28, 2010 6:44 pm
Rank: Tygem 4d
GD Posts: 24
Has thanked: 127 times
Been thanked: 34 times

Re: Choosing a Programming Language

Post by nagano »

Thanks, everyone. Not sure I've made a decision yet, but you've definitely given me some thing to think about.
"Those who calculate greatly will win; those who calculate only a little will lose, but what of those who don't make any calculations at all!? This is why everything must be calculated, in order to foresee victory and defeat."-The Art of War
User avatar
daniel_the_smith
Gosei
Posts: 2116
Joined: Wed Apr 21, 2010 8:51 am
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Location: Silicon Valley
Has thanked: 152 times
Been thanked: 330 times
Contact:

Re: Choosing a Programming Language

Post by daniel_the_smith »

fwiffo wrote:I have an anecdote relating to this subject...
I'm surprised that anyone smart enough to figure out how to connect to a database could do that so incredibly badly... have you posted that to daily wtf?
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com
amnal
Lives in gote
Posts: 589
Joined: Fri Apr 23, 2010 10:42 am
Rank: 2 dan
GD Posts: 0
Been thanked: 114 times

Re: Choosing a Programming Language

Post by amnal »

nagano wrote:Thanks, everyone. Not sure I've made a decision yet, but you've definitely given me some thing to think about.
If you haven't programmed before (which it sounds like you haven't), your time will be better spent downloading a language - any language - and getting going! You simply can't embark properly upon a large project as soon as you set out; even if you manage to focus on it, the early work will almost certainly be terrible and you'll have to rewrite it anyway. The most important thing is to get a general idea of what's going on, then you can choose a language whilst properly understanding why you're making the choice.

FWIW, I recommend getting started with python. If you can't learn how python works and then transfer this knowledge easily to C or whatever, you wouldn't have managed to learn C in the first place anyway.
User avatar
fwiffo
Gosei
Posts: 1435
Joined: Tue Apr 20, 2010 6:22 am
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
Location: California
Has thanked: 49 times
Been thanked: 168 times

Re: Choosing a Programming Language

Post by fwiffo »

daniel_the_smith wrote:I'm surprised that anyone smart enough to figure out how to connect to a database could do that so incredibly badly... have you posted that to daily wtf?
I would submit it to daily WTF if I still had a copy of the code.

The biggest problem is that it was something developed over a period of time, by multiple different people, with limited experience in a place with high turnover. It had all the horrors you'd expect in a system without any kind of version control too. A typical chunk of the directory structure might look something like

Code: Select all

potemplate6.php
potemplate6a.php
potemplate7.php
potemplate8.php
potemplate8-delme.php
potemplate8-new.php
potemplate8-version2.php
potemplate8-version2new.php
potemplate8-version2real.php
potemplate8-version2real-2004-02-01.php
potemplate8-version2real-2004-02-01_SPECIAL.php
potemplate8-version2real-2004-04-09XXBUGGEDXX.php
potemplate8-version2real-2004-04-09XXBUGGEDXX-fixed.php
potemplate8-version2real-2004-04-09XXBUGGEDXX-fixed-dontuse.php
potemplate9.php
potemplate9-2001-11-14.php
Other files in use pointed to different versions and it was all just horrible. Not to mention, copious use of the worst two variable names in the world and similar face-palm moments.
User avatar
daniel_the_smith
Gosei
Posts: 2116
Joined: Wed Apr 21, 2010 8:51 am
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Location: Silicon Valley
Has thanked: 152 times
Been thanked: 330 times
Contact:

Re: Choosing a Programming Language

Post by daniel_the_smith »

Image
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com
User avatar
Harleqin
Lives in sente
Posts: 921
Joined: Sat Mar 06, 2010 10:31 am
Rank: German 2 dan
GD Posts: 0
Has thanked: 401 times
Been thanked: 164 times

Re: Choosing a Programming Language

Post by Harleqin »

Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).
A good system naturally covers all corner cases without further effort.
User avatar
nagano
Lives in gote
Posts: 448
Joined: Wed Apr 28, 2010 6:44 pm
Rank: Tygem 4d
GD Posts: 24
Has thanked: 127 times
Been thanked: 34 times

Re: Choosing a Programming Language

Post by nagano »

Harleqin wrote:
Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).
What is it about Lisp that you like so much?
"Those who calculate greatly will win; those who calculate only a little will lose, but what of those who don't make any calculations at all!? This is why everything must be calculated, in order to foresee victory and defeat."-The Art of War
User avatar
Li Kao
Lives in gote
Posts: 643
Joined: Wed Apr 21, 2010 10:37 am
Rank: KGS 3k
GD Posts: 0
KGS: LiKao / Loki
Location: Munich, Germany
Has thanked: 115 times
Been thanked: 102 times

Re: Choosing a Programming Language

Post by Li Kao »

nagano wrote:
Harleqin wrote:
Suji wrote:If at some point you want it to be web-based, PHP is really the way to go (or Perl).
This seems to be conventional wisdom, but I do not think it is true. Web pages can be generated in any language. For example, I use Common Lisp, Hunchentoot (a webserver in Common Lisp), and CL-WHO (HTML output library).
What is it about Lisp that you like so much?
Lisp is very elegant and has powerful meta-programming features. But I don't think it is the right language for a beginner. I'd start with a more conventional language.
Sanity is for the weak.
Mike Novack
Lives in sente
Posts: 1046
Joined: Mon Aug 09, 2010 9:36 am
GD Posts: 0
Been thanked: 184 times

Re: Choosing a Programming Language

Post by Mike Novack »

Lots of Irritating Silly Parentheses (sorry, that's a LISP joke)
Post Reply