Syntax

Which programming language objectively and arguably has the best/worst syntax?

Other urls found in this thread:

archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P47.HTM
blog.portswigger.net/2017/09/abusing-javascript-frameworks-to-bypass.html
nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/
reddit.com/r/walmart/comments/67cc50/new_toy_department_manager_and_i_feel_overworked/
twitter.com/NSFWRedditImage

Best: Anything that is not Rust.
Worst: Rust

I like Algol 68.

archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P47.HTM

Worst is definitely JCL. It's still very much in use. I have a friend that has to write in JCL for his company's z/OS mainframe.

Depends on what you consider to be part of syntax and what part of the language as a whole. I'd say php(7) actually has pretty good syntax. Python isn't too bad, but indent being part of syntax ruins it. I like the way perl handles hashmaps and arrays, on some level.

The best syntax is objectively Ada. It's one of the few languages that had readability as a design goal.

The worst syntax is objectively Malboge. It was designed to be absurdly difficult to program in and it shows. Nearly indistinguishable from line noise and may cause you to gouge your eyes out.

Fractran.

perl6

do those have the best and worst syntax at the same time?

Best:Ruby
Worse: C++98

but c++98 does not exist anymore

anything that compiles fast, really.
the only limit to a programming language is how much time you're willing to put into it.

Best: Go
Worst: Rust

Best: there is none. every language that has more features than go has "ugly" syntax
Worst: out of the mainstream languages definitely c++

lmao

lmao

Oh you LARPers crack me up

...

java is extremely verbose but not really that ugly
c++ is verbose and extremely ugly

perl6 can take on the form of any other language so yes

Assembly is by far the best.
Everything else are just confusing abstractions.

C if you ignore some stuff like function pointers is okay. Shell (especially zsh, since the quoting hell is mitigated here) or TCL are very nice.

C
any scripting language

Why is Scala such a hot whore

Lisp
Lisp

Alternate worst: anything that strays too far from C syntax

Ctrl+F "lisp"
2 matches

This thread needs more lisp-chan.

One thing I've learned from trying out other languages is how sexy the former syntax is over some variation on the latter, i.e.
if (thing) for ( ; ; ) do_something();else if (something) for ( ; ; ) do_something_else();else final_thing();
over
if (thing) { for ( ; ; ) { do_something() }} else if (something) { for ( ; ; ){ do_something_else() }} else { do_final_thing()}

Just because it's less tedious to write and line endings are really nice

best: C, lua, tcl
worst: jabba, c++, rust and jabbascript

best: C, lua, tcl
worst: jabba, c++, rust and jabbascript

C has the worst syntax of all the mainstream languages, this isn't even a question. C++ is worse of course but that's mainly only because it's based on C
for instance here is what happens when you compose a few types in C:
int (*(*(*kys)())[2])[3];
whereas the equivalent type in any other language would be trivial to read

C has the worst syntax of all the mainstream languages, this isn't even a question. C++ is worse of course but that's mainly only because it's based on C
for instance here is what happens when you compose a few types in C:
int (*(*(*kys)())[2])[3];
whereas the equivalent type in any other language would be trivial to read

only retards actually write C like that. just because it's possible doesn't mean it's common programming practice.

Good syntax needs a good coding style. I like Lisp but if someone tried Allman-style brackets on their own line then it would look retarded.

The best syntax is C style. Pretty much every programmer understands it, because most common languages are based on it.
The worst I can think of is COBOL.

/thread

Visual basic, oh god i gotta cum on visual basic

BEST: HASKELL
WORST: RUST

erlang is the worst I've had to work with. Not only is the syntax shit but structurally it naturally leads to yanderedev-style code.

still better than any imperative garbage.

Your language is worse than java
thing ?? loop {do-something} !!something ?? loop {do-something-else} !!final-thing;

Linux style rules work here. If your program flow uses more than three tabs, you fucked up.

Good luck sticking to that rule in erlang.

Holy shit a three star programmer in the wild. I should have brought my camera. I'll be telling my kids this story.

Lisp doesn't qualify, it doesn't have syntax

I've been writing in C for 30 years and I've never seen anyone do that in real code, even in Pajeet code.

lmao top b8

Lua

Does Erlang not have functions?

retards don't write it like that because they don't know how. you're trying to apply a general non-argument to where it doesn't apply

yes you've never seen anyone do this, because they don't know how
but ok not happy? ill keep adding more
>Bitwise `&` and `|` have lower precedence than ``, and every other language copies this so C fags coming to them don't get tripped up.

found the 1337 systems h4x0r programmer

