PDA

View Full Version : What programming languages do you know?



Stex
June 3rd, 2008, 08:55 PM
As an aside from the usual "What language should I learn?" I'm wondering: How many languages should I learn?

I know everything internet: PHP, html, javascript, sql, css, etc. But as I approach the ripe old age of 20 I'm getting the feeling that wont be enough to get me into the shiny top ranks of google (or whatever the coder's mecca is in 3 years time).

So I'm going to start learning C of some form and either java or python. Is that enough? Too much? How many do you know and is it for profession or hobby?

Caduceus
June 3rd, 2008, 09:00 PM
Depends on what field you want to get into. Embedded systems use C, a lot of web apps use Java and Python is used everywhere.


Sorry I can't be more indepth.

Lster
June 3rd, 2008, 09:03 PM
I know C, Assembly, Visual Basic, Java and C# fluently. I know a bit of HTML/ JavaScript (used to know more), Python and C++. I'm learning for fun and hopefully a career in something maths like...

Bichromat
June 3rd, 2008, 09:03 PM
I know Fortran 90 and Python quite well, just enough C and C++ to do nasty bugs, Basic and Logo were my first languages (I was 10 then) but I do not use them anymore. I'm currently playing with Haskell.

Lster
June 3rd, 2008, 09:06 PM
...Haskell...

Me wants to learn that. :)

Lau_of_DK
June 3rd, 2008, 09:06 PM
So I'm going to start learning C of some form and either java or python. Is that enough? Too much? How many do you know and is it for profession or hobby?



I think its good to know C, it will teach you a generic lowlevel language, which structure you will find replicated in many many languages.

I think its also good to know Python, because its handy for writing neat scripts and stuff. It might also come in handy commercially at one point. I dont think Python brings anything new to the table though, perhaps with the exception of "lambdas" and generators, so its not something you can/should invest a lot of mental capacity in. Maybe instead try out Haskell and Lisp, to get a feel of both, as they are very different from C in both form and style. (I dont know any Haskell myself, so maybe F# or such is a better alternative, somebody else will have to tell you, just something functional).

And again, it also depends how deep you want to dig. When I hear Rick Hickey talk about how he created Clojure, I get the feeling that he has worked with almost every language there is and understood it in-depth in order to create a new ultra powerul language.

So, to sum up. C is good, learn it. Python is good - as language it has little value I think, but as a utility its quite handy. Get some functional programming, and then check out Lips/SBCL/Clojure - you might love it :)

/Lau

issih
June 3rd, 2008, 09:20 PM
My advice, start with something high level, then learn something low level, and make absolutely sure you understand WHY the high level language hid this stuff from you, understand how much more of a mess you can get into in c/c++. Learn both though, I did java then c++

Also learn at least one normal and one object oriented one, and really try to get a handle on the differences, there are far far too many people who code OO stuff without really getting it at all.

Probably worth learning something functional too (I really should do this), get a handle on the big ideas, the rest is pretty much just semantics in my opinion.

List of things I've used far:

(basic/VB/fortran/java/javascript/C++/others I've forgotten)

Sockerdrickan
June 3rd, 2008, 09:24 PM
You should at least learn one advanced language like C++ and one to solve tasks quickly, like with Python

Curently I talk: C C++ Ruby PHP

hessiess
June 3rd, 2008, 09:26 PM
My advice, start with something high level, then learn something low level, and make absolutely sure you understand WHY the high level language hid this stuff from you, understand how much more of a mess you can get into in c/c++. Learn both though, I did java then c++

Also learn at least one normal and one object oriented one, and really try to get a handle on the differences, there are far far too many people who code OO stuff without really getting it at all.

Probably worth learning something functional too (I really should do this), get a handle on the big ideas, the rest is pretty much just semantics in my opinion.

List of things I've used far:

(basic/VB/fortran/java/javascript/C++/others I've forgotten)

I would say the opasite, as I never understood programming before learning C++ (which I am still learning). C/C++ is still the fastest language besides assembly.

xlinuks
June 3rd, 2008, 09:33 PM
So you already know server-side programming, thus you should learn desktop-programming, that is C/C++ if you wish something "elite", or Python which is easier but has it's drawbacks (just like any other language).

LaRoza
June 3rd, 2008, 09:44 PM
C/C++ is still the fastest language besides assembly.

No it isn't (C/C++ isn't a language either ;))

KingTermite
June 3rd, 2008, 09:55 PM
Languages I've worked with at some point or another in my life.

Basic, Ada, C, C++, Perl, Perl/Tk, Java, C#, Javascript, Visual Basic, CDATS (homebrewed language at work), IBM Assembly.

I'm probably missing a few. I've written programs in those languages, but that doesn't mean I'm all fluent/proficient in each and every one. About 90% of my development is in C/C++.

xlinuks
June 3rd, 2008, 09:55 PM
No it isn't (C/C++ isn't a language either ;))

With languages of the C/C++ "type" - it's completely up to the compiler.

techmarks
June 3rd, 2008, 10:04 PM
As far as the speed issue, according to the Benchmarks of Computer Language implementation page C or C++ are usually at the top and Ruby and Prolog rank at the bottom.

Here's the link;

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

Stex
June 3rd, 2008, 11:24 PM
http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=all

As we're slipping into the subject:

I've seen that benchmark site around here a lot, but I don't get what it really means. Is python really 12 times slower than C++?

Tomatz
June 3rd, 2008, 11:26 PM
10 print "i can only remember basic thats how old and decrepid i am" ;
20 goto 10
run

