[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Whey is java so verbose? Java >4 lines to print 2 words Python
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 93
Thread images: 5
File: really.gif (210 KB, 280x199) Image search: [Google]
really.gif
210 KB, 280x199
Whey is java so verbose?
Java
>4 lines to print 2 words
Python
>1 line to print 2 words
>>
>>54098838
public class OpIsAFaggot { public static void main(String[] args) { System.out.println("OP is a faggot!"); } }


There, one line.
>>
>>54098992
I really hope you aren't trying to say that isn't verbose.
>>
>number of lines mean somthing
>>
def main():
print("hello world")

if '__name__' == '__main__':
main()

Looks pretty verbose to me senpai
>>
>>54099143
That's nowhere near as verbose as
>>54098992
>>
>>54099152
Java looks no different from other C-syntax languages. Just a few more access modifiers.
>>
        global  _start

section .text
_start:
; write(1, message, 13)
mov rax, 1 ; system call 1 is write
mov rdi, 1 ; file handle 1 is stdout
mov rsi, message ; address of string to output
mov rdx, 13 ; number of bytes
syscall ; invoke operating system to do the write

; exit(0)
mov eax, 60 ; system call 60 is exit
xor rdi, rdi ; exit code 0
syscall ; invoke operating system to exit
message:
db "Hello, World", 10

x86 assembly
>16 lines to print two words and one character
you're full of shit op

code taken from http://cs.lmu.edu/~ray/notes/x86assembly/
>>
Python is much slower though.
>>
>>54099200
OS-level assembly has always been lame
>>
>>54099163
>doesn't look any different
Get the fuck outta here with that bullshit
C itself goes
#include <stdio.h>
int main (int argc, char ** argv){
printf ("hello world\n");
return 0;
}
>>
>>54099214
DOS was a little more friendly to the coder
IIRC you could pass a pointer to the string in to one of the registers, set the other register to a value and call an interrupt
>>
>>54099200
That code is ugly and unoptimized desu desu
>>
>>54099273
>having to optimize code that prints two words and a character
W E W
E
W

Assembly is shit
>>
>>54099291
Enjoy your bloat
>>
>>54099220
The best in this thread. C is the best looking language ever imo.
>>
>>54099220
#include <stdio.h>
int main (){
printf ("hello world\n");
return 0;
}

even less verbose and 100% functional without obfuscation
>>
>>54098838
1/4 the lines. 200 times more resources
>>
>>54099233
Yep, same way you use a modern OS.
>>
Java was made as a reaction to the already complex and often-verbose enterprise C++ to be the ultimate Object Orientated wank-material. It is simply a joy to write those sexy OOP keywords "public class EvenMyProgramIsAnObject public static void System.out" before you can achieve any computation.
>>
>>54099233
That's sweet, this was possible to do only in text mode I guess? Sounds a bit difficult in other VGA modes
>>
thx ^=^
>>
What is wrong with being verbose?

program HelloWorld;
begin
writeln ('Hello, world.');
end.
>>
Scala is a godsend in terms of non-verbose JVM shit
>>
 
fn main {
println!("hello");
}
>>
>>54098838
Java was such a turnoff for me. Seemed like a language for grandmas.

I.Am.Explaining.Exactly.What.I.Am.Doing.Every.Time.So.You.Feel.Safe.And.Aren't.Lost
>>
File: 1325960579873.gif (2 MB, 214x193) Image search: [Google]
1325960579873.gif
2 MB, 214x193
>>54098838
Stop posting this generic lolsorandom neckbearded fuck.

I swear to god, I've seen millions of these people in town and at university. Some fat, some skinny. All of them irritating.
>>
Because it aids in safety, documentation, debugging, and code maintenance on large projects.


Python has one liners because it's a dynamically typed accepting language.

>"Why does that airplane have those long wings and such tiny wheels? My Honda Civic hatchback has four wheels, much less complicated.... "

Apples to oranges
>>
>>54100360
>accepting

*scripting
>>
>>54100155
Java is great to learn.
>>
>>54100755
Maybe if you're a cuck.
I'd already learned C++, so I couldn't be bothered. :^)
>>
>>54099410
#include <stdio.h>
int main(){
puts("hello world");
}

even less verbose and 100% functional without obfuscation
>>
>>54101240
#include <stdio.h>
main(){
puts("hello world");
}
>>
>>54101316
main(){
puts("hello world");
}
>>
We said functional, retard
>>
>>54101376
#include "helloworld.h"
void main (){ helloworld ();}
>>
>>54101376
I win guys, /g/ BTFO
>>
>>54101428
you no minimal enough m8
>>
C doesn't even have lambda expressions. What a garbage language.
>>
>>54101428
55 chars code against 50 in the previous codes.
>>
>>54101466
My bad dawg
#include "h.h"
void main (){ h ();}


Suck it
>>
>>54101461
>C doesn't even have these useless expressions. What a garbage language
FTFY Pajeet.
>>
>>54101495
Now we're talking. You're the current winner.
>>
>>54101495
still bad what the flying fuck is h.h? I know what it is but not explicitly declared nor autoinclude by gcc.
you can't beat me m8.
>>
#include <iostream>
using namespace std;
int main() {
cout >> "C++ faggots";
return 0;
}
>>
>>54101518
They're not useless though.
>>
>>54101542
>not autoincluded
You're right, but that's what the makefile is for. I type "make" and "./a.out" and I'm good
>>
>>54098838
IT'S SHOWTIME
TALK TO THE HAND "hello world"
YOU HAVE BEEN TERMINATED


Succinct as fuck!
>>
>>54101495
#include "h"
main(){h();}
>>
>>54101625
You son of a bitch.
>>
File: napoleon2.jpg (52 KB, 306x350) Image search: [Google]
napoleon2.jpg
52 KB, 306x350
>not using HolyC to build a native TempleOS GUI application
Holy shit do you plebs even Temple?
>>
>>54098838
Why are you comparing an OOP language with a scripting language?

Why aren't you doing something productive instead?

Why did your mother waste vital womb space on bringing such a pernickety cunt into the world?
>>
echo "hello world"


GET AT ME
>>

print

"

hello

world

.

"


>guess what language
>>
>>54101613
the total code is longer than mine, I can accept losing.
>>
What's wrong with being readable?
>>
>>54101664
A sea creature?
>>
>>54101703
Javas problem is its verbose and barely readable on top of it.
>>
>>54099143
if __name__ == '__main__':
print("boop")


Stop being a pajeet. You forgot to write and instantiate a class as well, pajeet.
>>
 console.log("Hello, World!"); 
>>
print "hello world"

I literally win, java/cfags btfo
>>
>>54101770
Yeah, that's what I was thinking. Java's easy, what're all these code nooks talking about?
>>
>>54101805
>implying it works that way
Dude didn't do all the gay class building.
>>
>>54101814
No, all these people don't understand how java works, saying it needs more than 4 lines etc; it's as simple as >>54101770
>>
File: java.webm (919 KB, 1206x630) Image search: [Google]
java.webm
919 KB, 1206x630
>>54101824
>>
>>54101891
>nano
bretty cool m8
>>
>>54101891
Pajeet btfo
>>
>>54099220
two lines
#include <stdio.h>
main() {printf("Hello, world");}
>>
HAI 1.2
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
>>
>>54102356
what
>>
>>54102380
>http://lolcode.org/
>>
>>54102414
Bada bing
>>
>>54102414
>The variable types that LOLCODE currently recognizes are: strings (YARN), integers (NUMBR), floats (NUMBAR), and booleans (TROOF) (Arrays (BUKKIT) are reserved for future expansion.) Typing is handled dynamically. Until a variable is given an initial value, it is untyped (NOOB)
pretty epik
>>
<html><body>
Hello world


Don't even need the end tags.
>>
>>54102672
document.write('Hello world');
>>
>>54102672
TRIGGERED
>>
(println "hello world")
>>
>>54099273
>unoptimized
the fuck?
>>
plz console.loge with "hello world"
>>
>>54102672
You don't need tags at all, HTML is just plaintext with markup tags.
>>
>>54099495
This is the most relevant thing in this thread.
>>
No Haskell?

main = putStrLn "Hello, world!"
>>
>>54101695
english
>>
>>54098992
Hur dur I can put everything on one line because it is a whitespace insensitive language. That means it isnt verbose.
>>
/g/ is literally a bunch of little kids jerking off how easy it is to print "hello world" with their favourite toy language
>>
psvm sout "hello world"
>>
>>54102414
Multi-line comments are begun by OBTW and ended with TLDR, and should be started on their own lines, or following a line of code after a line separator.

What's not to like about this language?
>>
>>54104816
Every board on 4chan is people jerking off to something.
>>
            package Earth;sub Greet{
%_=('Y','~');$_='$;=!(Middle
Earth.age~~~<Eart~~~~~~~~~~~~~h
.age)?!(defined$ti~~~~~~~~~~~mez~~~On
e[2])?!(push@time~~~~~~~~~~~~~~~~Zone,loc
~altime())?rotation?~~~~~~~~~~~~~q~~?The Worl
~~d?:q:[\w]::q=[\~~~~~~~~~~~~~~~~~d~a-f]=:q?..~~
~~~?:q:.:;"42b3d3~~~~~~~~~~~~~~~~~~~~~728656c6c6f6
~~~~~0277f627c64672~~~~~~~~~~~~~~~~~~~~~b3072796e647
~~~~~~~42b3b3r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~~>,~~~~~~~~~~~~~~~~~~~~~~~~~~YY
~~~~~~~~~~~@_~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~"~~~~~~~~~~~~~~~~~~~';;
s,(~|\r|\n|\s),,g;s.Y.\x7e.g;
eval};Greet;'the world';
>>
>>54104816
How about basic algorithms then? Quick sort in one line without any libraries.

quicksort (x:xs) = quicksort [y | y <- xs, y<x] ++ x ++ quicksort [y | y <- xs, y>x]
>>
>>54105384
I'd rather prefer something that I can read. Functional programming is useless.
>>
>>54101625
#include"h"
main(){h();}

Eat shit
>>
File: %3e.png (450 KB, 1280x720) Image search: [Google]
%3e.png
450 KB, 1280x720
>>54104776
Thread replies: 93
Thread images: 5

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.