Jump to content
Chinese-Forums
  • Sign Up

Do you know any programming languages?


wibr

Do you know any programming language?  

28 members have voted

  1. 1. In which programming language could you write a useful program?

    • Python
    • C/C++
    • Java
    • Javascript
      0
    • Objective-C
    • PHP
      0
    • Perl
    • Ruby
    • C#
    • Other programming language
    • None, I focus on learning Chinese instead ;-)


Recommended Posts

Hey guys,

 

I have the feeling that there are quite many people here who know how to program, so this is an attempt to gather some hard data :-).

With useful I mean something like counting the number of different characters in a Chinese text or create some flashcards from a csv file. If you know more than one programming language you can just choose the one you know best.

 

Thanks!

Link to comment
Share on other sites

"counting the number of different characters in a Chinese text"  isn't this something that can be done by the Chinese Text Analyser?

 

This is the topic here: http://www.chinese-forums.com/index.php?/topic/44383-introducing-chinese-text-analyser/

 

I am so old school when it comes to programming I have had to choose other because my programing was done late 70's through the 80's. I did mine on zx81's, Acorn Atom, Atari 800, Commodore 64, but I have not kept up with new stuff. Closest I get to programming these days is using Macro media to build websites and a few macros in Excel.

 

I would have also like to have chosen focusing on Chinese and life :)

Link to comment
Share on other sites

Well, Chinese Text Analyser is done completely in C++, so I guess that's my category.  Like lechuan, I would also qualify for several of the languages there.

 

Note, I would have had C and C++ as different categories.  They really are quite different languages.

Link to comment
Share on other sites

I have created various tools for myself. However, I also like to "focus on Chinese learning instead". When I have an idea for a tool I have to consider whether it would be something I would really use. If I wouldn't really use it it would be a waste of time to write it. If it is a worthwhile idea, I try to simply the concept as far as possible and try to come up with the simplest implementation.

 

Recently I have written a program for counting word in a text file. I just have a word list and count the occurrences of each word. This isn't the most accurate way of doing it, as Chinese doesn't have spaces so you can't tell where the word boundaries are (so 我喜欢新西兰花 can be either "I like New Zealand flowers" or "I like fresh broccoli"). But it works well enough for me.

 

As far as possible it is best to leverage existing tools, like Pleco or Google Translate. I have one program which takes all the lines out of a text file that contains words in the list that I want to pre-learn, and puts them in a Pleco user dictionary. That way, when I review the words I have lots of example sentences to look at when I review the flashcards.

 

Another tool I have created takes the original text and an English translation and creates a interlinear text (assuming that the Chinese and English were divided up into paragraphs in the same way). Then I use Google translate to generate the English text. Google translate's translation is not 100% reliable but can often be useful for recognizing fixed expressions which aren't in Pleco (for example 整体解决=overall solution). 

Link to comment
Share on other sites

@lechuan I know and that's exactly why I disabled the option ;-) I wanted the sum to be the total number of programmers...like I said, just choose the language you know best. Since I set the bar for "useful" quite low, I guess anyone proficient in one language could write a program in one of the others quite easily...

 

@imron true, C/C++ is just what you see quite commonly, doesn't make much difference for the vote I guess

Link to comment
Share on other sites

I entered C# as it's what I use if giving a choice.  

 

However I know many programming languages, and have been part of teams designing and implementing new ones as well.  

 

I've written significant programs in C#, C, C++, Perl, Haskell, PHP, Prolog, Mercury, BASIC and have modified programs in Javascript, Java, Visual Basic, plus dabbled in assembler.   After a while it's not the language that is the issue (a weekend to learn), it's the libraries (a lifetime to master).

 

Unfortunately in the last 5-6 years hardly had a chance to write code, but I can perform wonders with Excel.

Link to comment
Share on other sites

@imron, come on they both start with a C.  :P  Also Java and Javascript totally the same thing. :roll:

 

I've gravitated more towards Java lately just because the projects I'm interested in benefit more from the cross platform aspect than I'm losing in terms of the greatly reduced options for optimization.

Link to comment
Share on other sites

@imron, come on they both start with a C

So does C# but that got a separate item :P

 