Jessehk
June 4th, 2008, 12:43 AM
Some of these I know very well, and others I know enough that I could easily refresh my memory should the need arise.
I'm going into EE in September. :) Next on my list is any sort of assembly.

C++
C
D
C#
Python
Ruby
Common Lisp
Haskell
Ocaml
Perl
Bash
Lua
Java
Turing (teaching language, now defunct)
HTML, css, etc
Javascript (just the basics; I never really bothered)

LaRoza
June 4th, 2008, 01:44 AM
I've seen that benchmark site around here a lot, but I don't get what it really means. Is python really 12 times slower than C++?

For the tasks they tested, yes.

However, try writing something in Python, then in C. It won't matter if it takes .012 or .001 seconds to complete a task if development is 12 times slower.

Wybiral
June 4th, 2008, 03:03 AM
For the tasks they tested, yes.

However, try writing something in Python, then in C. It won't matter if it takes .012 or .001 seconds to complete a task if development is 12 times slower.

Look at the "sum-file" test between C++ and Python...



#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

#define MAXLINELEN 128

int main(int argc, char * * argv) {
ios_base::sync_with_stdio(false);
char line[MAXLINELEN];
int sum = 0;
char buff[4096];
cin.rdbuf()->pubsetbuf(buff, 4096); // enable buffering

while (cin.getline(line, MAXLINELEN)) {
sum += atoi(line);
}
cout << sum << '\n';
}

vs



import sys, itertools

print sum(itertools.imap(int, sys.stdin))


And actually, the Python+psyco module didn't do too bad in terms of high-level languages. I'm curious how Jython would do.

As far as my languages, many languages are so similar that it's not even worth mentioning. For instance, if you learn C++ you can learn Java/D/C#/Obj-C etc in a day or so. If you learn common lisp, you can learn scheme and other variations in no time at all. If you learn Python, you can learn Ruby and similar languages. It doesn't make sense to learn all of these languages when the only differences are petty syntax issues.

The only *reason* to learn something similar is if it has better support, better libraries, or it's required. With that being said, I think it's worth it to learn at least some variation of these: C, Python|Ruby, Lisp|Scheme

And from what I hear, Haskell is another interesting one, although I haven't gotten around to that yet. But almost everything else is a rehash of those or can easily be expressed in one of those so it's a waste to learn too many variations.

pmasiar
June 4th, 2008, 04:25 AM
Python is good - as language it has little value I think, but as a utility its quite handy.

Not sure how you calculate language's value :-) Especially Python, which passes most of everything parameters by reference :-D

Now seriously:

I see importance (and value :-) ) of Python in the fact that you can learn all those advanced concepts present in other languages in more friendly environment of the Python shell. And Python will be always with you when you will need just to massage that text file quickly, or generate bunch of test data for something else - and you will not forget the syntax, unlike say Perl. Even if Python will not be your main language, there will be always small little tasks where Python is perfect match. Power of Python is in being straightforward and obvious. It fits in a head of a busy person, who has better things to do than remember language quirks.

Learning C is important: it will give you idea how many details you need to handle - and will give you more appreciation for Python handling most of it for you. But don't be obsessed by raw performance: 90% of it is just doing boring stuff correctly.

IIRC, Hemingway said something like: you may remove any word from your story, as long as reader will know it was there. Same with programming: once you understand (in C) what exactly is going "close to the metal", there is no sense to waste time to handle all that boring stuff by hand, unless task explicitly requires it. Remember, that most important speed in programming is "speed to the market". :-)

Then, try very different languages. Prolog, Lisp/scheme, Erlang, SQL, or my favorite "different" language, Forth. They will force you to think about programming differently. Which is exactly the point of learning different languages: see programming from different perspective.

Then you can learn syntax of any language quickly - and will know that problem is not in syntax, but in learning libraries, data structures, problem-oriented frameworks, patterns to solve common problems. That is much harder than just syntax.

sznurek
June 4th, 2008, 07:49 AM
What programming languages do you know?

Currently I am using Ruby, Python and C (sometimes C++ and Bash).

Previously I had been using PHP, Java (3 years), Haskell, Lisp(not much), Perl, Pascal.

IMHO it's good to know many programming languages (especially functional languages like Lisp and Haskell - I've learned a lot using Haskell only 1 month).

Python + C is very powerful :)

Bichromat
June 4th, 2008, 08:44 AM
As we're slipping into the subject:

I've seen that benchmark site around here a lot, but I don't get what it really means. Is python really 12 times slower than C++?

The ranking is more or less accurate. Some of the benchmarks do I/O in the core loop of the code, and the speed of I/O varies a lot from language to language. The binary-trees benchmark does not preallocate memory, but it's the first thing someone looking for performance would do. Etc.

