View Full Version : Hello World App (for fun)
cjx3711
03-09-2009, 05:21 PM
Ok, we want to output "Hello World"
---------------------------------------------------
C++
include <iostream>
using namespace std;
int main ()
{
cout << "Hello World";
return 0;
}
---------------------------------------------------
Java
package helloworldapp;
public class HelloWorldApp {
public HelloWorldApp() {
}
public static void main(String[] args) {
System.out.println("Hello World");
}
}
---------------------------------------------------
Actionscript:
trace ("Hello World");
---------------------------------------------------
In conclusion, Actionscript Rules!!!!!
yell0wdart
03-09-2009, 07:54 PM
Ok, we want to output "Hello World"
...
Javascript
package helloworldapp;
public class HelloWorldApp {
public HelloWorldApp() {
}
public static void main(String[] args) {
System.out.println("Hello World");
}
}
That's not JavaScript. That's Java. The JavaScript equivalent of what you're trying to do is: document.write('Hello world');
I'm a little unsure of what you're trying to say with your comparison. Languages like Java and C++ are a completely different animal than AS is.
cjx3711
03-10-2009, 02:40 AM
sorry then, so java is different from javascript? I thought they were same.
Anyway, I just put this up for fun, as the title suggests. It is just something I thought of. I know that they are completely different. This is meant as a joke, you don't need to be so serious about it.
Anyway thanks for telling me, I'll go edit it.
yell0wdart
03-10-2009, 04:57 AM
sorry then, so java is different from javascript? I thought they were same.
Heh, no, they're very different. JavaScript is a scripting language based off of ECMAScript, just like AS is. JavaScript has many different uses, but primarily, it's used to create client-side functionality and manipulate the DOM.
Java, on the other hand, is a full blown strongly-typed OO language that is used to build all sorts of things. It's similar to C++ and C# in its syntax, and just as broad in its usefulness. ;)
kkbbcute
03-10-2009, 09:18 AM
Personally, if you ask me, "Hello World" apps are one of the dumbest things ever. They are useless and don't give you a sense of satisfaction at all, its like, I spent a whole day just to learn this?!?! Then you spend the rest of the day wondering if the effort was worth it. :p
cjx3711
03-10-2009, 11:14 AM
Wow, can no one just take this as a joke? Everyone here is too serious about stuff, we need to open a Jokes thread to loosen the tension.
Yes and anyway, I never did the hello world app, I understood it after reading it once, didn't need a whole day to do it.
kkbbcute
03-10-2009, 11:48 AM
Wow, can no one just take this as a joke? Everyone here is too serious about stuff, we need to open a Jokes thread to loosen the tension.
Yes and anyway, I never did the hello world app, I understood it after reading it once, didn't need a whole day to do it.
That's because it was probably not your first time with code. If it was, your teacher would have been talking a whole bunch of stuff about pseudocode, coding best practices, the applications of coding, blah blah... And at the end of all that, you get a "Hello World", so it is sort of depressing. Anyway, I think someone would end up closing a jokes thread cause its gonna get spammed.
CyanBlue
03-10-2009, 02:59 PM
Um... 'say hello world' sounds easier... Which means ActionScript sucks??? Dang... :(
Let's chill out abit, guys... After all... This is a General Chats forum... ;)
I do see the point on the Hello World thing though... Not everybody is bright like some of the folks in town, and it helps to go through the simplest tutorial simply to understand the whole process... I did need to create an iPhone app some time ago, and I had no idea how to do it... The first thing I did was googling on 'iphone hello world tutorial' just to see what I need to do and what software I'd need and so on... I could have picked up a book on it from the B&N, but I am not really a book type person, so... ;)
kkbbcute
03-10-2009, 04:31 PM
Hey, CyanBlue, by the way, would a jokes thread be fine?
Non racist/sexist/insulting of course.
CyanBlue
03-10-2009, 04:45 PM
Why not??? You are in the General Chats forum... ;)
Unless it's a joke about Atomic then CyanBlue gets protective and close your thread! :p (Just kidding Jason)
CyanBlue
03-10-2009, 06:06 PM
Well... I don't think there is "A"tomic in this town... ;)
So... According to cjx3711's logic and my proof, ActionScript does suck, yeah???
Well when you say "hello world" obviously your brain first goes into the languages/words library and put together the sentence then passes the result to the OpenMouth library which send a request to the Breath library to get some air (not AIR) to power the sound, then when all flags are set to true the OpenMouth library triggers the talk method and you finally say "hello world". So that does not seem very efficient to me. So Flash still first.
CyanBlue
03-10-2009, 06:40 PM
Oh... I meant the bash command in Mac that speaks the provided argument... So, 'say hello world' in Mac Terminal actually speaks to you in a soft systematic tone... ;)
runawayprisoner
03-10-2009, 10:35 PM
Yeah. You can just do that in terminals.
Mac terminal is "say hello world"
And Unix (Windows, too) terminal (command prompt) is "echo hello world"
Aside from that:
PHP: echo "Hello World!";
ASP: Response.Write "Hello World!"
And HTML: Hello World!
So based on that logic (or the logic of most browsers), HTML wins. You don't even need a command or instruction or method or function.
CyanBlue
03-10-2009, 10:37 PM
Dang... I'd never thought that HTML has the same power as my pencil... Good call, runawayprisoner... :p
runawayprisoner
03-10-2009, 10:48 PM
Thanks. I just thought of it while brainstorming something... (expanding HTML support in Flash)
I tend to think of HTML, JavaScript and CSS as being more like text files that get interpreted as they're loaded. Not that I have experience writing a browser, but I think HTML, JavaScript and CSS were made with that in mind.
So maybe... just maybe... we can custom-script an HTML engine in AS that "might" do more than the default HTML and CSS support in TextField. And with that, possibly the ability to load and en-frame a web page inside your Flash movie clip.
But I'm still debating whether or not that is actually useful for anything at all. A web browser (or semi-browser) inside a web browser sounds redundant.
CyanBlue
03-10-2009, 11:43 PM
Well... That definitely is possible, but I have never seen it done while I Flash, and that sorta tells me that people thought that it is not really necessary when such thing is supported in Flex/AIR... It will take good amount of time to get such engine created, and that time is not really worth it, if you ask me...
cjx3711
03-11-2009, 07:35 AM
So... According to cjx3711's logic and my proof, ActionScript does suck, yeah???
Technically, I meant it to mean that actionscript was the easiest to code because it only needed one line. On the contrary, I meant to say that actionscript rules.
Of course, I know that this will spin into a huge controversy, so right now, I will say that my argument has no proper evidence to come to such a conclusion and I do not need people telling me that.
Then again, I was only comparing the three scripting languages stated. So I didn't include html.
kkbbcute
03-11-2009, 07:38 AM
Woohoo! Another fanboy controversy, AS rocks! *Drool*
But in all seriousness, it is the most accessible. Pseudocode = useless and thus does not count.
runawayprisoner
03-11-2009, 08:12 PM
Technically, I meant it to mean that actionscript was the easiest to code because it only needed one line. On the contrary, I meant to say that actionscript rules.
Of course, I know that this will spin into a huge controversy, so right now, I will say that my argument has no proper evidence to come to such a conclusion and I do not need people telling me that.
Then again, I was only comparing the three scripting languages stated. So I didn't include html.
In my definition, ActionScript isn't really a "scripting" language since you don't run it interpreted. And it should be on the same level as C++ and Java. Closer to Java because aside from a minor change to the way you initialize variables, there's almost no difference. So if you only consider languages that have to be pre-compiled, ActionScript may still win.
And thanks for the input, CyanBlue. I thought so as well.
arone
03-12-2009, 04:01 AM
I use this one in Flex all the time.
ActionScript Code:
Alert.show("Hello World!");
Can anyone guess what this code is?
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
yell0wdart
03-12-2009, 03:53 PM
Then again, I was only comparing the three scripting languages stated. So I didn't include html.
C++ and Java are not scripting languages. Comparing AS to C++ or Java is like comparing a Smart Car to a Ferrari. ;)
wvxvw
03-12-2009, 05:58 PM
@arone:
brain****
(Sorry, that's really how it's called, http://en.wikipedia.org/wiki/Brain**** - if you don't believe)
EDIT: Wow, I didn't know this feature exist on this forum! :D OK, anyways, I think you've got the point.
kkbbcute
03-13-2009, 03:25 AM
C++ and Java are not scripting languages. Comparing AS to C++ or Java is like comparing a Smart Car to a Ferrari. ;)
Completely agree, they are two completely different things and you just can't compare them.
cjx3711
03-14-2009, 04:08 PM
Ok, looks like I failed. I was trying not to cause a controversy, but now, I have. Anyway, as I said before, everyone here is too serious. Go read the jokes thread to loosen up.
Thread: http://www.actionscript.org/forums/showthread.php3?t=200146
yell0wdart
03-14-2009, 08:06 PM
Ok, looks like I failed. I was trying not to cause a controversy...
Not sure I'd call it a controversy. :p
We're just giving our honest opinion of your posts... which is essentially what a forum is about. ;)
kkbbcute
03-15-2009, 06:18 AM
Not sure I'd call it a controversy. :p
We're just giving our honest opinion of your posts... which is essentially what a forum is about. ;)
*Spooky tone*
It's a hidden controversy, the one which everyone is part of even though they don't realize it.:p
@cjx3711 Thanks for linking, love the jokes.
yell0wdart
03-15-2009, 08:14 AM
*Spooky tone*
It's a hidden controversy, the one which everyone is part of even though they don't realize it.:p
@cjx3711 Thanks for linking, love the jokes.
Is the sky falling again? The government is watching me brush my teeth again through my bathroom mirror? I must know!
kkbbcute
03-15-2009, 08:57 AM
Is the sky falling again? The government is watching me brush my teeth again through my bathroom mirror? I must know!
Never knew Obama had a toothbrush fetish:p
Anyway let's not drift off topic...
cjx3711
03-15-2009, 10:36 AM
What topic? The topic of the hello world thing seems to be over. Please do not jump start it agian to prove me wrong.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.