LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


View Poll Results: Which one do you choose and why?
C 19 32.20%
C++ 21 35.59%
C# 5 8.47%
Java 14 23.73%
Voters: 59. You may not vote on this poll

Reply
  Search this Thread
Old 03-28-2012, 12:57 PM   #16
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320

Quote:
Originally Posted by Z0K4 View Post
Cloud computing might be good for someone, but that is definitely not good enough for hardcore gamers, scientists, or
Wasn't the question about corporate software?

And yes, lot of corporate software does consist of rich Intranet or Internet (delivered via software-as-a-service) applications that are very Javascript-intensive.

EDIT: Here's Guido Van Rossum presenting on corporate software he wrote for and at Google:

http://googlecode.blogspot.ca/2008/0...-mondrian.html

Last edited by dugan; 03-28-2012 at 01:43 PM.
 
Old 03-29-2012, 08:44 AM   #17
Z0K4
Member
 
Registered: Sep 2011
Location: Split, Croatia
Distribution: Slackware, Fedora
Posts: 86

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by dugan View Post
...lot of corporate software does consist of rich Intranet or Internet (delivered via software-as-a-service) applications that are very Javascript-intensive.
o.O Really!? I didn't know that... But, still, I don't think that future of (majority) corporate software is cloud computing.
I still prefer languages that require compiling. But that is just me, and to each his own, wright?

Best regards!
 
Old 04-02-2012, 12:36 PM   #18
Medievalist
Member
 
Registered: Aug 2003
Distribution: Dead Rat
Posts: 191

Rep: Reputation: 56
Java, because it is corporate in nature

Java offers the promise of a language that makes it reasonably easy for recent college grads to write reasonably portable, reasonably secure, reasonably maintainable, reasonably useful programs. Although Java does not always deliver on that promise, this is not because of any shortcoming of the language, but rather because these goals are incompatible with many corporate programming environments, which are quite often soul-crushing and demotivational.

See the collected works of Scott Adams for more on this subject.

The absolute best corporate programs are written in C. The absolute worst are also written in C.
 
Old 04-02-2012, 06:51 PM   #19
skogsjanne
LQ Newbie
 
Registered: Feb 2010
Location: Norrköping, Sweden
Distribution: Debian
Posts: 9

Rep: Reputation: 1
In my little part of the world C is King and in my opinion the best C book is "The C programming language" by Kernighan & Ritchie. Short and sweet without unnecessary fluff.

Someone said C is not useful for large projects, guess what language is used for the Linux kernel.
But then, maybe that's not a large project. What do I know?
 
Old 04-03-2012, 04:21 PM   #20
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by skogsjanne View Post
Someone said C is not useful for large projects, guess what language is used for the Linux kernel.
But then, maybe that's not a large project.
1) Dedication, skill and stubbornness can compensate quite a lot for language deficiencies. Both the Linux kernel and GCC are projects that need C++ rather than C. But both were written in C rather than C++ for historical reasons and remain written in C, because one needs to have a nearly insane preference for C over C++ in order to be willing and able to make a significant contribution to one of those two projects and you need to make a significant contribution to have your opinion matter regarding the ongoing direction.

2) On the scale I had in mind (based on products I have worked on and am working on) the Linux kernel is at the very low end of what I was calling a "large" project.
 
Old 05-01-2012, 05:40 AM   #21
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
I work with C++ all day and I've come to the conclusion that C++ offers a much greater ability to write twisted, unreadable code than C. Also, C++ generally requires a much more detailed knowledge of the language to read and understand than C, even if the C++ code is well written. These are bad features.

Though of course C++ also has features that are better than C, like name mangling, which gives errors instead of allowing linking to the wrong function, and the name-space isolation.

So, I guess I should say my preference is to write "C with a C++ compiler".

Using C# would seem too much like kneeling to Microsoft's lust for control.

Last edited by KenJackson; 05-01-2012 at 05:41 AM.
 
1 members found this post helpful.
Old 05-16-2012, 05:35 AM   #22
nsk7even
LQ Newbie
 
