print("Hello, world!")
or
cout
Print("Hello, world!")
Other urls found in this thread:
pastebin.com
pastebin.com
GitHub.com
twitter.com
from helloworld import HelloWorld as Hello
def do_hello_world():
hello = Hello()
hello.say_hello_world()
if __name__ == '__main__':
do_hello_world()
based
Which one is still replicated to this day in every language?
my sides
printf("%s", "Hello, world!\n");
damn and people say that python isn't enterprise ready
C++ is for little babbies, real men use C. Observe, the power of idomatic C:
#define l putchar
int main(void) {
return (((((((l(1+(1+(1+(1+(((((((l(((((((((((((((((((((((((((((l(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(((((((1+(1+(1+(1+(((((((((((l((((((((1+(((((((l(1+(1+(((1+(l(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(((((((((((1+(((1+((l(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(((1+(((((((((1+((((1+(1+(1+(l(1+(1+(1+(1+(1+
(1+(1+(((((((1+(((((((1+(1+(1+((((l(((((((((((((((((((l(1+(1+(1+(1+((((l(l(1+(1+(1+(1+(1+(
1+(((1+(((((((1+(1+(((((((1+(1+(l(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+((((((((1+(1+(1+((((1+(1+(l(1+(1+(1+(1+(1+(1+((((((((1+((((((1+(((1+(
1+(1+(1+(64)))))
Not nearly flexible enough, at my university they taught us to do it like this:
char hello[10];
sprintf(hello, "Hello, world!\n");
printf(hello);
System.out.println("Hello, World!");
Negro what
it's just a standard hello world
Your university doesn't know how printf works or how to count.
Ada.Text_IO.Put_Line("Hello, world!");
>The state of Jow Forumss code tags.
>
>over designed, incorrect, and unsafe
about what I would expect from higher education
println!("Hello World!");
macros will rule the world one day
Doesn't compile for me, Nigel fuckington
Is this finally resolved?
brainlet here, what's the bottom half part, assambly, or what?
Assembly, if you're using GCC, compile with -S flag to stop at the assembly generation.
thanks
There's more code in the second example because it's safer code
because its useless c++ bloat, you can't get any safer than routing a const char pointer to data section into write syscall (or puts function)
It's safer if you're assuming the C programmer is a brainlet. And that's not even true, the asm is longer because it's a stream, if you want the same size you'd have to include cstdio and use printf.
do tell me what exploit you found on the C version, can you get root shell access?
yikes
Get a better compiler then, nigger. (j/k I agree that it shouldn't compile, but gcc takes it). Or include stdio.h
Oh it was just my shitty android compiler.
>yes I know I'm a faggot
>cout
Also how the hell do you post ">" without it translating to ">"??
In those primitive examples, it doesnt matter other than your moronic use of endl.
Overall the c++ way is much more typesafe at least and isnt some obnoxious runtime evaluated dsl that can have memory safety issues. but the c++ stdio implementation has a lot of hacks baked in that make it pretty shitty as well without a lot of io specific runtime configuration.
>using sprintf instead of snprintf
>allocating 10 bytes for a 16 byte string
>no null terminator
>passing an unescaped array to printf
This really triggered my autism. If you're being serious demand your money back.
Your compiler, unlike most brainlets, recognized that your use of printf was moronic and it rewrote it with something akin to puts().
Even if it didn't, it would still just be a call.
100% terrible.
Even if you, for some fucking reason, do it that way (which, for some wasteful reason, copies the entire string), you should usually never pass a variable to printf as the first argument.
If at all, it should be
printf("%s", hello);
Or better, just puts. Or fputs with stdin, if no new line is desired.
Tell whomever taught you that how retarded this is.
I think we can all agree that IOStreams were a terrible design full of terribly thought through, terribly implemented terrible ideas.
But people who disregard the entire language because of this easily avoided garbage feature are really stupid.
use std::io::{self, Write};
fn main() -> Result {
let stdout = io::stdout();
let mut stdout_lock = stdout.lock();
stdout_lock
.write(b"Hello world\n")
.and_then(|_| stdout_lock.flush())
}
>
anyone care to explain this to a brainlet?
I can't tell if you're typing ">" or if you're typing "& g t ;" with no spaces
What he's basically doing is calling the putchar function as l and then looking for the H character by summing 1+1+1... until it reaches the ascii value of the H character. To make it faster on later characters, he just switches some bits around, hence the >> and
He's constructing the ASCII characters for hello world using only addition, subtraction, bitshifting, and the fact that putchar returns the character it prints
public class HelloWorld{
public static void main(String[] args){
String Helloworld = "Hello, World!";
char a = 'a';
int y = Helloworld.length();
int x=0;
while (x
>you should usually never pass a variable to printf as the first argument
why
These dudes are right, I actually just made a script that generates this shit. It's too long for Jow Forums: pastebin.com
For example, ruby c_shift_print.rb "ha ha" generates:
#define l putchar
int main(void) {
return ((((l((((((l(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(((((1+(1+(((((((((((((1+((l((
((((((((((((((((((((((((((((1+(((1+(((((((((((((l(1+(1+(1+(1+(1+(1+(((((((1+(((((((1+(((((
((l(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+
(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+((((1+(((((((((((((l(1+(1+(1+(1+(
1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(
1+(1+(1+(1+(((1+(((((((1+(((1+((((1+(((1+(64))
god this is fucking retarded
It's asking for security vulnerabilities later down the line. If a malicious or dumb user ends up being able to manipulate he format string passed to printf, they can add additional format specifiers that will cause the printf call to read an incorrect number of arguments, at best trashing your stack and at worst overwriting control flow information to redirect to something malicious.
How is "Hello world" in Lisp?
import __hello__
Do you kids even try?
In Scheme is:
(display "Hello, World!")
fprintf ( 1, ' Hello, world!\n' );
is this the language that's been used in sicp?
MsgBox("Hello World")
function Hello takes nothing returns nothing
local string a ="Hello, world!"
call DisplayTextToForce( GetPlayersAll(), a )
endfunction
Common Lisp:
(format t "Hello world!~%")
Emacs Lisp:
(print "Hello world!" t)
I should mention, this is JASS
cout and cin is niggerlicous
comfy lang desu
Scheme is:
(pretty-print "hello world!")
Yes. SICP uses some form of scheme, although I can't remember what implementation they recommend (if any). Personally I've been having fun with Chez
You are all like babies. Watch this.
pastebin.com
The helloworld module has many improvements over the built in modules. Please see the reader.md on GitHub.com