Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java VS C++ : Downloading files over the web and storing them

Hey guys, Aura here 🙂

So I have a project idea which will require me to code a small application that will download files from given URL (direct download links) and save these files directly in a given location. Right now, I'm fluent in pretty much two languages (3 if you count C# but I don't feel like using it, even if it would be easier with it?) : Java and C++. Which program would allow me to complete these tasks the easiest? I also need to do I/O with files and launch commands via the command prompt, but it can be done with both of these so it doesn't worry me that much.

Thank you 🙂
Fiat justitia ruat cælum

My era of providing technical support and malware removal on HackForums is over, so you can stop PM'ing me about it. Sorry.
Why not C++. The standard libraries for C++ programs are everywhere so the program should run on any machine. It really doesn't matter what language you pick as the complexity is minimum which means either you or the clients will be noticing any difference while creating the program and using it. I'd go with C++ though :D
I really like Java so I'd always prefer Java. The thing you want to do is pretty simple.

If you decide to do it in Java you can always check my tutorial. I think you already know everything about streams though but I'll still post it: https://hackforums.net/showthread.php?tid=4490391
I prefer C++, but with Java would be easier..
It always surprises me to see people asking which of the languages they are fluent in is best for a project; if you're fluent in them, I'd say you can make a good decision yourself.
As you know, this is mostly personal preferrence. All languages you listed work.

If you're planning on making it asynchronous, using C# with the task-based asynchronous pattern is actually a really good choice. Interacting with the command line is also easy by starting CMD as a process and reading its standard output stream. I/O in .NET is a breeze as well.

Java is also a great option with nice portability, and does everything you need.
(Dec 12, 2014 04:20 AM)Dialog Wrote:  It always surprises me to see people asking which of the languages they are fluent in is best for a project; if you're fluent in them, I'd say you can make a good decision yourself.
As you know, this is mostly personal preferrence. All languages you listed work.

If you're planning on making it asynchronous, using C# with the task-based asynchronous pattern is actually a really good choice. Interacting with the command line is also easy by starting CMD as a process and reading its standard output stream. I/O in .NET is a breeze as well.

Java is also a great option with nice portability, and does everything you need.

I say that I'm fluent in a way that I know the language and if I don't know something, I can basically look it up quite easily online, so I guess I mis-used the term here 😝
The problem I have is "portability", what if I want to send that script to someone. If I do it in C# or Java, he'll need to have the dependencies. But if I want to add a GUI to make it easier, C# or Java would be better choices than C++ (since I never did GUI-dev. in C++).
Fiat justitia ruat cælum

My era of providing technical support and malware removal on HackForums is over, so you can stop PM'ing me about it. Sorry.
well unless you're in VC++ and want to include urlmon, you'll have to use a library such as curl or boost if you want to do this in C++.

(Dec 12, 2014 07:15 AM)Aura Wrote:  I say that I'm fluent in a way that I know the language and if I don't know something, I can basically look it up quite easily online, so I guess I mis-used the term here 😝
The problem I have is "portability", what if I want to send that script to someone. If I do it in C# or Java, he'll need to have the dependencies. But if I want to add a GUI to make it easier, C# or Java would be better choices than C++ (since I never did GUI-dev. in C++).

that's not what fluent means at all though lol. Imagine a translator saying they're fluent in both of your languages so you will translate for them and he shows up with google translate on his phone typing in and repeating what it says on the screen. On a side note, not trying to be a dick but it's even more obvious you're not fluent with this line:

Quote:If I do it in C# or Java, he'll need to have the dependencies.


over 90% of computers have at LEAST .net 2.0 (this is including business computers and old shitware), and java is literally known for being the most portable language in the world. That was its purpose. You build it once, literally run it anywhere. That is its moto.
(Dec 12, 2014 02:13 PM)Corios Wrote:  well unless you're in VC++ and want to include urlmon, you'll have to use a library such as curl or boost if you want to do this in C++.

that's not what fluent means at all though lol. Imagine a translator saying they're fluent in both of your languages so you will translate for them and he shows up with google translate on his phone typing in and repeating what it says on the screen. On a side note, not trying to be a dick but it's even more obvious you're not fluent with this line:

over 90% of computers have at LEAST .net 2.0 (this is including business computers and old shitware), and java is literally known for being the most portable language in the world. That was its purpose. You build it once, literally run it anywhere. That is its moto.

Yeah I heard about the "URLToFileDownload()" function or whatever it's called ? For Visual C++ in Visual Studio. And yeah, I misused the term, let's say that ... I can find my way around these languages then.
Fiat justitia ruat cælum

My era of providing technical support and malware removal on HackForums is over, so you can stop PM'ing me about it. Sorry.
(Dec 12, 2014 02:41 PM)Aura Wrote:  Yeah I heard about the "URLToFileDownload()" function or whatever it's called ? For Visual C++ in Visual Studio. And yeah, I misused the term, let's say that ... I can find my way around these languages then.

ya, you could use that function if it's all you want to do but if you plan to get into a larger scale application I would say you get up to java / C# as these features would be much easier in those languages ^^
Doesnt matter choose one and commence, nothing you mention is enough to single out any language
Java'll make it easy to code. C++ possibly could be faster, or same performance. If you're going the C++ route: don't use Visual C++ since it's made by Micro$oft and there would be zero point to it (except maybe writing a GUI without using external libs).
(Dec 12, 2014 07:27 PM)JavaProfit Wrote:  Java'll make it easy to code. C++ possibly could be faster, or same performance. If you're going the C++ route: don't use Visual C++ since it's made by Micro$oft and there would be zero point to it (except maybe writing a GUI without using external libs).

Ohhhhh, that's rich.
The same Micro$oft that is open sourcing a lot of the .NET architecture, and just pretty much made the Pro edition of Visual Studio free and available to everyone?

Fuck Micro$oft man.

Neil deGrasse Tyson bless RMS and GNU+Linux.
(Dec 12, 2014 02:13 PM)Corios Wrote:  well unless you're in VC++ and want to include urlmon, you'll have to use a library such as curl or boost if you want to do this in C++.

Or use sockets + raw HTTP requests like a man.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Delphi] by guaDec 5, 2018 10:42 AM 4 223 Dec 5, 2018 10:42 AM
Last Post: tcsh
by ChappieFeb 4, 2016 06:40 AM 7 153 Feb 4, 2016 06:40 AM
Last Post: Anyny0
[DBMS] by DotolDec 2, 2014 09:12 AM 1 181 Dec 2, 2014 09:12 AM
Last Post: Mr Fox