Free Republic
Browse · Search
General/Chat
Topics · Post Article

Skip to comments.

Software Developers: C++, Java, Python, or C# for my desktop application? (VANITY)
Various ^ | 7/6/2009 | Me

Posted on 07/06/2009 12:40:46 PM PDT by ROTB

I'm writing a desktop application that I'd like to deploy onto Windows, Macintosh, and Linux. I'm trying to pick the language that will give me the most conveniences, without setting timebombs that will go off down the road.

Here's what I think I know so far:

C++ Pros:

1) resulting code runs fastest, provided I am not a bonehead

2) most flexibility in memory management

3) Maximum difficulty in reverse engineering my object code, though there is nothing revolutionary or complex in what I plan to write.

4) Tools are rock-solid.

C++ Cons:

1) memory management is the biggest hassle, though garbage collection, usage of stack, pools, and smart-pointers, can mitigate this. 2) cross-platform programming requires much work for me to manage

Java Pros:

1) Cross platform programming handled

2) Memory management easier relative to C++

3) Lots of Tools, fairly mature

4) many years of advancements over C++

5) "Hot-Spot" compilation can make code run nearly as fast as C++

Java Cons:

1) 10 Megs of runtime need to be packed up with my app, since users might not be technical enough to install a JRE on their own

2) Code is more easily reverse engineered than C++, but how good are the obfuscators?

C# Pros:

1) Through Mono, I can deploy in lots of places

2) I get to use Developer Studio initially, and then use less capable IDE's for porting

3) Handles garbage collection, and does more for the programmer than C++.

4) Lots of libraries.

C# Cons:

1) I might have issues with Mono working exactly like Microsoft's runtime.

2) What did I forget?

C# Questions:

1) Does it compile to machine code, or bytecode? If bytecode, does that compile to machine code?

Python Pros:

1) Clean expressive syntax

2) Cross platform programming handled

3) Memory management easier relative to C++

4) many years of advancements over C++

5) More rapid iteration, since the projects needs not be compiled.

Python Cons:

1) Bytecode can be reverse engineered, but "Shed-Skin" would make the resulting code as fast and as difficult to reverse engineer as C++, BUT "Shed-Skin" is a work in progress, and if the lead-programmer dies, I would have to pick up the slack. I might also need to find bugs myself.


TOPICS: Computers/Internet; Focus Software; Hobbies; Science
KEYWORDS: computers; languages; networking; software
Navigation: use the links below to view more comments.
first previous 1-2021-4041-6061-8081-89 next last
To: bvw

I like the golf club analogy, each language and tool is like a golf club, you don’t use the same one for everything, and it’s good to know when and how to use all of them.


61 posted on 07/07/2009 11:50:29 AM PDT by dfwgator
[ Post Reply | Private Reply | To 60 | View Replies]

To: TChris

I can do the “Well, Sonny...” thing but I actually like working in the high level languages. Sure, I think my previous low-level work gave me some valuable experience, but it’s not something I’d want to do day-to-day anymore. They call it the Stone Age for a reason: we have better tools now. However, stone is often still useful.


62 posted on 07/07/2009 11:52:12 AM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 54 | View Replies]

To: ROTB

C#

Because C# is my hammer.

All the world looks like a nail.


63 posted on 07/07/2009 11:55:48 AM PDT by Lazamataz (Too sick for words!)
[ Post Reply | Private Reply | To 1 | View Replies]

To: dfwgator

I’d guess a pro golfer with one 7 iron can beat nearly all regular golfers with a full set of the best clubs.


64 posted on 07/07/2009 11:56:01 AM PDT by bvw
[ Post Reply | Private Reply | To 61 | View Replies]

To: bvw

Of course the one thing most people don’t consider is maintainability, which means not only how readable the code is, but how easy it is to find people who know how to maintain the code. That’s why Java/C# are the winners, over languages that while better, don’t have nearly as many people who know it. All Java and C# has to be is “good enough.”


65 posted on 07/07/2009 11:58:41 AM PDT by dfwgator
[ Post Reply | Private Reply | To 64 | View Replies]

To: dfwgator
If all of our servers were Microsoft we would be .NET, but if you have a bunch of legacy systems running on different platforms and OS’s then Java is the only thing that makes sense.

Having never programmed .NET, I am pretty ignorant on the subject. But, what little I have read leads me to think it's something along the lines of what Borland did with its VCL a LOOOOooong time ago: an easier-to-use set of libraries, objects, etc. which make Windows programming faster, safer and more reliable than coding straight in the API. The VCL could be deployed as run-time BPLs (Borland's DLLs) or linked in for a single-file executable.