Maybe try not using 8 space indents like a nigger. Erlang syntax isn't nearly as bad as most langs. New generation programmer faggots are insulted by it because it doesn't looke like JS (which to them is the same thing as C because they can't actually program C despite sucking it off so much) so they switch to Elixir. Unlike C, the commas in Erlang actually make sense. "muh case nesting" isn't an argument, every FP language is like this and for a reason.

(cont)
`if (a) f() if (b) g() else h()` is retarded. and a bunch of other languages copied this garbage from C
not an argument

(cont)

don't fucking write ambiguous code. it's a fucking argument. just because C gives you rope you don't have to hang yourself with it.

having ambiguous syntax constructs in a language doesn't benefit anyone, you shit. do you even have any idea of what you're talking about?

Any syntax can be abused to have unexpected results. You can't enforce it unless you enforce indentation i.e. Python. The brace-less if/else can be used for
if (something) do_this();else do_something_else();
or
if (something)if (something_else) foo();else bar();
The second one is fucking retarded, but that doesn't eliminate the usefulness of the first one.

Switch-case is useful in some cases but default fall-through is dumb as shit. If it was default break it would be much better.

Here's a (You) for the time you spent on this shitpost.

first of all, i'm pretty sure C specs don't make this syntax ambiguous. so what we mean by ambiguous here is that it's not obvious which way the syntax should evaluate without knowing the spec.

personally, I use
if (a) f(); if (b) g(); else h();
all the time, because when I have to use these languages I use all features to shit on them. Of course your average C tard doesn't even know which way it should evaluate and will be tripped up if the indentation is wrong.

If we're going to argue that nested `if` without {} should never be used, then the spec should have simply enforced that.

In Python you can still do all kinds of stuff like this. By " forcing indentation", you really want something more like syntax formatting cannot be done by hand or does not exist and everything is formatted by an algorithm. No mainstream language does this yet.

this is exactly what I meant

ioccc winner posting itt

Did you know that this is valid C?
"hello"[2] = 'm';
Most (but not all) compilers will warn about it, but assigning to a string literal is a meaningful operation in C. It fails at execution because you're not allowed to modify string literals, but it's syntactically valid.

ugly


Nobody will be tripped up by that.

What you are doing there is trying to modify read-only data. That essentially boils down to trying to modify memory in the .data section of the executable. It's valid syntax in the same way that my_array[2] = 'm'; is valid syntax.

this isn't near ioccc tier. also to further explain why "hurr durr just don't use that syntax" is not even remotely an argument: even if you don't use some syntax, someone else will. someone will backdoor your code because you're too stupid to properly learn your language but dumb enough to still run code written in it in security sensitive contexts

most programmers will. if you think otherwise you have no idea what you're talking about. most programmers are complete shit, and given that 99% of C programmers say "hurr durr don't use that feature it's evil", they will probably be tripped up by it as well

why are all C tards this stupid? it's like some guy who worked public transportation his entire life and knows all the lingo of his local city transpo and thinks the universe revolves around it

main(){int i;switch(2["hello"+1]=0.3*'m')for(i0)'i';}

2["hello"] = 'm';


Literally the only thing they had to do was to put array sizes on the type. Easily the worst decision ritchie made.

disregard this i just found the new worst language in existence:
blog.portswigger.net/2017/09/abusing-javascript-frameworks-to-bypass.html

...

Guess who's the nigger?

He didn't anticipate CS Grads would want to use the language. It's more logical from the perspective of an assembly programmer where 'arrays' are a social construct. In Java-likes, it makes more sense for the array to be part of the type as the language has to define what an array means to ensure safety.

everything in C is a social construct you nigger. and C hasn't been close to metal for about 20 years now.

Best: Lisp
Worst: BYOND code
Look it up I dare you.

everything in C is a social construct you nigger. and C hasn't been close to metal for about 20 years now.

Wat. There's almost nothing I have to use assembly for anymore. For the few rare instructions that can't be emitted there are __builtins.

come back when you're 13

Nobody should know about the genocides of BYOND code

I'm 39 and I write kernel code, qt. I also helped design PRISM. I sound like I'm impossibly full of bullshit and I get off on your disbelief.

...

Taking me some time to get used to R syntax. Not sure if that's good or bad yet.

JavaScript. Terrible language, but nice syntax.

If you actually knew what you were talking about, you wouldn't just cut a part of my sentence, slap "muh" in front of it and call it an argument. It's syntactically valid. It's not semantically valid. Don't be stupid and write good code. Just because C gives you enough rope you don't have to hang yourself with it.

Yes.

Do they really.... do they really glow in the dark?

No, but it was built with FreeBSD. Cuck license indeed.

I think he's talking about the CIA niggers

Array.prototype.slice.call(document.querySelectorAll("a")).forEach(link => link.addEventListener("click", e => alert("(You) suck cocks."), false));

Shame that the standard functions are named inconsistent as fuck.
t. someone that programs in PHP as his day job

[spoiler]I do actually like the syntax though because it's very C/C++-like. Hate it when languages are whitespace sensitive (e.g.
python)[/spoiler]
What framework do you use user? Laravel?

I know you probably want to LARP or boast about your PRISM faggotry, but am more curious as to what your thoughts on QML are?
I used that shit about two years back and it still seemed too immature to really do anything with. Is it a replacement for QtWidgets yet and is binding QML -> C++ actually something you can do in less than 20 LOC now?