Registered: Jun 2010
Distribution: Ubuntu MATE (Client) & Debian (Server)
Posts: 13

Rep: Reputation: 4
I learned C# at work and am still impressed of the pro's:
- Fast to develop because of endless examples free code and a (mostly) very good help (the last is one of the most plus points for Microsoft)
- Additional similarities due to the underlying .NET framework to VB.net of which you also find lots of stuff, tips and examples in the web
- Really fast execution of your logic once it is loaded even in heavy (e. g. statistics) duties, consuming and combining data, coming from many servers
- Well documented and mighty APIs if it comes to interfacing MS applications
- Integrated setup project type
- Possibility to create native Windows services and GUI applications deriving from the same program logic
- Possibility to run on Linux/MAC as well (Mono), though there are some restrictions

Downsides:
- Your binaries can be read out as long as they are not obfuscated
- You need to have Windows.... at least in my environment it would be no option to start "experimenting" with Mono or Wine
- Omnipresent trouble with Microsoft typical problems like e. g. Visual Studio hangs, freezes, does different things prior to restarting it, confused UI and horrible ergonomics, help sometimes not working and throwing ridiculous errors on me
 
Old 05-17-2012, 08:46 AM   #23
Benny7440
Member
 
Registered: Jul 2009
Location: Puerto Rico
Distribution: Puppy Linux 528
Posts: 222

Rep: Reputation: 19
I choose c because it was an all-level programming language in the sense that it was basic & old. What I want to mean by the previous statement is that it goes to the root of programming capabilities within the platform of choice.
 
Old 06-11-2012, 05:21 AM   #24
Shahbaz Youssefi
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Rep: Reputation: Disabled
I choose C because:

- It is consistent (although not perfectly)
- It is fast
- Its compilers are fast
- Code written in C looks very clean and short. Errors produced by compiler are also more readable
- It is simple and strong

Why I don't use the others:

C++:

C++ is not that bad, but I prefer C over it. It certainly would have been nice to have "structs with functions" in C, but C++ is much more than that:

- It has a lot of features, which is good by itself, but they are terribly designed. It is full of exceptions and inconsistencies. In other words, the features are not orthogonal.
- Has brought things that later turned out to be bad, such as exceptions
- The compiler errors, especially when involving templates are at least 300 characters long, giving information that are most of the times useless (specifically with STL)

Java:

Java has taken C++, removed its C parts as well as some of its best features such operator overloading and overall produced the worst language in the world. It is full of exceptions and ideas that are just terrible

