Python vs C# (Discussion)

Status
Not open for further replies.
I use HtmlUnit since it almost complete headless browser implementation with JS interpreter. However, when sh*t hits the fan, Selenium or raw sockets complete the voyage.
NetBeans is good GUI: try to focus more on JavaFX since Swing is a bit obsolete and can scare new people off.

If you still want to use Python, it is trivial to add Jython (Python in Java) to your Java project and make some things more simple...however, once you know Java well,
it shouldn't be too difficult to use it, as it is.

Friend, do you use HtmlUnit for automation or have any better/other suggestion? (I am starting off with Java SE ~ netbeans)
 
I use HtmlUnit since it almost complete headless browser implementation with JS interpreter. However, when sh*t hits the fan, Selenium or raw sockets complete the voyage.
NetBeans is good GUI: try to focus more on JavaFX since Swing is a bit obsolete and can scare new people off.

If you still want to use Python, it is trivial to add Jython (Python in Java) to your Java project and make some things more simple...however, once you know Java well,
it shouldn't be too difficult to use it, as it is.

Thanks, I am unable to find any download option for JavaFX at this link netbeans,org/downloads/index.html (replace comma with dot please)
Secondly, is JavaFX the most comprehensive IDE for developing almost anything in Java? If not, then which one do you suggest?

edit: I found this link: (is it correct, kindly guide)
oracle,com/technetwork/java/javase/downloads/jdk-7-netbeans-download-432126.html
 
Last edited:
I've used htmlunit before too, found it great to work with, however it took some time to setup. Not sure if stuff has changed since then, but it was waaaay to verbose for me (as I think its general purpose is unit-testing rather than web automation). Remember having to write a custom class just to shut it up lol.

Also in regards to the obfuscation/decompilation topic going on here: if you wanna keep your code secret, don't run it on other people's machines. Just my two p.
 
I've used htmlunit before too, found it great to work with, however it took some time to setup. Not sure if stuff has changed since then, but it was waaaay to verbose for me (as I think its general purpose is unit-testing rather than web automation). Remember having to write a custom class just to shut it up lol.

Also in regards to the obfuscation/decompilation topic going on here: if you wanna keep your code secret, don't run it on other people's machines. Just my two p.

You mean that we shall not run our application on others machine or we shall not compile code on others machine?
Does, Java has better obfuscation than c# and Python or its like them as well!
 
@ClosedCaption:
If you were directing me towards JDK 7 (JavaFX), then I have downloaded it now and running.
Any other guidance will be much appreciated :)
Specially regarding web automation.
 
It is worth noting that your anti-reversing efforts more or less simply define the type of people who will end up taking your code apart rather than preventing it from happening completley. Reversing from machine code is not impossible as some would leave you to believe, especially when you are looking for a functional description rather than source that can be put back through a compiler.

Exactly! The big advantage of native code is it prevents IP theft. It 's one thing for a competitor to go through the full dev process and another to start with a 90% functional code :)
 
LMAO I would discuss with you but after what you said I dont think it will worth the time, nevertheless good lucky wasting your time.

Imagine that :D If you ever learn the basics of .net reversing come back and read the thread.
 
You mean that we shall not run our application on others machine or we shall not compile code on others machine?
Does, Java has better obfuscation than c# and Python or its like them as well!

It's just like I wrote, if you got pieces of code that you'd like to keep away from the user, then keep them away from the user. Run that code serverside. That's the only way to ensure complete control of your code...

Java/C#/Python can all be reverse engineered, decompiled, deobfuscated, etc. Download JD-GUI, open your Java jar with it and there you have it, all your classes, etc are visible to the world. You can use something like ProGuard to obfuscate your bytecode. Can you prevent someone getting a hold of your original Java source code? Maybe... Can you prevent someone from cracking your program (in C#/Java/Python/whatever)? Most probably not.
 
Last edited:
JavaFX comes with JDK. Follow this and you will be golden:

http://docs.oracle.com/javafx/scenebuilder/1/installation/jsbpub-installation.htm