I've not used Qt since around 2003, I dunno. I'm not sure why anyone would consider it today as 2D/3D drawing is no longer the cross-platform nightmare we needed toolkits to solve and if you're too stupid to draw your own buttons you've got plenty of webshit technologies like Electron as well.

owo whats this

if you're not trolling, document.querySelector doesn't reaturn an array, it returns a NodeList that doesn't have the useful array methods on it. Array.prototype.slice.call() turns the node list into an array. You shouldn't use that though. Array.from(...) is better.

C, though not perfect by any means (complex pointers are a pain to define, some operational precedence is weird etc)
Rust, that crap is almost unparsable

And that's just off the top of my head. If you think C is the best, you must have programmed a very sheltered life.

It returns an Iterable you fucking faggot, stop using palememe

well Mr. Smartypants, which language DOES have the best syntax?

Never seen anybody having problems with these.
That's kind of normal, since anything can be inside quotes. Fortunately, no C compiler will finish without an error in this case.
Not that inconsistent, what's painful though, is that there's no binary notation.
Already said.
You mean the 3[array] trick? Nobody cares.
?

Now, there's plenty to say about C (including its syntax) but you should find better.

Plus it lacks stronger typing. And it doesn't help that 99% of shit written in php is terribly botched.

Also, symfony.

Optional braces, default fall-through, and = vs ==, & vs && etc are all responsible for bugs of various severity levels. For example: nakedsecurity.sophos.com/2014/02/24/anatomy-of-a-goto-fail-apples-ssl-bug-explained-plus-an-unofficial-patch/
No, normal would be an unmatched quote being defined as an error. Having it as undefined behaviour is the language designers being lazy.
Fair point, it was a GCC extension that only became part of a language spec in C++14. Hex and octal literals are still inconsistent, and octal literals in particular are a source of errors since it's just a '0' prefix.
Given a function signature in C, there is little information about which parameters are inputs, which ones are outputs, and which are both.

Oh, there's plenty more to complain about. I'm just sticking to issues with the syntax since that's the topic at hand.

uhh, this isn't randomly slapping together a sentence, I meant exactly what I said.
my point was that spouting jargon specific to your little corner of the field as if it makes you somehow valid, makes you sound retarded. see for example these walmart niggers:
reddit.com/r/walmart/comments/67cc50/new_toy_department_manager_and_i_feel_overworked/
C doesn't give you this "rope". You can't just declare two 32-bit variables which you think will go in .data and look at the first one's address +4

no disbelief here

the guy you're quoting isn't me, but there is no best language. they are all the worst. however if we're talking only about syntax, C is by far the worst

If you think C is the best, you must have programmed a very sheltered life.
this

the best part is that people actually still have to use it.

Maybe languages aren't the issue and programmer skill is.

safe languages aren't safe from logic and implementation errors, they're safe from memory exploits you stupid fuck

But holistically, if safety is the goal, hiring whites achieves it, and inventing new sandboxes for Pajeets and Holla Forums does not.

ANY AND ALL PROGRAMMING LANGUAGES THAT ARE DESIGNED PRIMARILY AROUND THE CREATION AND MANIPULATION OF RECTANGLES WILL BE ABOLISHED FOREVER. WE MUST MOVE FORWARD AND LEAVE OUR OLD, RECTANGULAR WAYS IN THE PAST. IT IS THE ONLY WAY WE CAN ADVANCE TECHNOLOGY AS A SPECIES. STOP THIS SINFUL AND IRRESPONSIBLE MANIPULATION OF RECTANGLES, BOXES, AND SQUARES, AT ONCE! HUMANITY DEMANDS IT. THE WORLD CONSISTS OF MORE THAN THE MANIPULATION OF RECTANGULAR JAVASCRIPT WINDOWS AND BOXES. THIS IS AN ABSOLUTE OUTRAGE AND A CRIME AGAINST HUMANITY, GEOMETRY, AND LIFE ITSELF. END THIS SINFUL PRACTICE POSTHASTE.

you need to go back to your containment board, retard.
>>>Holla Forums

...

...

You aren't on the true path.

THE CHOSEN ONE POSTS AMONGST US
BATHE IN HIS FULL ELLIPTICAL GLORY

Follow the path. All lines lead to the same point.

BEHOLD, THE FUTURE OF WEB DESIGN

div.post.reply { border-radius: 50%;}div.thread { border-radius: 50%;}div.boardlist { border-radius: 50%;}div.dropzone { border-radius: 50%;}img { border-radius: 50%;}th { border-radius: 50%;}textarea { border-radius: 50%;}input { border-radius: 50%;}input#auto_update_catalog_cb { border-radius: 50%;}select { border-radius: 50%;}

Choose one.

body *{
border-radius:50%!important;
}

If these people don't get paid at least three times as much as a front-end dev, I don't see the point.

Don't give them any ideas