Of course, the VCL is not as multi-lingual as .NET appears to be, so there are certainly differences. But isn't that basically what .NET does: provide a framework and huge library to simplify Windows programming?

Am I completely off base?

66 posted on 07/07/2009 12:00:48 PM PDT by TChris (There is no freedom without the possibility of failure.)
[ Post Reply | Private Reply | To 58 | View Replies]

To: dfwgator

Maintainability is bunkum. IMO. Yes, I am a friggin code purist, and write my code to be maintainable most of the time, yet I know my own sins, and that is one.

Far better code be totally unreadable! Then folks would push the information about what the code is supposed to do — the specification — to the outside.

Yet in development you have to read your own stuff. and so you have to use structure and good style. Still. Trillions has been wasted in trying to get old code to do new tricks, and in trying to dope out functional specification from massive programs because that’s the only place it exists. Or worse — trillions wasted in having no specification except that of the code, because management believes code source is readable. It creates fear of “reinventing the wheel”. Bunk!

Reinvent the wheel every time! That is evolution.

How would the world save trillions in software development? By requiring that every source deliverable be obfuscated, if there was any source deliverable at all. That way no one would ever think, ever for one second consider, re-engineering old code.

I’m not against code hornbooks — examples of code. That’s fine. But that’s the limit of readable source code, or should be, imo.

Write-once programming is salvation! That’s like why as humans, we only get one life. No redos. Thus we have to take it seriously.


67 posted on 07/07/2009 12:18:25 PM PDT by bvw
[ Post Reply | Private Reply | To 65 | View Replies]

To: TChris
. But isn't that basically what .NET does: provide a framework and huge library to simplify Windows programming?

It can be used that way. Some of .NET is a wrapper around the old Windows libraries, especially if you're using Windows Forms and other underlying standard APIs. Microsoft also suggests programming in .NET instead of the old ways like MFC.

But .NET is technically platform agnostic. Others have written the framework for other operating systems, allowing .NET apps to run on them. In this way it's like Java.

68 posted on 07/07/2009 1:03:31 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 66 | View Replies]

To: antiRepublicrat
What will the result be? An int? A byte? A float?

Python can tell you

>>> a = 20
>>> b = 1
>>> c = a + b
>>> type(c)
<type 'int'>

Python doesn't care, it's all an int, or a float if there's a decimal point.

No decimal point required:

>>> a = float(2)
>>> type(a)
<type 'float'>
>>> print a
2.0

This looseness is also what I hate about Visual Basic and most other scriptable languages. Sure it lets you prototype faster, but there's a lot more to programming than the prototype. This is my main complaint in my recent foray into Objective C. I like the strong, static, safe, nominal typing of c#. But then I'm a control freak when it comes to programming.

But you're okay with this behavior?

main() {
	char a[] = "When in the Course of human events "
		"it becomes necessary for one people to "
		"dissolve the political bands which have "
		"connected them with another";
	char b, *c;
	b = 'a';
	c = a + b;
	printf("%s\n", c);
}

# gcc test.c
# ./a.out
bands which have connected them with another

69 posted on 07/07/2009 3:32:44 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 59 | View Replies]

To: antiRepublicrat
I like the strong, static, safe, nominal typing of c#.

Just so you know, C# has duck typing.

70 posted on 07/07/2009 3:42:22 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 59 | View Replies]

To: Mr. K

Bite me


71 posted on 07/07/2009 4:04:58 PM PDT by Mr. K (THIS ADMMINSTATION IS WEARING OUT MY CAPLOCK KEY DAMMIT DAMMIT DAMMIT!!!!!)
[ Post Reply | Private Reply | To 3 | View Replies]

To: dan1123
No decimal point required:

I figured being dynamic Python would automatically assign it as a float with a decimal.

But you're okay with this behavior?

I don't much like C. There's a reason why they have an obfuscated C competition -- the language lends itself well to that.

72 posted on 07/07/2009 4:06:13 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 69 | View Replies]

To: dan1123
Just so you know, C# has duck typing.

In what way? Must be a feature I've never used. It does do automatic casting in many cases, but that's about all I've seen.

73 posted on 07/07/2009 4:08:01 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 70 | View Replies]

To: the_Watchman

I thought it was a little overly broad to ask which computer software language was best, as a topic for discussion in a FR post

It’s like posting a question to all of us like “which of our children is prettiest” (hint: mine are)


