Which language should I use?

2020-02-06 03:07发布

I'm about to produce a prototype for a technology startup that I've just joined, and I'm trying to decide which language to use. It's going to be a simple web tool with a MySQL database in the background and some AI stuff going on in between. I've used Ruby and PHP a reasonable amount in the past, but wonder whether I might be better off going with Python or even Perl. My main programming experience is with C / C++ / Java, but I feel like I want to go for something that will make my life as easy as possible since I'm just developing a prototype.

I guess what I'm looking for is:

  • speed of development
  • existing AI libraries (e.g. SVMs, neural networks, Bayesian classifiers)
  • ease of interacting with a web interface

Anyone have any thoughts on this?

20条回答
男人必须洒脱
2楼-- · 2020-02-06 03:29

Prototype or not, if you are crunching huge amounts of numbers, you may need the speed of a Java or C/C++ at least for the AI parts. I don't really know exactly what you are doing but a lot of AI stuff is computation intensive. You may find Python VS C makes a difference from 10 minutes to almost 2 hours or more (or from a day to a month).

Probably your best bet is a hybrid approach. Java/C++ or something for the AI (I only say Java because it has a ton of libraries, I even have a book on Data Mining which discusses several libraries in Java that are freely available and perform some of the techniques). And Python/Ruby/Perl for everything else (like the web parts).

I am hesitant to recommend PHP because you never know what you may be doing. PHP seems to really shine on the web and for web related things, but once you need non web uses it seems to be more cumbersome than anything (although I have seen references to PHP being used like a Perl/Python/etc. as a normal scripting language by some people).

The choice between Python/Ruby/Perl is almost a matter of taste. Except that Perl has CPAN which is beyond anything Python and Ruby have right now. Since you are in a start up, the wide selection of modules on CPAN that you can just slap together may provide value to you in getting things done sooner. Personally I like Python over Perl (I find Perl's object system to be ugly when building your own objects, and sometimes it takes me a bit to figure out how code I wrote months ago works). But I can't deny the value of CPAN.

So in short, you probably need a performance language for some of the AI stuff and the ease and speed of development of a scripting language for everything else because a start up is all about getting the product done as soon as possible and beating your competitors to market. I would love to recommend Python, but based on what I know about start ups, you need to evaluate CPAN in your decision process. Just being able to slap a bunch of modules together that do what you want quickly can be of huge value in a start up.

I should also add that Perl and Python (I'm not sure about Ruby but I think that to) can call C code rather easily. So you could use C or C++ libraries by creating a set of bindings to the language. You could also try writing the whole thing in Perl/Python/Ruby and if it is too slow rewriting that part in C or C++ and calling it from the scripting language. With the whole start up thing rewriting like this can be very expensive in terms of getting something done. Also since you are most comfortable in C or C++ or Java it may be worth just going there from the start.

查看更多
劳资没心,怎么记你
3楼-- · 2020-02-06 03:29

If you're whipping up a quick and dirty prototype, then it's probably within your interest to stick to something you already know, particularly if the prototype is to show off some other piece of fancy functionality; performance many not be a massive concern here.

查看更多
迷人小祖宗
4楼-- · 2020-02-06 03:32

I agree with the other answers that recommend Java, especially as you may need it's speed in the AI code, and for the libraries etc. that are available.

A combination of Java (servlets) and JSP would probably work nicely.

However, the reason for writing this answer is to most highly recommend:

Go with what you know.

New languages or ones you "sort of" know are great for fun stuff, and even for some development projects and prototyping. But if you need something that will work for you in the long run, use the best language for the task THAT YOU ALREADY KNOW. In this case, I think (from your post) it would be Java.

Also - it's a prototype now, but I can almost guarantee that if it works, it will become the default start of the actual application. I really doubt you will have the luxury of time to rewrite the application from scratch in another language, so again - using what you know now will pay dividends later when they "time crunch" you and you must deliver.

Cheers,

-R

查看更多
仙女界的扛把子
5楼-- · 2020-02-06 03:35

I think Java would make your life easiest.

  • speed of development - you said you're already familiar with it.

  • existing AI libraries - check out JOONE

  • ease of interacting with a web interface - servlets, JSP, too many Web frameworks to list.

Java also integrates easily with MySQL using JDBC.

查看更多
贼婆χ
6楼-- · 2020-02-06 03:36

Lisp has been mentioned, but I think Scheme (in particular plt-scheme) is in some respects as good a choice as Ruby/Python/Perl/PHP. It doesn't have as many good libraries as some of those, which is a minus, but most schemes have excellent ffi (foreign function interface), which makes it trivial to integrate external (C code) libraries. Another strength of scheme is its performance profile; You can often get near C-code type performance on number-crunching stuff.

查看更多
forever°为你锁心
7楼-- · 2020-02-06 03:37

You might want to take a look at GLASS: smalltalk, seaside and a gemstone object database. Better web than ruby, no orm, and the best modeling language.

查看更多
登录 后发表回答