Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Curly braces

Name: Anonymous 2008-04-21 17:12

Why would anyone seriously want to use curly braces to denote scope? Surely significant indentation, or implicit scope based on the surrounding keywords, is far superior.

Also consider this: every time you wish to enter { or }, you must hold down the shift key. That is one extra wasted keypress per scopening and sclosing.

And it just looks messy, like a spastic has been scribbling nonsense all over your screen.

Name: Anonymous 2008-04-22 19:39

>>37
faggot :: String
faggot = "Oh, and semicolons are also fail, when we can\                                                                                                      
         \ do multiline statements with PROPER STRING ESCAPE CHARACTERS!"


PINNACLE OF OPTIMISATION

Name: Anonymous 2008-04-22 19:39

() replaces {}[];,.-> etc etc etc.  Keep it simple.

Name: Anonymous 2008-04-22 19:40

>>41
Whoops. Copying and pasting from gnome-terminal added an extra line.

Name: Anonymous 2008-04-22 19:41

>>40
foo

Function call or variable? YOU'LL NEVER KNOW.

Name: Anonymous 2008-04-22 19:48

>>39
The extra keywords have a superfluous meaning. Brace languages just compound the fail by having both keywords and braces.

It makes no more sense in JavaScript, since it's getting compressed before it hits the wire anyway.

Name: Anonymous 2008-04-22 19:51

>>45
Python and Haskell are superior in this regard. If you're going to indent your code anyway, it's a good idea for that indentation to have meaning. And where you don't want to indent your code, you can use braces and semi-colons.

Name: Anonymous 2008-04-22 19:52

Some of you are just showing how bad at programming you really are. Those long explicit strings in code is just an incredibly bad and faggy practice.

>>40

The symbol for testing equality and assignment is different in some languages because it was easier to write their parser, not because there is some intrinsic value to doing so.

Name: Anonymous 2008-04-22 20:00

>>47

The ability to do an assignment in the conditional of the if statement, like so

if (ptr = new Whatever())
    // handle any possible NULL pointer, such as from insufficient memory


Alternatively,
if ((ptr = new Whatever()) == NULL)

Name: Anonymous 2008-04-22 20:02

>>48
Whoops, meant to have a negative !(...) around the first part.

Name: Anonymous 2008-04-22 20:03

>>48
Before the detractors come, that is actually a useful C idiom, though your second way is slightly more "accepted" (and the compiler won't bitch, either.)

Name: Anonymous 2008-04-22 20:08

>>48

Thats just not good practice. The if statement is actually responsible for assignment, its resposible for chacking the result. Thats 2 different things and should be convey as such in your code. Especially since it makes more sense to assign a value to something at its declaration for many reasons, and because you aren't going to be declaring something in the statement of an if statement.

1. Perform assignment
2. Check the assignment

Grouping it together doesn't produce a more performant execyltable or more readable and maintainable code.

Name: Anonymous 2008-04-22 20:09

>>51

Fuck, that should read:
The if statement is NOT actually responsible for assignment, its resposible for chEcking the result.

Name: Anonymous 2008-04-22 20:20

ONE WORD, FORCED INDENTATION OF THE CODE, THREAD OVER

Name: Anonymous 2008-04-22 20:26

CHACK CHACK CHACK CHACK CHACKING

Name: Anonymous 2008-04-22 20:30

CHACK CHACK CHACK CHACK CHACKING

Name: Anonymous 2008-04-22 20:31

Type Chacking

Name: Anonymous 2008-04-22 21:28

cout << massively << fails << at << life.

Name: Anonymous 2008-04-22 21:38

>>47
The symbol for testing equality and assignment is different in some languages because it was easier to write their parser, not because there is some intrinsic value to doing so.
Not because it's easier for programmers to read and because assignment and tests for equality are unrelated concepts?

Name: Anonymous 2008-04-22 22:00

>>58

It isn't easier to read.

>because assignment and tests for equality are unrelated concepts?

As much as using the + sign is for numerical addition and string concatenation.

Name: Anonymous 2008-04-23 0:10

>>59
No, in the latter case you're still putting two things together. The result is different but the high level concept is the same.

For the record I prefer a separate operator for concatenation, but your statement is still incorrect.

Name: Anonymous 2008-04-23 5:42

aardvarks

Name: Anonymous 2008-04-23 6:00

>>60
It's not incorrect, it's a statement about subjective experience; the easiness of reading. I'm not >>59, btw. I don't like that + with odd polymorphism of taking different types for each argument. String + Number, okay, fine. But statements like foo = String + Number + Number + String confuse me at first glance. I prefer Perl's and PHP's . operator and VB's & operator.

Name: Anonymous 2008-04-23 6:01

This is also why Scheme is superior. SET! is much better than =

Name: Anonymous 2008-04-23 8:46

>>63
set! is just to enable multiple paradigms, it's not meant to be used excessively in Scheme. You know, it's an academic language (like Haskell lol), so it should support more than FP.

Name: Anonymous 2008-04-23 8:48

hax my anus

Name: Anonymous 2008-04-23 10:54

>>62
By "incorrect" I was referring to the statement that concatenation and addition are unrelated.

Name: Anonymous 2008-04-23 10:59

>>66
ambiguity wins again

Name: Anonymous 2009-03-06 7:38

Have native lists and   dictionaries AKA hash   tables are like   bringing a catapult   and chariots to   a battlefield filled   with heavy artillery   and tanks all   while being totally   unaware of how   it can be   done in C   What I mean   maybe there already   exist things that   work differently The!

Name: Sgt.Kabukiman 2012-05-22 23:13

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Name: Anonymous 2013-01-18 23:14

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List