Stex
June 4th, 2008, 11:32 AM
On my personal note my original question was answered, so thank you all (but don't let that stop you from chatting). I was going to learn C first but, as the suggestion is different types, I think I'll start with java as I want to be more knowledgeable in OOP. Then to something a bit scarier, like functional languages.

I'm incredibly compulsive when it comes to optimization, I'll spend hours just to trim off a couple of function calls or files (though on a server resources are more important than desktop). I fear that I will obsess for days once I get the tweaking power of a low level language like C.


the speed of I/O varies a lot from language to language

Surely the speed of I/O is up to the compiler? Because, when it boils down to it, whatever language you're using you're just going to call an open file stream function.

Magnes
June 4th, 2008, 01:21 PM
I know C++, PHP, C, C#, PL/SQL, a little of Java and Pascal... A little of other languages also. I don't think it's a problem to learn new language when you know others (especially C++). I ofter write applications or functions in languages I don't really know (VisualBasic comes into mind) :P.

LittleLORDevil
June 4th, 2008, 03:03 PM
Java, C/C++, MIPS Assembly(<- not my personal fav). I am getting into web development and starting to mess around with HTML and other web development languages. I would like to learn some Python sometime soon.

jespdj
June 4th, 2008, 04:43 PM
Java is the programming language I know best, have been using it professionally the past 8 years.
JavaScript - I also use this at work for web applications.
C and C++, I was programming in these languages before I started with Java. It's a long time ago I programmed anything non-trivial in C or C++...
Ruby - I'm using it occasionally for automating tasks and trying things out.
Python - I've followed some tutorials and looked at the source of some programs, but I've never really written anything in it.
Scala (http://www.scala-lang.org/) looks like a very interesting new programming language. I haven't really used it for anything yet.
C# - I played with it for a few days (on Windows, with thr free Visual C# Express Edition). It's a lot like Java and has some nice features.
Pascal - I used it long ago (Turbo Pascal, in 1992 or so) on my first PC.
Scheme - A variant of Lisp that I learned at university but which I haven't used since.
Basic - Commodore Basic v2.0 on the Commodore 64 was my first programming language.
Assembly - 6502 assembly language (on the Commodore 64) and Intel x86 (on the PC).


I did not mention HTML, CSS, XML and SQL above because those are not programming languages.

billenbois
June 4th, 2008, 05:07 PM
c/c++/c#/x86 asm/68k asm/python/php/bash/..

but languages are easy, its often about learning the API..
you can code something very easily in C with GTK for example and be lost with MFC in C on windows.
Likewise, I like to use GTK and I know it pretty decently, but ask me to do something in QT, I'm gonna have to learn the API

pmasiar
June 4th, 2008, 06:30 PM
I've seen that benchmark site around here a lot, but I don't get what it really means. Is python really 12 times slower than C++?

Speed of execution very often is not that much relevant: if you have program which you run once, or once a week, saving half a second of runtime (on a computer which is 98% idling anyway) does not make much sense. Also, many applications are I/O bound (waiting for browser/server or server/database communication), so if 90% time is waiting, making remaining 10% of time 100 times faster will increase speed of your program max 10%. But for that speed, you pay a lot of programming efforts, and complication in future enhancing the code. In such cases, is better to use high-level language, for rapid app development.

Speed is not a problem until you can **measure** that speed in particular part of the code is a problem. And most important speed is speed to the market. :-D

jpages
June 4th, 2008, 07:17 PM
My main languages are C (for low-level programming, or when performance is needed), and Python (for high-level programming).

I use also Ruby, Bash and technologies (not Turing-complete) such as XHTML, CSS, SQL and XML.

I have also learnt C++ and Java during engineering classes, but I nearly don't use them.

NathanB
June 4th, 2008, 08:03 PM
As an aside from the usual "What language should I learn?" I'm wondering: How many languages should I learn?

What is with this "should" stuff? It is really a person preference thing. Mostly, this depends on your goal. But, if you are _too_ intent on adding notches to your belt, you will loose focus. A better path is to stick with one (or a few) language and get plenty of practice on algorithms and data structures -- skills you can use no matter what future language you end-up coding in.


I know everything internet: PHP, html, javascript, sql, css, etc. But as I approach the ripe old age of 20 I'm getting the feeling that wont be enough to get me into the shiny top ranks of google (or whatever the coder's mecca is in 3 years time).

What kind of 'goal' is that!?? Kids these days... I swear! ;-)



So I'm going to start learning C of some form and either java or python. Is that enough? Too much? How many do you know and is it for profession or hobby?

The university profs claim you should start with a procedural language, so C would be an excellent choice. It is a *small* language, so that keeps the learning curve less steep than these popular O-O languages we keep hearing about.

Nathan.

LaRoza
June 4th, 2008, 08:17 PM
The university profs claim you should start with a procedural language, so C would be an excellent choice. It is a *small* language, so that keeps the learning curve less steep than these popular O-O languages we keep hearing about.


C can be used for OO programming, and an "OO" language can be used procedurally.

NathanB
June 4th, 2008, 08:31 PM
I think its good to know C, it will teach you a generic lowlevel language, which structure you will find replicated in many many languages.

Actually, a programmer can learn the low-level stuff from a high-level language (if it is presented to them properly) and they can certainly do a great many things and learn many, many languages without ever having to approach any C related languages.


I think its also good to know Python, because its handy for writing neat scripts and stuff. It might also come in handy commercially at one point. I dont think Python brings anything new to the table though, perhaps with the exception of "lambdas" and generators, so its not something you can/should invest a lot of mental capacity in. Maybe instead try out Haskell and Lisp, to get a feel of both, as they are very different from C in both form and style. (I dont know any Haskell myself, so maybe F# or such is a better alternative, somebody else will have to tell you, just something functional).

Things like Python are excellent for "glue work" -- and that is becoming more valuable these days.

Haskell, Lisp -- why is it that nobody ever mentions a Prolog Inference Engine anymore?? :-) I remember when TurboProlog was present on every computer lab system right along side the C and Pascal suites.



And again, it also depends how deep you want to dig. When I hear Rick Hickey talk about how he created Clojure, I get the feeling that he has worked with almost every language there is and understood it in-depth in order to create a new ultra powerul language.

