Welcome Guest.   Make a donation to an author on the site November 28, 2014, 11:08:44 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 2 [3] 4 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: What's your Programming Language?  (Read 22023 times)
jgpaiva
Global Moderator
*****
Posts: 4,711



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #50 on: November 14, 2009, 10:34:13 AM »

My favorite programming language is Java.
Oh God why?  Grin

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 Wink
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.
Logged

Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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.
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
jgpaiva
Global Moderator
*****
Posts: 4,711



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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.
Logged

Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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.
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
jgpaiva
Global Moderator
*****
Posts: 4,711



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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?
Logged

Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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?
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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++
Logged
housetier
Charter Honorary Member
***
Posts: 1,321


see users location on a map View Profile Give some DonationCredits to this forum member
« 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...
Logged
Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« Reply #58 on: November 14, 2009, 04:31:58 PM »

I wonder if there actually is an example.
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
czb
Honorary Member
**
Posts: 335



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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 smiley
Logged

My open-source online piano game: http://musicope.com/
mouser
First Author
Administrator
*****
Posts: 33,705



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« 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.
Logged
jeremejazz
Supporting Member
**
Posts: 58


hey!

View Profile WWW Give some DonationCredits to this forum member
« Reply #61 on: November 15, 2009, 04:50:38 AM »

My favorite programming language is Java.
Oh God why?  Grin

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.org/wiki/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..

Logged

smiley I love coding
Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« Reply #62 on: November 15, 2009, 06:47:55 AM »

Where does Java provide more functionality? It doesn't even support pointers.
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
Ath
Supporting Member
**
Posts: 2,269



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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
Logged

Ath
Supporting Member
**
Posts: 2,269



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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.
Logged

Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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.)
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
Josh
Charter Honorary Member
***
Posts: 3,345



View Profile Give some DonationCredits to this forum member
« 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?
Logged

Strength in Knowledge
Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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

 embarassed
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
MilesAhead
Member
**
Posts: 5,055



View Profile WWW Give some DonationCredits to this forum member
« 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. smiley
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
jeremejazz
Supporting Member
**
Posts: 58


hey!

View Profile WWW Give some DonationCredits to this forum member
« 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...
Logged

smiley I love coding
jeremejazz
Supporting Member
**
Posts: 58


hey!

View Profile WWW Give some DonationCredits to this forum member
« 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
Logged

smiley I love coding
Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« 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...
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
jeremejazz
Supporting Member
**
Posts: 58


hey!

View Profile WWW Give some DonationCredits to this forum member
« Reply #72 on: November 17, 2009, 11:43:46 PM »

Still I prefer them hidden just like what James Gosling preferred...  Grin
you seem to be a C++ expert... can you give us an important use of pointers
Logged

smiley I love coding
MilesAhead
Member
**
Posts: 5,055



View Profile WWW Give some DonationCredits to this forum member
« Reply #73 on: November 18, 2009, 01:57:24 AM »

Still I prefer them hidden just like what James Gosling preferred...  Grin
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.
Logged

"It's only called research if you didn't find it the first time."
-- MilesAhead
Tuxman
Supporting Member
**
Posts: 1,498


OMG not him again!

View Profile WWW Give some DonationCredits to this forum member
« Reply #74 on: November 18, 2009, 09:10:27 AM »

James Gosling? That guy desecrated Emacs, so I basically like him.  tongue

"Hidden pointers" are no pointers.
Logged

I bet when Cheetahs race and one of them cheats, the other one goes "Man, you're such a Cheetah!" and they laugh & eat a zebra or whatever.
- @VeryGrumpyCat
Pages: Prev 1 2 [3] 4 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.047s | Server load: 0.12 ]