Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 04, 2015, 10:45:48 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: What's your Programming Language?  (Read 24009 times)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: What's your Programming Language?
« Reply #50 on: November 14, 2009, 10:34:13 AM »
My favorite programming language is Java.
Oh God why?  ;D

It's a bit like C/C++ in many ways.
... except that you can write efficient and fast code in C++.
You'd be surprised how having one thread dedicated to code optimization (speculative execution, caching of frequent objects and stuff like that) can help the performance of your code ;)
During a project for university, a friend of mine has tested C vs Java for dynamic function calls, memory allocation (and access) and native function calls. C only got the best results for native function calls.
I'm not a hardcore fan of Java, but I've been using C++ for work for the last year and a half, and I have already regretted quite a few times not having selected Java for the project.

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #51 on: November 14, 2009, 11:51:02 AM »
Java might have a garbage collector, but its major disadvantage is that you just can't collect garbage yourself, so it tends to memory hogs of a quite notable amount.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: What's your Programming Language?
« Reply #52 on: November 14, 2009, 12:51:49 PM »
Java might have a garbage collector, but its major disadvantage is that you just can't collect garbage yourself, so it tends to memory hogs of a quite notable amount.
That does not mean that you can't write "efficient and fast code" in Java, it just means that it may use more memory. On the other hand, the JVM can do stuff like copy-on-write, which may even cause a lower memory usage than a C++ program.

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #53 on: November 14, 2009, 12:54:11 PM »
it just means that it may use more memory
That's what I call inefficient.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: What's your Programming Language?
« Reply #54 on: November 14, 2009, 03:54:12 PM »
it just means that it may use more memory
That's what I call inefficient.
Hmm, since Java *may* use less memory than C++, and *may* run faster than C++, does that mean C++ is also an inefficient and slow language?
Or better yet, as Assembly is always faster and uses less memory than both C++ or Java, does it make both languages inefficient and slow?

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #55 on: November 14, 2009, 03:58:33 PM »
Hmm, since Java *may* use less memory than C++
... if you don't count the VM ...

, and *may* run faster than C++
... once the VM has started ...

See?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: What's your Programming Language?
« Reply #56 on: November 14, 2009, 04:02:38 PM »
jgp, there are a lot of nice things you can say about Java, but i'd love to see an example where this is true:
Quote
since Java *may* use less memory than C++, and *may* run faster than C++

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #57 on: November 14, 2009, 04:30:36 PM »
And then someone comes up with an example that proves the opposite, thereby showing how "pointful" programming language warscomparisons are...

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #58 on: November 14, 2009, 04:31:58 PM »
I wonder if there actually is an example.

czb

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 336
    • View Profile
    • My open-source online piano game
    • Donate to Member
Re: What's your Programming Language?
« Reply #59 on: November 15, 2009, 02:43:49 AM »
Is it that important if the program takes more or less memory? Or if it is a few percent faster or slower? Of course there are fields where this matters (scientific research and even there, they use Matlab, Python, OCaml etc. even though they are slower -> why?) but for a daily code, I do not think it really matters.

My primary decision point is how easy is to code and how I enjoy it (first order functions, pattern matching...). How the language helps you to parallelize the code, how to protect your code against bugs (units of measure, strong typing, immutability...), how to easily extend the language, how to debug (immediate scripting) it etc. And I really do not enjoy to code in C++. Java is better / simpler and and any modern functional language like F# or Scala goes even further.

PS: I do not say that C++ does not have its place but I do not understand why everybody uses it just to gain a little in memory and speed. I wonder why you do not code in assembler to gain even more speed :)
My open-source online piano game: https://github.com/musicope/game

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 35,013
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: What's your Programming Language?
« Reply #60 on: November 15, 2009, 03:00:09 AM »
I agree with you czb, for most things, the difference in speed and memory is not important.

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Jereme's Pinboard
    • Donate to Member
Re: What's your Programming Language?
« Reply #61 on: November 15, 2009, 04:50:38 AM »
My favorite programming language is Java.
Oh God why?  ;D

It's a bit like C/C++ in many ways.
... except that you can write efficient and fast code in C++.

I'm curious about delphi... is it also an open source language?
Not actually. http://en.wikipedia....i/Embarcadero_Delphi

what's the difference with a scripting language and a programming language?
Scripting languages are usually made for a certain purpose.
Tuxman, Do you consider speed more important than functionality? C++ may be fast, but how functional enough is it?

JAVA may be slow but Sun is currently trying to develop a faster compiler for JAVA and the results are being seen through their updates..

:) I love coding

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #62 on: November 15, 2009, 06:47:55 AM »
Where does Java provide more functionality? It doesn't even support pointers.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #63 on: November 15, 2009, 08:18:47 AM »
Hm, the whole programming language discussion is, as always, very interesting, but imho it boils down to the simple paradigm: "Crap in, Crap out".
If one is trying to write a C style program in Java, or a huge project in i386 assembly, you should really not be surprised the end-result is not what you had hoped for.
The managed environments like the JVM and .NET advertise that they will cleanup after you leave an object-scope, but it sure makes a lot of difference in what state you leave your 'trash' behind. Setting objects to null when no longer needed in your Java or C# programs is just as effective as freeing allocated memory in your C programs, regarding the memory use.

Not every programming language is fit for every job, even if some are fit for more jobs than others. I wouldn't be writing a device driver in Java any day soon, but I would not even consider writing a GUI app in assembly language, or C (the closest thing to assembly language, imo).

For every project, there should be a clear and motivated choice for the language and libraries/frameworks used, and not try to 'fix' things later by adding other languages/libraries if the first choice happens to be 'sub-optimal'. In that case: Redo from start.

/Ath

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #64 on: November 15, 2009, 08:21:06 AM »
Where does Java provide more functionality? It doesn't even support pointers.
It does, it only hides them from us, mere programmers.

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #65 on: November 15, 2009, 08:23:56 AM »
There is no way to explicitly declare pointers. In Java, everything is sort of a reference. (AFAIK.)

Josh

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Points: -25
  • Posts: 3,368
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #66 on: November 15, 2009, 08:33:30 AM »
Tux: I have to ask, you have been quite vocal about your preferences of what is/isn't a programming language and the particulars of each. Do you have any examples of your work? Perhaps a sample application you can show?

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #67 on: November 15, 2009, 08:43:20 AM »
Well, I'm not that professional ...

Two of the various projects I'm regularly working on:
1) Gamers.IRC, written in a scripting language
2) eMule beba, written in a programming language

 :-[

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 6,202
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: What's your Programming Language?
« Reply #68 on: November 15, 2009, 01:14:26 PM »
On the idea of different languages being suited for different tasks, that was the appeal that got me into COM.  Then the .NET promised mixing and matching to do different parts of a task in the suitable language.  Now we also have to contend with 32 bit vs. 64 bit loadable libraries or assemblies or in process servers or whatever.

Maybe what we need is JITE instead of JIT?  Just In Time Encrypted compiler.  That way you can distribute the code as compilable source without "giving it away."  The host machine knows if it is 32 bit or 64 bit and a bunch of other things about itself.  It should compile the loadable libraries and the main executables with the same Bitness and calling conventions.  No more thunks.  The program and associated libraries could be "compiled" as part of the install process.  I dunno', I'm not that far into my coffee yet so strange ideas are to be expected. :)

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Jereme's Pinboard
    • Donate to Member
Re: What's your Programming Language?
« Reply #69 on: November 17, 2009, 09:48:27 AM »
Where does Java provide more functionality? It doesn't even support pointers.

Because pointers were found to be confusing and usually leads to computer crash if misused... why point something(like a variable) if you could use them directly...
:) I love coding

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Jereme's Pinboard
    • Donate to Member
Re: What's your Programming Language?
« Reply #70 on: November 17, 2009, 09:52:17 AM »
Java might have a garbage collector, but its major disadvantage is that you just can't collect garbage yourself, so it tends to memory hogs of a quite notable amount.
It seems that you are talking about destructors... well, JAVA uses the finalize() method which is similar to that
:) I love coding

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #71 on: November 17, 2009, 10:02:05 AM »
Because pointers were found to be confusing and usually leads to computer crash if misused...
Have you ever worked with them? Maybe they are confusing, but very useful at times.

It seems that you are talking about destructors...
Not necessarily, delete works anywhere...

jeremejazz

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 58
  • hey!
    • View Profile
    • Jereme's Pinboard
    • Donate to Member
Re: What's your Programming Language?
« Reply #72 on: November 17, 2009, 11:43:46 PM »
Still I prefer them hidden just like what James Gosling preferred...  ;D
you seem to be a C++ expert... can you give us an important use of pointers
:) I love coding

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 6,202
    • View Profile
    • Miles Ahead Software
    • Donate to Member
Re: What's your Programming Language?
« Reply #73 on: November 18, 2009, 01:57:24 AM »
Still I prefer them hidden just like what James Gosling preferred...  ;D
you seem to be a C++ expert... can you give us an important use of pointers

One use would be implementing the language with the hidden pointers. In the beginning many of the OOP languages were just front ends that spit out C source code since C compilers were most likely to exist for the target platform.

The C++ virtual functions themselves are just a jump table of function pointers with some type checking.  And of course COM takes that to another level.

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,566
    • View Profile
    • Donate to Member
Re: What's your Programming Language?
« Reply #74 on: November 18, 2009, 09:10:27 AM »
James Gosling? That guy desecrated Emacs, so I basically like him.  :P

"Hidden pointers" are no pointers.