So, to sum up. C is good, learn it. Python is good - as language it has little value I think, but as a utility its quite handy. Get some functional programming, and then check out Lips/SBCL/Clojure - you might love it :)

/Lau

I believe you mean to say "little *unique* value" which I agree with.

Nathan.

NathanB
June 4th, 2008, 08:36 PM
C can be used for OO programming, and an "OO" language can be used procedurally.

Very true. But, remember this: If you provide them the features, you *know* the dang fools are going to use them! :)

Nathan.

NathanB
June 4th, 2008, 09:34 PM
Was in response to:
Originally Posted by Stex >>
I've seen that benchmark site around here a lot, but I don't get what it really means. Is python really 12 times slower than C++?
For the tasks they tested, yes.

Excellent observation. IMHO, that benchmark (and the several others like it) give the wrong impression (biased toward strongly-typed languages with optimizing compilers) because they don't test a complete, non-trivial application ( an interpreter or compiler, for instance, implemented in each of those languages would be a much better test ). Too many other variables enter the picture which those simple tests simply gloss-over.


However, try writing something in Python, then in C. It won't matter if it takes .012 or .001 seconds to complete a task if development is 12 times slower.

That is the popular "beginner's lament" which is so totally untrue when it comes down to comparing two very competent programmers (one Python and one C) tasked with the same goal. When you consider that the C programmer has already created his 'private library' of functions, macros, snippets, STLs, code-producing scripts, etc. (in other words: his 'toolbox'), then the Python programmer holds no advantage over him. In fact, you'd expect the immediate feedback from the type-checking compiler to give the C guy an edge at bug-squashing -- which you must admit is a large portion of the development cycle.

Nathan.

LaRoza
June 4th, 2008, 09:43 PM
That is the popular "beginner's lament" which is so totally untrue when it comes down to comparing two very competent programmers (one Python and one C) tasked with the same goal. When you consider that the C programmer has already created his 'private library' of functions, macros, snippets, STLs, code-producing scripts, etc. (in other words: his 'toolbox'), then the Python programmer holds no advantage over him. In fact, you'd expect the immediate feedback from the type-checking compiler to give the C guy an edge at bug-squashing -- which you must admit is a large portion of the development cycle.


No, it is a fact. Get slavik and his Perl's of wisdom, pmasiar with his Python and the best C coder in the world, and get them to do the same daily tasks, using involving the web, parsing text, quick GUI's, or other applications, I bet slavik could do the task in 3 minutes on one line, pmasiar in 3 minutes on four lines, and the C programmer in 3 hours on 40 lines. (Non scientific numbers here, and I didn't specify the task, and I didn't feel like creating an actual scenerio with actual benchmarks. If you want to test my little statement, do it. Write something in Python/Per/Ruby then in C (assuming you know them equally well) and time yourself.)

KingTermite
June 4th, 2008, 09:45 PM
C can be used for OO programming, and an "OO" language can be used procedurally.

This was in response to somebody who mentioned it in regard to beginning programmers at University. C can not be used for OO by a new programmer....that starts getting pretty complex from a procedural point of view.

Lster
June 4th, 2008, 09:54 PM
No, it is a fact. Get slavik and his Perl's of wisdom, pmasiar with his Python and the best C coder in the world, and get them to do the same daily tasks, using involving the web, parsing text, quick GUI's, or other applications, I bet slavik could do the task in 3 minutes on one line, pmasiar in 3 minutes on four lines, and the C programmer in 3 hours on 40 lines. (Non scientific numbers here, and I didn't specify the task, and I didn't feel like creating an actual scenerio with actual benchmarks. If you want to test my little statement, do it. Write something in Python/Per/Ruby then in C (assuming you know them equally well) and time yourself.)

A "fact" that should be dismissed (as undecidable) when scrutinized thoroughly because you provide no information but only speculation. ;) I think you'd be surprised how efficient some people are. I remember seeing someone in the Project Euler forums who coded each solution (or at least most of them) in Assembly. He was often the first to post in the forums for new problems... :)

pmasiar
June 4th, 2008, 09:57 PM
That is the popular "beginner's lament" which is so totally untrue when it comes down to comparing two very competent programmers (one Python and one C) tasked with the same goal.

This is very obvious and untrue impression of people who do not know dynamic language deeply. It is not only about typing - it is also about flexible data structures.

Let's solve simple task, you in C and I in Python: Read and analyze comma-delimited file, where second field is key, and 3rd is values (may be multiple values for same key), and create histogram: sort key in order of number of values. Measure the time needed to do it, and lines of code. And also code needed to generate test data :-)

Calmor
June 4th, 2008, 10:17 PM
I started in BASIC on a Commodore 64, and haven't gone very far.

I still program in VB and learned some SQL and ASP.NET basics (with VB backend) through Visual Studio.

Over the years, I've dabbled in C, and x86 assembly, and took a course in C++ and one in Java (though both were of little help as we barely got past the concepts of variables and arrays and never made it to C++ classes).

I've recently been migrating to Ubuntu, but Visual Studio keeps me dual-booting as I have a few projects which need to be done quicker than I can learn a new language.

I'd really like to do more cross-platform programming (Java or Python) and server-side database web site development that doesn't require Microsoft products... but the proficiency I currently have in VB makes it hard to find time (work and school don't help either). I know it's not nearly as powerful, fast, efficient, or useful as most languages, but I can be up and running quickly for things Windows or web related.

NathanB
June 4th, 2008, 10:22 PM
On my personal note my original question was answered, so thank you all (but don't let that stop you from chatting). I was going to learn C first but, as the suggestion is different types, I think I'll start with java as I want to be more knowledgeable in OOP. Then to something a bit scarier, like functional languages.[QUOTE]

Java is always a safe bet. Extremely popular. Portable. Plenty of quality material to learn from. And you can make an easy transition to C/C++ if you ever need to.

[QUOTE]I'm incredibly compulsive when it comes to optimization, I'll spend hours just to trim off a couple of function calls or files (though on a server resources are more important than desktop).

That is a valuable attitude and habit to maintain. Remember to reduce system calls too... and make use of facilities like memory-mapped files to reduce I/O overhead.


I fear that I will obsess for days once I get the tweaking power of a low level language like C.

Why? In most cases you'd just let the compiler do the optimization. Get a good textbook on Algorithms and Data Structures. Pay attention (and run your own tests) to the chapters that demonstrate both iterative and recursive implementations of popular structures. Make good choices there and you will have no desire to obsess.


Surely the speed of I/O is up to the compiler? Because, when it boils down to it, whatever language you're using you're just going to call an open file stream function.

That would be dependent on the standard library -- not the compiler ( one can always switch-out the default StdLib for an alternative one { or choose to not use one at all } ). Actually, the "speed of I/O" is more influenced by the operating system routines {and associated structures and buffers} and the device driver routines {and associated structures and buffers} and the I/O hardware {and associated firmware and cache}. In general, you will find that what is more important, in performance terms, is you overall approach to how your application handles I/O issues.

Nathan.

NathanB
June 4th, 2008, 10:35 PM
A "fact" that should be dismissed (as undecidable) when scrutinized thoroughly because you provide no information but only speculation. ;) I think you'd be surprised how efficient some people are. I remember seeing someone in the Project Euler forums who coded each solution (or at least most of them) in Assembly. He was often the first to post in the forums for new problems... :)

Then you would not be surprised to learn that I do most of my 'proto-typing' in Assembly.

Nathan.

LaRoza
June 4th, 2008, 10:43 PM
A "fact" that should be dismissed (as undecidable) when scrutinized thoroughly because you provide no information but only speculation. ;) I think you'd be surprised how efficient some people are. I remember seeing someone in the Project Euler forums who coded each solution (or at least most of them) in Assembly. He was often the first to post in the forums for new problems... :)

I provided a link to a study earlier. It is in the link in my sig, and it is an article with the wording "scripting" in it.

RaleTheBlade
June 4th, 2008, 11:07 PM
My mainstay is C#, a little Visual Basic (I don't like the syntax though... it just doesn't seem "real"), and I'm moving more and more towards Win32 C++ and trying to get into C++ in Linux.

I still believe in the low level aspects of alot of languages. After all, memory management and low level I/O are still very important topics to understand for any software developer/computer programmer.

slavik
June 6th, 2008, 03:41 AM
Speed of execution very often is not that much relevant: if you have program which you run once, or once a week, saving half a second of runtime (on a computer which is 98% idling anyway) does not make much sense. Also, many applications are I/O bound (waiting for browser/server or server/database communication), so if 90% time is waiting, making remaining 10% of time 100 times faster will increase speed of your program max 10%. But for that speed, you pay a lot of programming efforts, and complication in future enhancing the code. In such cases, is better to use high-level language, for rapid app development.

Speed is not a problem until you can **measure** that speed in particular part of the code is a problem. And most important speed is speed to the market. :-D
then there are apps that handle the stock market data (try telling those guys to use Python in an environment where half of a second does matter) ;)
there are also emulators (very few are pure C, most are C with assembly)

Anything where you need speed, interpreted languages aren't that great, but if you are not going for speed, you can safely use interpreted languages (I support Perl in this regard).

LaRoza
June 6th, 2008, 04:07 AM
Anything where you need speed, interpreted languages aren't that great, but if you are not going for speed, you can safely use interpreted languages (I support Perl in this regard).

It depends on what "speed" is. A car is fast compared to a human, but slow compared to a jet (ignore jet cars for the moment).

slavik
June 6th, 2008, 04:13 AM
It depends on what "speed" is. A car is fast compared to a human, but slow compared to a jet (ignore jet cars for the moment).
many times you want a supersonic jet ;) (like emulators, financial transactions, real time monitor equipment like in hospitals, etc.)

for example: I have a Q6600 which has 4 cores running at 2.4GHz, PCSX2 (PS2 emulator) was able to play Tekken5 at about 12-16FPS during fights. PS2 isn't a very powerfull machine (main CPU is 300 or 500 MHz, I don't remember).

Not only that, remember that the XBOX has a Pentium3 at 733MHz and even then my system would be slow in running XBOX games ...

Can+~
June 6th, 2008, 05:05 AM
Even is python is interpreted, it compiles itself for speed, generating .pyc files, not that I care about that, but just to point out.

Anyway, back to the subject:

I know a lot of:
-ActionScript
-C
-C++
-Python
-HTML/XHTML/CSS

I know a little about:
-Bash
-Javascript
-PHP
-*SQL* (there isn't that much to learn, but things like how to build a relational db)

I would like to know (in priority order):
-LISP
-Java
-Perl
-More python modules =D.
-Check ruby maybe

I'm avoiding:
-C#, ugh.

Wybiral
June 6th, 2008, 05:42 AM
many times you want a supersonic jet ;) (like emulators, financial transactions, real time monitor equipment like in hospitals, etc.)

You say "many times", but that really depends what you're doing. There are problems with virtually no possible algorithmic optimization, and in some situations you do have to resort to bit flipping... But in my experience, this happens WAY less often than the demand for either a high-level algorithmic solution or a short development time and a manageable result.

Sometimes a supersonic jet takes too long to put together and requires too much maintenance, and all that time you wasted trying to build it could have been spent shopping for the most efficient bicycle.

Barriehie
June 6th, 2008, 05:52 AM
Let's see, in 1978 I finally saw a computer, an Apple ][e with 48K ram and I was hooked. Learned BASIC on it and then dived into assembly. By the time the 486 machines were introduced I was into x86 assembly and C++. Now with the web what it is and this new shiny OS I've got I've managed to become rather proficient with HTML, PHP, MySQL, a bit of JS and CSS is still on the todo list.

Barrie
(my pages work and I think they look okay!) GIMP is in there too...:)

AndyCee
June 6th, 2008, 06:02 AM
Ignoring the hijacks on this thread...

I have learnt C++ through my course at Uni. That's all. I started learning Java, but dropped it for a more favourable subject. Oh, and Maple, but that's not really 'programming'...

I plan to learn Python and Java. Obviously each language has its own merits, but C(++), Java and Python is a pretty good spread IMO.

The logic at the Uni where i study is to learn coding "bottom-up". I am told that C and C++ have fascinating exploits not possible in java, and it really is used everywhere. I'm not going to go into "speed of coding" and efficiency, which is clearly not what you're asking for.

If you want to pimp your resume for an IT 'mecca', you will need different tools for, say, a programmer than for a sysadmin. Which area are you interested in? If web tech, Java would appear to me to be more useful. Probably easier, too, if you already know Javascript.

descendency
June 6th, 2008, 06:13 AM
C++, C#.

I've had experience in HTML, CSS, PHP, Java, QuickBasic, Visual Basic, Javascript, SQL, and something tells me I am forgetting a few.

Oh and One semester of college in COBOL. Never again. . . never.

babacan
June 6th, 2008, 12:23 PM
sorry for hi-jacking the thread but , is java counted as a high level language ? If so , for an average java programmer how hard it would be to learn C/C++ for low level programming (mostly for performance increase) ?

pmasiar
June 6th, 2008, 01:19 PM
then there are apps that handle the stock market data (try telling those guys to use Python in an environment where half of a second does matter) ;)

Funny that you remind me about the use case where Python is not used, which I used repeatedly to remind people that in some rare cases Python is not used... :-) I even know the guy who does that trading for living. :-) My guess is that less than 1% of programmers code such time-restricted applications which are also not I/O bound or database bound.

BTW, they use Ruby to generate test data and run integration testing, so he said he spends more time writing Ruby code (to generate test cases) than C++ :-)

pmasiar
June 6th, 2008, 01:24 PM
Let's solve simple task, you in C and I in Python

Seems that no-one is ready to challenge me, because difference in time spent will be too obvious to ignore :-)

QED :-P

nvteighen
June 6th, 2008, 04:18 PM
My story, chronologically (Real programmers count from zero):
0. ZX-Spectrum BASIC
1. QBASIC
2. Visual Basic 4.0 & 6.0
3. Some Javascript
4. Tried C++...
5. Stopped programming because of the frustration I got with C++
6. Slowly returning years later with C.

I know: not best "curriculum", but I've always coded for fun. So, what I need is what I'll enjoy. So, currently, I focus myself on C because I want to learn it right and not go on for trying lots of languages... and then never actually understand any.



Let's solve simple task, you in C and I in Python: Read and analyze comma-delimited file, where second field is key, and 3rd is values (may be multiple values for same key), and create histogram: sort key in order of number of values. Measure the time needed to do it, and lines of code. And also code needed to generate test data :-)

That's a waste of time! Just write "Hello World" in C and in Python and you'll get the point (and I'm a C-fan...):



/*C*/
#include <stdio.h>

int main(void)
{
printf("Hello World!\n");

return 0;
}




#Python
print "Hello World!\n"

Lster
June 6th, 2008, 04:48 PM
Seems that no-one is ready to challenge me, because difference in time spent will be too obvious to ignore :)

I am actually. Just what task is it going to be and can I use pre-written libraries (considering Python has lots)? If we record how long it takes us - I'd take your word on it and I hope you'd trust me. :)

I could well get beaten too! ;)

LaRoza
June 6th, 2008, 07:00 PM
Seems that no-one is ready to challenge me, because difference in time spent will be too obvious to ignore :-)

They are still working on the C version.

NathanB
June 6th, 2008, 07:18 PM
sorry for hi-jacking the thread but , is java counted as a high level language ? If so , for an average java programmer how hard it would be to learn C/C++ for low level programming (mostly for performance increase) ?

Yes, Java is considered high-level ( but these terms are relative: ASM coders classify C as high-level but Python coders classify it as low-level ).

Since Java shares a great deal of the C/C++ rules and syntax, the transition would require minimum effort. But with JavaVM's use of Just-In-Time (JIT) compilation to native code, there is rarely a need to resort to that. Just don't attempt to write the next installment Unreal Tournament entirely in Java. ;-)

Nathan.

rye_
June 6th, 2008, 07:39 PM
with reasonable confidence:
ruby, matlab/octave, c (K&R, rather then using C++ features in c style)

lesser confidence;
c++, lisp,

EDIT: forgot HTML, also working on CSS

pmasiar
June 6th, 2008, 08:17 PM
Since Java shares a great deal of the C/C++ rules and syntax, the transition would require minimum effort.

Really? But C++ requires really manage your data by hand - and libraries are quite different too. Syntactic sugar is similar for both languages (as both build on C - trivial differences in syntax), but differences in libraries and coding patterns are quite deep, IMHO. Not that I know much of C++ :-)

slavik
June 6th, 2008, 08:19 PM
BCPL, B, C, C++, Java, Python, C#, Perl, Python, Ruby, PASCAL

all have syntax that is somehow a descendant from Algol60. :)

NathanB
June 6th, 2008, 08:25 PM
I know: not best "curriculum", but I've always coded for fun. So, what I need is what I'll enjoy. So, currently, I focus myself on C because I want to learn it right and not go on for trying lots of languages... and then never actually understand any.

Yes! That's on the top of the list as the best advice given in this thread.


That's a waste of time! Just write "Hello World" in C and in Python and you'll get the point (and I'm a C-fan...):

No -- any "speed of coding" and/or "lines of code" comparison between compiler-language-guy vs. script-language-guy is a waste of time because the compiler-guy will make use of a sophisticated macro system and advanced Compile-Time-Language (CTL) features so that his implementation of the project can be coded in essentially the same number of lines and take the same amount of time (and may even look exactly the same). In fact, in a sense, languages like Python are little more than glorified CTLs -- but, IMO, they throw away the best half of the tool.

Well the trolling has lead us into an interesting side-channel, but let's get back to the OP's performance enquiries.

[Picked from pmasiar's earlier post:]
Speed is not a problem until you can **measure** that speed in particular part of the code is a problem.

Well, you can also note the time before the particular code runs and then subtract it from the time after it has run -- so the execution performance is always measurable.


pmasiar>> And most important speed is speed to the market.

You can pay dearly for that in terms of bug-reports, support costs, and a generally unfaviorable PR.


pmasiar>> Speed of execution very often is not that much relevant...

Install an old version of Thunderbird { maybe this still burdens the product, but I am assuming they have discovered a solution by now } and send yourself 10,000 emails randomly from about a half-dozen different FROM addresses. Then, in Thunderbird, click on the header for the FROM column to initiate a sort-by-from operation. Then come back and tell us how long the sort took to complete. No hurry here... we'll still accept your answer next week. ;)

How willing are you to trade your broadband internet for dial-up access. Any takers here???? Huh? What do you mean it doesn't entice you?

How about we go into business together selling desktops equipted with a 16MHz 386 CPU. What do you mean it is to slow??

The lesson from history is that execution performance is ALWAYS important.

But, speaking of history, I'll play nice by admitting that interpreters were proven by experiements during the 60's era to be just as fast as (sometimes faster than) compiled code for a great many of core enterprise computing tasks.

Nathan.

nvteighen
June 6th, 2008, 08:55 PM
(...) In fact, in a sense, languages like Python are little more than glorified CTLs -- but, IMO, they throw away the best half of the tool.

Can you please develop what "the best half" is? I think I understand what you mean vaguely, being essentially a compiler-guy... I can't clarify myself why I always felt uncomfortable with interpreted languages (too much BASIC, may it be?).


Install an old version of Thunderbird { maybe this still burdens the product, but I am assuming they have discovered a solution by now } and send yourself 10,000 emails randomly from about a half-dozen different FROM addresses. Then, in Thunderbird, click on the header for the FROM column to initiate a sort-by-from operation. Then come back and tell us how long the sort took to complete. No hurry here... we'll still accept your answer next week. ;)

(...)

The lesson from history is that execution performance is ALWAYS important.

Excuse my ignorance: but, asking very sincerely, who needs to sort 10,000+ emails in a single folder? Is this a realistic test? I don't want to flame to you... I really have never seen anyone with that amount of emails to sort (the largest amount is aprox. 200).

LaRoza
June 6th, 2008, 08:56 PM
You can pay dearly for that in terms of bug-reports, support costs, and a generally unfaviorable PR.



See http://www.tcl.tk/doc/scripting.html

He isn't saying rush it out, but deliver the product as fast as possible. The article clearly shows that the language choice matters.

(Python would be in the upper right, across from Perl in that diagram in the article. It is strongly typed)

Lster
June 6th, 2008, 09:02 PM
Execution speed certainly does matter. An example would be Banshee that seems slow to deal with the thousands of track of music I have. Exaile, on the other hand, seems faster.

LaRoza
June 6th, 2008, 09:04 PM
Execution speed certainly does matter. An example would be Banshee that seems slow to deal with the thousands of track of music I have. Exaile, on the other hand, seems faster.

That is possibly not an issue with the language. From what I recall from the forums (I don't use media players, except to watch/listen to individual tracks), the storage engine of them matters the most. As stated, the bottlenecks are read/write and database access.

This forum is written in PHP and uses MySQL, the slowness of it comes from network connections and database activity. The software would be "faster" if written in something else, but you'd never get a chance to notice because that is not what dictates its apparent speed.

Wybiral
June 6th, 2008, 09:08 PM
Execution speed certainly does matter. An example would be Banshee that seems slow to deal with the thousands of track of music I have. Exaile, on the other hand, seems faster.

That doesn't necessarily mean anything. If you write a quicksort in Python and a bubblesort in C, with a large enough set of data the Python implementation will be faster... Who knows if something similar is the case here.

It's only the situations where algorithmic solutions aren't an option, like imagine manipulation or really low-level number crunching. And even then, it's only those actual components (it wouldn't be much slower to call a C image manipulation function in Ruby than it would to call it form C, so when writing the user it doesn't matter, you can isolate the bottlenecks into small components like that).

So, I would like to correct that statement by saying "Execution speed certainly does matter... Occassionally... But less often than development speed"

Lster
June 6th, 2008, 09:14 PM
Yes. I was going to mention that.

My point wasn't high-level languages vs low-level or even high-perforance vs rapid-development languages. It was that execution speed, even for everyday applications, can be important.

It really depends what you are doing as to what is more important. I find the somewhat coefficient speed benefits of C to be extremely useful sometimes.

pmasiar
June 6th, 2008, 10:52 PM
My point wasn't high-level languages vs low-level or even high-perforance vs rapid-development languages. It was that execution speed, even for everyday applications, can be important.

Yes, but you argue to increase development speed for increase of execution speed. I prefer to focus on rapid development.

If I can focus my rapid development on 90% of the code which is not time-critical (which I always can, by measuring performance of rapid prototype), and limit slower high-performance development to 10% of the code where speed matters, my solution will be ready to market faster than yours, and if you want to match my speed, your solution will be less tested and more crappy.

pmasiar
June 6th, 2008, 11:07 PM
No -- any "speed of coding" and/or "lines of code" comparison between compiler-language-guy vs. script-language-guy is a waste of time because the compiler-guy will make use of a sophisticated macro system and advanced Compile-Time-Language (CTL) features so that his implementation of the project can be coded in essentially the same number of lines and take the same amount of time (and may even look exactly the same).

Well, but I can use general-use high-level language, instead highly customized macros. I can solve flexible tasks. Learning the whole system is simpler, I do not have custom layers of half-debugged logic, but standard widely-used language.

> In fact, in a sense, languages like Python are little more than glorified CTLs -- but, IMO, they throw away the best half of the tool.

you very obviously do not know any modern scripting language. There is big difference between plain macro expansion, and real high-level language, and you completely fail to see the difference.

> Well the trolling has lead us into an interesting side-channel, but let's get back to the OP's performance enquiries.

I object to your dismissing my comments as trolling. Do you accept my challenge? Talk is cheap - show me the code? Or you prefer to chicken out?

> Well, you can also note the time before the particular code runs and then subtract it from the time after it has run -- so the execution performance is always measurable.

But you need to profile which part of deep loops takes most time, where your optimization will have most effect.

> You can pay dearly for that in terms of bug-reports, support costs, and a generally unfaviorable PR.

You again pretend that high-level language will not give me any boost in productivity. If I can develop code 10 times faster, I have 11 months of debugging to your 2 months in a year-long project. And I have only 10% of lines of code to understand, test, and maintain. I could run circles around your code. :-)

> How willing are you to trade your broadband internet for dial-up access. Any takers here???? Huh? What do you mean it doesn't entice you?

LOL. you still pretend you do not understand, so you can weasel out from the challenge.

> The lesson from history is that execution performance is ALWAYS important.

No. this proves that newer hardware is faster. I am talking about speed of application development. And I am willing to give up 30% of CPU performance to gain 1000% gain in development productivity.

If your code spends 90% time waiting for response from database, improving your code has less effect that improving database schema (to respond faster to your queries), etc. If 10 of code will run 300% slower, total time increases 20%. And if you spend year to speed up that 10% of code 10 times, total time decreases of puny 9%.

I still fail to see how you can ignore that basic performance measurements. Maybe you do not want to understand? How many years you programmed for living in real-world? What kind of tasks did you solved? What was the biggest codebase you ever maintained (in millions lines of code)?

Lster
June 6th, 2008, 11:13 PM
Do you accept my challenge? Talk is cheap - show me the code? Or you prefer to chicken out?

Well, as I said above, I accept your challenge. If you would like to, that is. I would also not have time right now; but could do the challenge tomorrow.

Can+~
June 6th, 2008, 11:17 PM
Really, 90% of the things most people will code, have nothing to do with managing a huge amount of information, really. You'll probably have one function does that run X algorithm to solve that problem, and the rest of the code, is just how to get it, how to return it. Unless, you're developing new algorithms, or a library of them.

With this I go to say that, if you need one speedy algorithm, that hasn't been implemented already, then go do it in C, plug it in inside <insert high level language> and let the other language do the rest of the stuff, you don't even need a library, you could just leave it compiled and make the other application hand the arguments.

Why have to fight against stupid pointers when all you want to do is make a simple <insert GUI toolkit> interface for your algorithm?

Also, beginners trying to make projects on C is just wrong, you WILL have memory leakages, you'll malloc (or new in cpp) and later you'll forget to free it. Stack corruption, core dumps, Segmentation Fault, all those errors will cost debug time. Even if you have all the free time of the world, that time spent debugging, could've been implemented in creating a better interface, or something better, like learning something new. I saw another post with a guy implementing bubblesort on C++, when even C++ has a library with a sort function.

Even if you're an expert you'll have mistakes, as humans we make them frequently, C will produce a segmentation fault, C++ will probably tell you there's a mistake, but if you commit a huge one (like I did), you'll probably corrupt memory, array[-5] in C++ caused me to replace something on the stack and corrupted everything up. While python just says Out of Range, raise an error in the said line.

So, I'm calling to cut the crap. C is speedy, yes, we know it, thank you, but eventually, you'll want to save time on other things. Even better if you can mix the best of both worlds.

*edit* And, adding to my rant. why we have to deal with memory management? "I am manly, I do my own malloc and free my own memory like men". That should be the problem of the computer, as computers try to make our work easier, a simple garbage collector can save you a lot of time, and save you from dumb errors which will affect the end user.