(p.s. yes I do realise you weren't being serious)

 

 

 

I'm interested in benefit more from the cross platform aspect

The thing that bugs me about Java (and note, this is from an end-user perspective, but as a developer it's important to consider the end-user experience) is not so much the reduced performance, but rather the dependency on a huge runtime. If you don't have a version of the JRE compatible with the program you want to run then you're stuck with another however many MB download before you can use it - sucks even more if you have other programs that rely on different versions of the JRE.

 

C# suffers from a similar problem.  I remember downloading a program not to long ago thinking 10MB, that's not too bad I'll check it out.  Only to then run the installer and find it had a dependency on a different version of the .NET runtime which then required another large download before running.

 

It's a really poor user experience, hence my preference for native code when possible.  As a developer I'll take a hit on development costs and time in order to provide a better user experience.  As an example, I don't know if you remember what it was like installing Chinese Text Analyser, but a lot of development time and effort went in to making the process as painless and effortless as possible compared to many Windows applications - no need to choose or think about 32-bit vs 64-bit versions, no large additional dependencies to download, no Next->Next->Next clicking in the installer, just one click to say you trust the .exe, one click to install, and one click to launch and you're done.

 

A considerable amount of time and effort was spent to make that possible, and it's something most users probably won't even realise they appreciate.

 

From a developer's perspective, what really bugs me about Java is the enforced directory structure based on package names.  All those empty directories...grrr, a real pain if you like doing things from the command line.

Link to comment
Share on other sites

@imron I think that is what makes webservices attractive for developers and users, the developer has full control over the environment while the user doesn't need to install anything... the drawbacks are obviously server costs for the developer and increased dependancy for the user

 

Come to think of it, I would say Chinese Text Analyer could work quite well as a webservice for the occasional user...

Link to comment
Share on other sites

 

 I think that is what makes webservices attractive for developers and users

I've to disagree on this one. I strongly prefer a one time install of a dependency like .net framework or java runtime above a network dependency. Sure, having to instal (unexpectedly) an additional component can be a pain, but being dependent on a data network is a bigger pain. The extra component is a one time event and if the installer has a build-in check and installs them when needed there's no real issue. Data network dependency is a different beast. It requires a dataplan or is dependent on unreliable wifi connections with associated ongoing costs. Specially when travelling this is a pain and/or may turn out quite expensive.

Link to comment
Share on other sites

Come to think of it, I would say Chinese Text Analyer could work quite well as a webservice for the occasional user...

I had thought of doing that, and may do somthing in the future but it has a number of drawbacks.

Firstly as Silent mentioned there's a network dependency that gets introduced, secondly it will be slow to work with large files - not because of CTA but because of generally slow upload speeds, and finally I don't particularly like web-programming :mrgreen:

Link to comment
Share on other sites

@imron, presumably you'd be using Javascript or something else that runs on the client side. Still, I imagine the amount of code necessary to do CTA as a webservice would be rather large and probably not well suited to a webserver.

 

Personally, I tend to prefer properly written Java applications, I use Linux, Win Vista, Win 7, Android and would be using FreeBSD as well if not for some practical drawbacks. Granted that Android doesn't really use Java for technical reasons, but I'd much rather have the same application running on all of my installs with the ability to keep it synchronized or shared between the installs. A well designed Java application is one of the easier things to share between multiple installs.

 

In an ideal world it's no-install except for the Java runtime and the actual program files and such can be in their own directory.

 

As far as performance goes, Java is actually quite speedy, the main issue is that it requires you to run the program for a while in order for the VM to get warmed up. Last time I checked, Java was a popular language for High Frequency Trading platforms as it's actually quite speedy compared with the alternatives.

 

Different strokes for different folks I suppose, but for folks that use more than one computer, a well written Java program is in a much better position to allow the user to take their work to different OSes and computers than most other languages. It's hardly the perfect language, I doubt such a thing exists, but I don't think that in the modern era the bit of bloat you get from the runtime environment is such a big deal. I mean, most developers can't be bothered to optimize their own code anyways, might as well get something for the trade.

Link to comment
Share on other sites

Actually most of it would be server side and would run using the same underlying code as the current exe. The only platform dependent code in CTA is the GUI. All the core segmenting and analysis is C++ and in fact was first developed on OSX as a command line tool. Server load would be minimal because the application is highly performant.

It would then generate HTML with spans breaking up the text as needed. I've previously actually experimented with sending json and the piecing it together on the client, but with all the dom manipulation performance for large files is much worse than sending pre segmented HTML.

Re: high performance trading, C++ is also very popular. For non GUI applications, well written C++ is also highly portable.

Regarding Java apps, especially ones not written by yourself, they can be a real pain. For example, the Australian government has a java program for it's AusKey authentication process which is used by businesses for submitting quarterly tax statements and more.

Written in Java ostensibly for portability between all platforms, but it breaks every time I upgrade OSX versions or Java versions. It's a real pain because it's a reasonably critical business program with no alternative. It gotten to the point where I avoid upgrading anytime around the end/beginning of a quarter because it's usually a couple of hours worth of messing about to fix, and if the various vendors haven't got their act together (oracle, AusKey, browser, OS) it may take a few weeks before a solution is available.

Well written Java can avoid that problem, but there's plenty of poorly written java out there.

Link to comment
Share on other sites

Join the conversation

You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Click here to reply. Select text to quote.

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...