Your favorite programming language

>your favorite programming language
>a very short snippet of code which demonstrates why you think it's aesthetic

Other urls found in this thread:

uguu.org/src_belldandy_c.html
twitter.com/SFWRedditVideos

shell script baby

cd
cd
ls

int min(int a, int b){
return a

cd code
cd..
pwd
cd..
cd ..
ls
cd code
cd ..
cd ..

were it not for the laws of this board, I would have written this as a proper code snippet

map{('Fizz')[$_%3].('Buzz')[$_%5]||$_}(1..100)

public void areYouGay(Human person) {
if (person.hasIphone) {
return true;
} else {
return false;
}
}

public boolean*

return person.hasIphone

idiot

the absolute state of Pajeetcode

public boolean areYouGay(Human person) {
return person.hasIphone;
}


shortened that up for you buddy

is this satire?

passing argument when it's "is" relation... kys

still too verbose
Predicate areYouGay = person -> person.hasIphone;

Php

echo "Hello, World.";

It's just that easy

C
#include stdio.h
printf("Hello World);

It's just that easy

public void areYouGay(Human person) {
if (!person.hasIphone) {
return false;
} else {
return true;
}
}

I can type literally whatever I like here without having to worry about escaping quotes or anything how nice is that? I could even insert some in here or run any other code and not have to worry about it. It's like magic.

PROGRAM hello_world;
USES crt;
BEGIN
WriteLn('Hello World');
ReadLn;
END.


Nice keywords imo not stupid >> and

Don't do that. Use a proper templating library and stop closing php tags.

Forgot
ClrScr;

The crt unit is basic console stuff for moving the cursor, clearing the screen, colors etc.

Recently for me it's been C#. It's wording just seems so standard, like it's saying "I am the language". Just compare the hello world for C# versus Java (it's a fucking mess, wtf is this?) And Python (simple, so not bad, but it's simplicity leaves much to be desired)
C#
System.Console.WriteLine("Hello World!");

Java
System.out.println("Java is a fucking piece of shit");

Python
print('hello world!')

the same shit in .twig plox

Yeah buddy how nice hahaha

Too bad that when you take that language to production scale it is an absolute fucking nightmare where you don't know why anything works or doesn't work, specially because in 90% of cases everything is half-assed code that barely worked in one specific condition but is completely wrong in every way.

>literally replacing print with write and out with console

I now understand why java is called a meme language

numbers
.stream()
.filter(n -> n > 0)
.map(n -> 3 / n)
.reduce(0, (n1, n2) -> n1 + n2)

Java

Not so fast user. Console is capitalized, and so is WriteLine. Also, I don't have to fuck around with this first letter lowercase camel case cap that Java has

def pajeet(poo)
if poo = 1:
print("poo in loo")

>merely pretending

(defclass dfa (automata)
())

(defun keys (hash-table)
(loop for key being the hash-keys of hash-table
collecting key))

(defmacro make-transition-function (&rest pairs)
(let ((hash-table (make-hash-table :test #'equal)))
(loop for (start-state symbol _ end-state) in pairs
do (setf (gethash (cons start-state symbol) hash-table) end-state)
finally (return hash-table))))

(defun simulate-dfa (dfa input &key (current-state nil))
(unless (or (null input)
(member (car input) (automata-alphabet dfa)))
(error (format nil "Error: symbol \"~a\" not a member of DFA alphabet." (car input))))
(let ((state (or current-state (automata-start-state dfa))))
(cond ((and (null input) (member state (automata-final-states dfa))) t)
((eq state :reject) nil)
((null input) nil)
(t (let ((next-state (gethash (cons state (car input))
(automata-transition dfa))))
(when (null next-state)
(error
(format nil "Error: state \"~a\" has no transition defined for symbol \"~a\"." state (car input))))
(simulate-dfa dfa (cdr input) :current-state next-state))))))


(defmethod simulate ((automata dfa) input)
(simulate-dfa automata input))


(defparameter my-dfa
(make-instance 'dfa
:alphabet '(a b)
:start-state :q0
:states '(:q0 :q1)
:final-states '(:q1)
:transition-function
(make-transition-function (:q0 a -> :q1)
(:q0 b -> :q0)
(:q1 a -> :q1)
(:q1 b -> :q0))))

>Libraries

Can you say bloat

I need the highest performance of PHps
I NEED THE HIGHEST OERFORMANCE OF PHPS

...

>I NEED THE HIGHEST OERFORMANCE OF PHPS

If all you need to do is a basic web page, sure, it works flawlessly.

dup rot swap drop

T-thanks

Y-you too

on wednesdays W E K O D E

return person.hasiPhone

python could have been pretty sexy if there was no OOP shit and lambdas were first class citizen (no defs)

have you heard of puts? it's great!
> puts("I suck at programming~");

const func = (x, y) => { return x * y };

// es6 masterrace

const func1 = (x, y) => x * y;

vpcmov xmm1,xmm2,xmm3

It's clean, but lack of types makes it fragile

anonymous functions are shit even if you assign it to a constant it's still shit there is no use case where your example would be preferable

Someone posted PHP in this thread. I'm not gonna a participate because I might catch something.

C
uguu.org/src_belldandy_c.html

digusting af.

>types makes it fragile
only if its used by a retard noob

talk to me when you have more than 5k lines of code.

Cringy autism. Lisp is a mental illness

i-if I compile that, will it download cute animu girls in school uniforms onto my pc computer??

...

Can someone translate this to rust for me?

>measuring dick length in LOC
you're probably one of those guys that just starts writing shitty code and makes it up as you go along, never having designed an algorithm with pen and paper

What if your Boss wants to replace Ducks with Hens and Baby Chicks in the whole source code?

no, I'm a guy with a real job and real team of multiple people and so I understand the importance of a type system. You will too, one day

/* generated code */
if ( ++p == pe )
goto _test_eof;


Muh CDN

>boss
he's probably a neet hobbyist who just got into koding. hell get it eventually

Show me the equivalent in your language of choice, and get back to me.

Anything except toy problems look simply ridiculous in other languages.

perl 6
.chr.print for ^256

Wow! We should invite you to our startup!

so pretty
sort [] = []
sort (x : xs) = smaller ++ [x] ++ larger
where smaller = sort [a | a

Rust is such a beautiful language.

A function permanently taking ownership of a variable:

fn main() {
let s = String::from("hello"); // s comes into scope.

takes_ownership(s); // s's value moves into the function...
// ... and so is no longer valid here.
let x = 5; // x comes into scope.

makes_copy(x); // x would move into the function,
// but i32 is Copy, so it’s okay to still
// use x afterward.

} // Here, x goes out of scope, then s. But since s's value was moved, nothing
// special happens.

fn takes_ownership(some_string: String) { // some_string comes into scope.
println!("{}", some_string);
} // Here, some_string goes out of scope and `drop` is called. The backing
// memory is freed.

fn makes_copy(some_integer: i32) { // some_integer comes into scope.
println!("{}", some_integer);
} // Here, some_integer goes out of scope. Nothing special happens.

A function giving ownership of a variable to its caller:

fn main() {
let s1 = gives_ownership(); // gives_ownership moves its return
// value into s1.

let s2 = String::from("hello"); // s2 comes into scope.

let s3 = takes_and_gives_back(s2); // s2 is moved into
// takes_and_gives_back, which also
// moves its return value into s3.
} // Here, s3 goes out of scope and is dropped. s2 goes out of scope but was
// moved, so nothing happens. s1 goes out of scope and is dropped.

fn gives_ownership() -> String { // gives_ownership will move its
// return value into the function
// that calls it.

let some_string = String::from("hello"); // some_string comes into scope.

some_string // some_string is returned and
// moves out to the calling
// function.
}

// takes_and_gives_back will take a String and return one.
fn takes_and_gives_back(a_string: String) -> String { // a_string comes into
// scope.

a_string // a_string is returned and moves out to the calling function.
}

A function immutably borrowing a variable its caller:

fn main() {
let s1 = String::from("hello");

let len = calculate_length(&s1);

println!("The length of '{}' is {}.", s1, len);
}

fn calculate_length(s: &String) -> usize { // s is a reference to a String
s.len()
} // Here, s goes out of scope. But because it does not have ownership of what
// it refers to, nothing happens.

>not being able to write proper code in own favorite language

How you enjoying windows ?

You forgot all the bullshit Apache / nginx config

>forth
>2 2 +

>Configuration
>Just install php and dump your files in var/www/public_html
It just werks on any sane distro.

> if ( assignment statement)
Why are racists such brainlets??

>C
You can easily grep through a codebase for any function you see being used. Also macros are great for debugging.
int modulename_dothing(int paramter)
{
fprintf(stderr, "from " __func__ ": ", parameter);
return 33;
}