Thanks, I am unable to find any download option for JavaFX at this link netbeans,org/downloads/index.html (replace comma with dot please)
Secondly, is JavaFX the most comprehensive IDE for developing almost anything in Java? If not, then which one do you suggest?

edit: I found this link: (is it correct, kindly guide)
 
You mean that we shall not run our application on others machine or we shall not compile code on others machine?
Does, Java has better obfuscation than c# and Python or its like them as well!

No it doesnt, and there are plenty of java decompilers out there as well.

In regards HtmlUnit I used it on lots of things when using java, however, there are plenty of sites out there it won't be able to render so for those sites I just jump in to selenium.

I always evaluate the ajax requests, and other things the site does before deciding because most of the times the ajax is so basic that you can reuse it directly as a call instead of having ot use HtmlUnit or related solutions to render it.
 
Last edited:
It's been said in here before, but Python is a scripting language. It CAN however be compiled to an executable using Py2EXE or whatever. As far as form development goes, check out QT or wxWidgets. There is loads of documentation on both of them and dedicated channels for them on freenode.

Python is fast, has a huuuuuge community, and tons of third party libraries. It can also be run on any platform, so you can toss it up on a server or run it on your local machine(it's also really great for writing webapps in - see django).
 
QT is not free I tihnk? True?
 
It is also worth noting that the speed hit you take for runtime polymorphism with an interpreted language like Python is a non-issue for most of the stuff you guys are doing, where the majority of the application's time is spent in dependent wait states (network i/o, file i/o). Java certianly wont give you a speed increase if that is where your bottleneck is.

Long story short I wouldn't discount either language on speed grounds until you have tried implemented it and know for a fact that that you are limited by your language choice and not some external factor.
 
I agree with several points here, especially the performance factor and I'm really a bit of a nut in this regard not to mention it might make a HUGE difference in terms of implementation costs if you have some "automation" that needs large scaling... Or in other words buying shitty vps has a cost, buying super dedi's to spend most cpu cycles to deal with the overhead of runtimes, try-catch constructs and what s0ap correctly stated totally another at deploy time.. And that might be a total deal-breaker for certain methods, the very reason for you to decide to go the whole nine and make a method your daily bread winner or give up because the actual costs of production become too high. This is certainly a larger discussion than the languge to code a few occasional bots with, but still... All these things considered, that's why I suggested -and still do- using python to code your templates because it's so simple to nail an event driven bot a monkey could do it and porting the logic to c++ if you need speed. Pro tip: c++ syntax is ugly, I know but you'll hardly find a more elegant framework implementation than qt out there with the added benefit a seamless python-c++ integration: c++ with qt almost looks like a modern language! ;) If you really need max speed and and a full-web component is mandatory nobody holding you back from going for awesomium and straight c bindings... Works very well for me. And light too, trust me on this. ;)
 
There have been a quite lot said in these posts, so lets go thorough them.

Whats the difference between simple Java Application and JavaFX application?

Java Swing and JavaFX are just "libraries" than enable you to do GUIs. JavaFX is simpler, actively developed and more powerful then swing atm.

It's been said in here before, but Python is a scripting language. It CAN however be compiled to an executable using Py2EXE or whatever. As far as form development goes, check out QT or wxWidgets. There is loads of documentation on both of them and dedicated channels for them on freenode.

Python is fast, has a huuuuuge community, and tons of third party libraries. It can also be run on any platform, so you can toss it up on a server or run it on your local machine(it's also really great for writing webapps in - see django).

First: Py2exe doesn't compile anything. It just creates a stub exe, and bundles it with python interpreter and scripts. There is a solution to that, I am very surprised that no one mentioned it, and that is to develop the application in Python and then modify it as Cython code. This way, Python app will be compiled to executable code and protect important parts from simple reverse engineering.

Next, even though Python has a huge support, nothing beats Java in terms of stability and correctness. Java is used by one of biggest enterprises in the World (US Government) and people working on that are making sure that everything works as planned. That counts for something.

Regarding Django, its all dandy, until you need to do something out of the box. Then its model representation kills you. But that's IMO.


QT is not free I tihnk? True?

QT has LGPL license, which means that you can use it, but if you do a change to QT code you have to release it. However, project had some crazy history, and I don't bet my work on projects that are jo-joing around the place. Personal preference, again.

It is also worth noting that the speed hit you take for runtime polymorphism with an interpreted language like Python is a non-issue for most of the stuff you guys are doing, where the majority of the application's time is spent in dependent wait states (network i/o, file i/o). Java certianly wont give you a speed increase if that is where your bottleneck is.

Long story short I wouldn't discount either language on speed grounds until you have tried implemented it and know for a fact that that you are limited by your language choice and not some external factor.

I second that. I hit the road with Python, since it doesn't support multi-threading and for some stuff, multi-processing was too heavy. It doesn't have a simple solution to JS interpreter like HtmlUnit and certain modules
are pain in the ass to use.
Python is slow when it comes to number crunching: this can be elevated by using NumPy (which IMO has nonpythonic syntax), and as I mentioned above Cython, which is fine. Hell, even multi-threading can probably be used via Cython to call native OS threads.

But that's only part of the puzzle. I dunno what kind of application OP has in mind, but long story short, if its only desktop Java,Python,whatever-the difference is small.

However, if there is a plan for expansion to web services, high number of concurrent operations or something similar, Java will beat every language hands down, except maybe C++ (which brings its own bag of problems at the table).

Java SE and Java FX both compile to java bytecode which is executed by the java vm.
You could view Java FX as an extension to Java SE.

If you want to create simple ui programs, (scrapebox, or something like this https://upload.wikimedia.org/wikipedia/commons/c/cc/Gui-widgets.png), you'd use Java SE http://netbeans.org/features/java/swing.html
If you want to create rich ui programs with gradients, dropshadows, (market samurai, tweetdeck) then you could use Java fx http://netbeans.org/features/javafx/index.html
They both use the java language.

py2EXE hasn't been under active development since 2008 and it only creates window exe.
Compiling python to binaries is a rabit hole of cross compilation you don't want to go down unless you have experience with cross compilation, in which case you wouldn't be compiling python.
Python is slow http://shootout.alioth.debian.org/u64q/which-programs-are-fastest.php?calc=chart&gcc=on&java=on&python3=on

Java is a horrible language that has a ugly bytecode vm which gives it it's speed advantage over python, however you need to pick the right tool, i think java is the right tool if you want to target multiple platforms and create a simple gui.

Cheers

Why is Java horrible? Its only verbose, and forcing of OO can be mitigated by using composition over inheritance. Java apps can be made in such way, that their source code is hideous, but that is a trait of developer not a language. Regarding byte code and VM, dunno what to say, except that at least that VM can support threads, while others fail miserably.

I agree with several points here, especially the performance factor and I'm really a bit of a nut in this regard not to mention it might make a HUGE difference in terms of implementation costs if you have some "automation" that needs large scaling... Or in other words buying shitty vps has a cost, buying super dedi's to spend most cpu cycles to deal with the overhead of runtimes, try-catch constructs and what s0ap correctly stated totally another at deploy time.. And that might be a total deal-breaker for certain methods, the very reason for you to decide to go the whole nine and make a method your daily bread winner or give up because the actual costs of production become too high. This is certainly a larger discussion than the languge to code a few occasional bots with, but still... All these things considered, that's why I suggested -and still do- using python to code your templates because it's so simple to nail an event driven bot a monkey could do it and porting the logic to c++ if you need speed. Pro tip: c++ syntax is ugly, I know but you'll hardly find a more elegant framework implementation than qt out there with the added benefit a seamless python-c++ integration: c++ with qt almost looks like a modern language! ;) If you really need max speed and and a full-web component is mandatory nobody holding you back from going for awesomium and straight c bindings... Works very well for me. And light too, trust me on this. ;)

Thanks given for mentioning awesomium.
 
I will choose C# in between them ,
I am a windows phone developer ,that's why my first choice is C#.
 
Hmmm let's see, if I had to choose between Python and C# I'd choose Delphi ! :cool:
 
Status
Not open for further replies.
Back
Top