- Inconsistency in resource management: Memory is automatic but file is not
- Useless destructors: The object may be deleted (gc'ed) after the program has ended, so the destructors are just disregarded!
- Function calls are done with string matching at run time -> if you use longer names in your program, it will run more slowly!!
- Its idea was to have completely portable software, which doesn't even make sense. For example, you can't write code that sends an SMS in your phone and run it on your PC. If not using system specific tasks, C is as portable as Java, if not more. If using system specific tasks, Java is as un-portable as C, if not more.
- And many MANY more

C#:

I don't know C#, but it seems like it's Java rewritten

Last edited by Shahbaz Youssefi; 06-11-2012 at 05:24 AM.
 
1 members found this post helpful.
Old 06-11-2012, 06:20 AM   #25
Z0K4
Member
 
Registered: Sep 2011
Location: Split, Croatia
Distribution: Slackware, Fedora
Posts: 86

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by Shahbaz Youssefi View Post
I don't know C#, but it seems like it's Java rewritten
Yeah... they only differ in syntax.

Thank you for your opinion! I've already started with C++, and I believe I'll stick with it.

Best regards Shahbaz!
 
Old 06-11-2012, 09:18 AM   #26
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by Shahbaz Youssefi View Post
- Function calls are done with string matching at run time -> if you use longer names in your program, it will run more slowly!!
For Java? This can't be right.

Can you please post a source for this information?
 
2 members found this post helpful.
Old 06-28-2012, 02:57 AM   #27
Shahbaz Youssefi
LQ Newbie
 
Registered: Apr 2012
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
For Java? This can't be right.

Can you please post a source for this information?
I remember this from my university course. Reflection uses this for sure. Perhaps inside one class this is not true, but between classes it is. In fact, the string matching is done on first use and then cached (even though still looking up in the cache has one string traversal).

It is inevitable in Java if you think about it. You don't have static linking and dynamic linking is done on the fly (not once in the beginning).
 
Old 07-02-2012, 01:26 AM   #28
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Shabbaz, what you think you learned in university is wrong. Compiled languages never resolve method calls via character-by-character string-matching at runtime. Not within classes, not between classes, and not during dynamic linking.

The high-level view of what really happens is that, at compile time, the method definitions are translated into the memory locations where their sections of executable code begin. Resolving references to those memory locations (e.g. method names in method calls) is always done using table lookups. Java is not an exception, and I just confirmed that by checking what the JVM specs say about Invoking Methods.

Quote:
Reflection uses this for sure.
Perhaps, but you were not talking about the special case of reflection.

Last edited by dugan; 07-02-2012 at 02:28 PM.
 
Old 07-03-2012, 02:36 AM   #29
GreggT
Member
 
Registered: Jan 2012
Distribution: Debian, CentOS, Fedora, TinyCore
Posts: 45

Rep: Reputation: Disabled
Quote:
Originally Posted by Z0K4 View Post
Well... JS is client side scripting language. I think that server side languages are more important (php, asp), but that is just my opinion. Cloud computing might be good for someone, but that is definitely not good enough for hardcore gamers, scientists, or any other users that want or need maximum PC performance. If you want max performance you need good hardware, and even better software (drivers), and that is where C/C++ overruns every other language out there.

Thank you for your reply!
BTW... I also like JavaScript (but not as much as C or C++, even though I'm still beginner)!

Cheers!
Java script isn't all client side anymore, Node.js changed that greatly.

C & C++ I think mostly C++ are/is used for all around things, C++ is starting to become more popular for web server side it seems, but there have been many failures (not because they're bad, just because unpopular) to that field while PHP continues to be the king

The only big edge java has over others is how cross platform and nicely it does integrate, without requiring libraries to be included etc.. with a lot of games & web games being made with it for handheld devices even.

I greatly dislike java though, and the way it is going I would never bother learning it... it really wasn't that slow and now it seems to be getting slower which is a shame because it beat c++ in some places

Last edited by GreggT; 07-03-2012 at 02:39 AM.
 
Old 07-03-2012, 09:18 AM   #30
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by dugan View Post
Compiled languages never resolve method calls via character-by-character string-matching at runtime. Not within classes, not between classes, and not during dynamic linking.
Actually methods are resolved by string matching during dynamic linking:

C:
Quote:
void *dlsym(void *handle, const char *symbol);
...
The function dlsym() takes a "handle" of a dynamic library returned by dlopen() and the null-terminated symbol name, returning the address where that symbol is loaded into memory.
JVM:
Quote:
5.4.3. Resolution

The Java virtual machine instructions anewarray, checkcast, getfield, getstatic, instanceof, invokedynamic, invokeinterface, invokespecial, invokestatic, invokevirtual, ldc, ldc_w, multianewarray, new, putfield, and putstatic make symbolic references to the runtime constant pool. Execution of any of these instructions requires resolution of its symbolic reference.
...
5.4.3.3. Method Resolution
When resolving a method reference:
...
Method resolution attempts to look up the referenced method in C and its superclasses:

If C declares exactly one method with the name specified by the method reference, and the declaration is a signature polymorphic method (§2.9), then method lookup succeeds. All the class names mentioned in the descriptor are resolved (§5.4.3.1).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Java Woes: A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available ... chytraeus Slackware 10 11-27-2010 10:04 AM
IN JAVA, how to do a multi chat client in java with the option of private message ? nicolasd Programming 5 09-16-2009 08:53 PM
LXer: Java news met with cautious optimism in free Java community LXer Syndicated Linux News 0 11-14-2006 10:21 PM
Firefox refuses to load Java jnlp files - plugin and java ok Melsync Linux - Software 1 06-25-2006 04:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration