It is currently Thu Apr 25, 2024 5:52 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
Offline
 Post subject: Re: Choosing a Programming Language
Post #21 Posted: Fri Nov 12, 2010 9:41 am 
Dies with sente

Posts: 92
Liked others: 48
Was liked: 6
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #22 Posted: Fri Nov 12, 2010 10:03 am 
Lives in sente
User avatar

Posts: 914
Liked others: 391
Was liked: 162
Rank: German 2 dan
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #23 Posted: Fri Nov 12, 2010 10:36 am 
Gosei
User avatar

Posts: 2116
Location: Silicon Valley
Liked others: 152
Was liked: 330
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: 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

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #24 Posted: Fri Nov 12, 2010 12:07 pm 
Honinbo

Posts: 10905
Liked others: 3651
Was liked: 3374
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.


This post by Bill Spight was liked by: Tryphon
Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #25 Posted: Fri Nov 12, 2010 12:08 pm 
Lives in gote

Posts: 302
Liked others: 70
Was liked: 8
Rank: DDK
KGS: Sujisan 12 kyu
OGS: Sujisan 13 kyu
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #26 Posted: Fri Nov 12, 2010 12:16 pm 
Gosei
User avatar

Posts: 1435
Location: California
Liked others: 53
Was liked: 171
Rank: Out of practice
GD Posts: 1104
KGS: 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:
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.

_________________
KGS 4 kyu - Game Archive - Keyboard Otaku

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #27 Posted: Fri Nov 12, 2010 1:08 pm 
Lives in gote
User avatar

Posts: 448
Liked others: 127
Was liked: 34
Rank: Tygem 4d
GD Posts: 24
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

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #28 Posted: Fri Nov 12, 2010 1:12 pm 
Gosei
User avatar

Posts: 2116
Location: Silicon Valley
Liked others: 152
Was liked: 330
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: 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

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #29 Posted: Fri Nov 12, 2010 1:13 pm 
Lives in gote

Posts: 589
Liked others: 0
Was liked: 114
Rank: 2 dan
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #30 Posted: Fri Nov 12, 2010 1:27 pm 
Gosei
User avatar

Posts: 1435
Location: California
Liked others: 53
Was liked: 171
Rank: Out of practice
GD Posts: 1104
KGS: 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:
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.

_________________
KGS 4 kyu - Game Archive - Keyboard Otaku

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #31 Posted: Fri Nov 12, 2010 1:36 pm 
Gosei
User avatar

Posts: 2116
Location: Silicon Valley
Liked others: 152
Was liked: 330
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Image

_________________
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com


This post by daniel_the_smith was liked by: Bill Spight
Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #32 Posted: Sat Nov 13, 2010 1:30 am 
Lives in sente
User avatar

Posts: 914
Liked others: 391
Was liked: 162
Rank: German 2 dan
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #33 Posted: Sat Nov 13, 2010 10:55 am 
Lives in gote
User avatar

Posts: 448
Liked others: 127
Was liked: 34
Rank: Tygem 4d
GD Posts: 24
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

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #34 Posted: Sat Nov 13, 2010 11:41 am 
Lives in gote
User avatar

Posts: 643
Location: Munich, Germany
Liked others: 115
Was liked: 102
Rank: KGS 3k
KGS: LiKao / Loki
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.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #35 Posted: Sat Nov 13, 2010 11:52 am 
Lives in sente

Posts: 1037
Liked others: 0
Was liked: 180
Lots of [b]Irritating Silly Parentheses (sorry, that's a LISP joke)

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #36 Posted: Sat Nov 13, 2010 2:26 pm 
Lives in gote

Posts: 302
Liked others: 70
Was liked: 8
Rank: DDK
KGS: Sujisan 12 kyu
OGS: Sujisan 13 kyu
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).


You can use any language for anything, sure. However, certain languages make certain things easier. I'm not saying Lisp is bad, but PHP or Perl makes interfacing with databases easy. I'm also not going to write a web page in C++ even though it can be done. For me, that's like putting a square peg in a round hole. I'd rather use HTML and PHP (or Perl) for web pages because I like to make things easy.

For you, programming in Lisp might be the easiest thing, or you feel really comfortable with Lisp. This is good, as I think programmers need a language they feel comfortable in. I also feel that programmers need to have a basic understanding of all major languages and know the advantages and disadvantages of each, so that, if needed, can program an application in the "correct" language. Example: an Android application in Java.

Granted, if you're programming for fun, the whole scenario changes and you can program in just about anything that you want. :D

There's my 2 cents worth.

_________________
My plan to become an SDK is here.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #37 Posted: Sat Nov 13, 2010 3:27 pm 
Gosei
User avatar

Posts: 1744
Liked others: 702
Was liked: 288
KGS: greendemon
Tygem: greendemon
DGS: smaragdaemon
OGS: emeraldemon
If you like Lisp, try haskell!

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #38 Posted: Sat Nov 13, 2010 3:36 pm 
Gosei
User avatar

Posts: 1435
Location: California
Liked others: 53
Was liked: 171
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
To be honest, the only good side of PHP, IMHO, is the relatively low barrier to entry. It's really easy to get set up with PHP on a web server and get your hello world going. Other languages generally require more work to get going in a web environment. But once you start getting to a program of a significant size, the sort-comings of the language go from annoying to crippling.

So I would say, that PHP is the way to go if you want to develop some simple web app, and get it up and running quickly. Choose anything else for more serious application development.

I acknowledge that there are some complex web apps written in PHP, Wordpress, PHPbb, etc. but if you've ever developed in them (e.g. writing a plugin), you probably have noticed the weirdness that results as a project grows bigger and exposes PHP's warts.

_________________
KGS 4 kyu - Game Archive - Keyboard Otaku

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #39 Posted: Sat Nov 13, 2010 5:53 pm 
Lives in sente
User avatar

Posts: 914
Liked others: 391
Was liked: 162
Rank: German 2 dan
Quote:
I also feel that programmers need to have a basic understanding of all major languages and know the advantages and disadvantages of each, so that, if needed, can program an application in the "correct" language.


Really? Then why do you not know Lisp? :geek:

What I really wanted to say, though, is that the statement "for web development, Perl or PHP are the way to go" is not true. It is better to say "for web development, you need a web server library (or a way to run on/behind something like Apache), HTML generation, and often database interfacing. Choose a language where libraries for that exist."

_________________
A good system naturally covers all corner cases without further effort.

Top
 Profile  
 
Offline
 Post subject: Re: Choosing a Programming Language
Post #40 Posted: Sun Nov 14, 2010 6:10 am 
Lives in sente

Posts: 1037
Liked others: 0
Was liked: 180
Just my two cents --- if you want to learn programming the particular language used isn't important. But what is important is having a learning text that takes the "elementary data structures and their algorithms" approach.

The whole point of a language like C++ is that it provides the basic data structures and their operations built in. No need to roll your own but that isn't what you really need to learn. The real difficulty is at the higher level of program design, recognizing immediately at the start (for example) "the natural solution to this problem I am supposed to solve is two lists and a queue". By comparison having to once roll your own data definition for a list, a queue, and the function definitions of the operations valid on them is simple (once written, you have them somewhere in a library). The origignal C text had you do as exercises your own definitions of all the functions that came in the built in library. Similarly, were I writing a text for C++ might have as exercises "do your own version of one of the built in objects" --- for the simple reason that someday you will need something neither built in nor easily/efficintly buildable from what is.

In the shop where I spent my working days >95% of the programmers did not know the "elementary data structures" and the result was abominable code. The trick is to first design the solution to the problem in abstract terms and only then worry about implementation/coding.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group