74 posted on 07/07/2009 4:08:16 PM PDT by Mr. K (THIS ADMMINSTATION IS WEARING OUT MY CAPLOCK KEY DAMMIT DAMMIT DAMMIT!!!!!)
[ Post Reply | Private Reply | To 11 | View Replies]

To: antiRepublicrat

75 posted on 07/07/2009 4:17:45 PM PDT by Mr. K (THIS ADMMINSTATION IS WEARING OUT MY CAPLOCK KEY DAMMIT DAMMIT DAMMIT!!!!!)
[ Post Reply | Private Reply | To 44 | View Replies]

To: antiRepublicrat
In what way? Must be a feature I've never used. It does do automatic casting in many cases, but that's about all I've seen.

You can use var instead of a type and the compiler will infer the type (aka duck typing).

In looking up var, I found C#'s version of dynamic typing, which is a type itself (I think it's roughly equivalent to C's void*).

76 posted on 07/07/2009 4:41:24 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 73 | View Replies]

To: dan1123
You can use var instead of a type and the compiler will infer the type (aka duck typing).

I see, new for version 3.0. I wonder why they put it there. The example is bad IMHO, because you should know the types you're getting from the database. There goes Microsoft, always wanting to add more features, screwing things up in the process.

77 posted on 07/07/2009 4:52:52 PM PDT by antiRepublicrat
[ Post Reply | Private Reply | To 76 | View Replies]

To: antiRepublicrat
I don't much like C. There's a reason why they have an obfuscated C competition -- the language lends itself well to that.

That's precisely the reason I prefer Python. Its syntax encourages proper formatting, and the philosophy of there only being one way to do things makes for much better readability.

I would still like a statically typed Python though.

78 posted on 07/07/2009 4:52:57 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 72 | View Replies]

To: antiRepublicrat
There goes Microsoft, always wanting to add more features, screwing things up in the process.

I was trying to think of a good use of that in a statically typed language, but everything I thought of had pitfalls and better solutions through inheritance, generics/templates, or other type-safe methods.

79 posted on 07/07/2009 5:08:13 PM PDT by dan1123 (Liberals sell it as "speech which is hateful" but it's really "speech I hate".)
[ Post Reply | Private Reply | To 77 | View Replies]

To: dan1123; All

First of all, thank you all for your comments. They are much appreciated.

To clarify: I need to pick the language that provides firstly maximum protection from reverse-engineering and maximum speed via compilation to native code, and secondly the most amount of power per statement (machine language would be worst). Thirdly, I would like to minimize the risks inherent in using something not widely tested, like say using a library used in 3 products. I will deploy to the desktop, and won’t be doing anything graphic intensive.

Short version: C# doesn’t compile to native, Java can with GCJ and a $3185 tool from excelsior-usa, Python can compile to C++ with Mark Dufour’s “Shed-Skin” tool, and C++ with QT or GTK or APR (Apache Portable Runtime) might be the ticket.

1) Java is a possibility since the few conditions which cause memory leaks can be worked around in testing, and the code can’t be EASILY reverse engineered if I either use the native compiler made by excelsior-usa ($3185 for Windows and Linux, which excludes Mac OSX), or GNU GCJ. Main risks outside of myself (ahem) are thus either GNU GCJ or the programmers at excelsior-usa working as advertised.

2) Though C# is Microsoft’s attempt at improving on Java, and I love Developer Studio, I can’t find a native compiler for it at all. C# is out.

3) Python is according to many, including Eric Raymond, an exceedingly powerful wonderful language. With Shed-Skin, I can expect roughly C++ levels of speed and resistance to reverse-engineering. I’ll probably have to help write the project though, since only one man is implementing Shed-Skin. If he were to move on, I’d be screwed if I didn’t pick up the reins and continue it myself.

4) C++ with GTK. I can work around the hazards of C++.

5) C++ with QT. Ditto, and I can get commercial support for QT.

6) C++ with APR, and I can get Apache’s support for the Apache portable runtime.

Did I forget anything? Did I mis-analyze anything? Again, thank you all for your time and energy.


80 posted on 07/07/2009 8:26:09 PM PDT by ROTB (Thou shalt not covet ... ANYTHING!)
[ Post Reply | Private Reply | To 79 | View Replies]


Navigation: use the links below to view more comments.
first previous 1-2021-4041-6061-8081-89 next last

Disclaimer: Opinions posted on Free Republic are those of the individual posters and do not necessarily represent the opinion of Free Republic or its management. All materials posted herein are protected by copyright law and the exemption for fair use of copyrighted works.

Free Republic
Browse · Search
General/Chat
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson