Return Entire Thread First 100 Posts Prev 100 Next 100 Last 50 Posts Report Thread Style: Yotsuba, Pseud0ch, Terminal

Pages: 1-40 41-

Curly braces

1

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.

2

a spastic has been scribbling nonsense all over your screen.

3

spastic

4

OP, do you use PYTHON?

5

You know, in HASKELL we have OIOC.

6

Oriental and India Office Collections

7

OP uses VB.NET

8

>>6
Optional indention of the code, asswipe.

9

I find it easier to type {} than []

10

>>8
I know what you meant, you windowlicking cumslurper.

11

() > {}

12

>>1
Pythonista
>>2,3
same person and we have been trolled constantly
>>4,5,8
Haskellite trollee
>>6,7,10
Troll
>>9
Seppler
>>11
Lisper

13

>>12
You are incorrect, I am a Seshrupper. Also, stop trolling me.

14

>>12
You are incorrect, I am a Pythonista. Also, stop trolling me.

15

Any language you can't do things like
[cod€]if (!connected(node1, node2));
        alternative_algorithm = 1;
[/code]
Isn't worth coding in. Remember, every time you trip your fellow programmers up, they're reminded that you're smarter than they are.

16

>>15
Oh my. I don't think I've ever failed at BBCode quite this way before.

17

>>16
Yes, you did fail quite hard.

18

lmao @ cod€

19

if (!connected(node1, node2));
        alternative_algorithm = 1;

20

>>19
eight spaces is PIG DISGUSTING

21

if (!connected(node1, node2));

22

[cod€]
Test
[/cod€]

23

>>22
What did you expect?

24

>>15

[cod€] is now a [spoiler][b][i]MEME[/i][/b][/spoiler]

25


(when (connected node1 node2)
  (alternative-algorithm))

wins.

Also, this thread is now about the perversity of ";" terminators and "_" in variable names.

26

>>24
What the fuck, shiichan. What the fuck.

27

>>26
You sure fucked that one up.

Protip: nest your tags

28

>>25
Yes, yes. I agree with both of those.

29

>>26
Blame the Canadians and their crazy euros.

30

>>12
I am the same person, Also we have been trolled constantly

31

>>1

Just
    Use
        Python

32

>>31
[b]DON'T HELP HIM[/b]

33

>>32
HOW DARE YOU MAKE A MISTAKE WHEN COMMUNICATING WITH EXPERT PROGRAMMERS, #1) you can't even use IRC well; #2) you can't tab-complete; #3) you can't google - this implies yer too busy jerking off and sucking soda or video-gaming. Die well, kid

34

I like braces, they help you to know where each statement starts and ends.

I always put the curly brace under function and class, but put it to the right of for, while, if, etc.

I also use style 3 of indentation.

35

>>34
Then you might as well not bother having curly braces if you use a consistent style of indentation.

36

C style dialects are made of fail. The suck-tax just make it easier on parsers, not on the programmers.

Brackets, case sensativity etc. All fail.

if(..){
}

vs

If .. Then
End If

Oh noes! I typed 9 extra charachters! Well, actually if you aren't using some fail IDE you can specify an if statement in 3 charachters.

37

>>1

Public Class Nigger
    Public Function Faggot() As String
      Return "I'm a huge nigger faggot!" & _
          " Oh, and semicolons are also fail, when we can" & _
          " do multiline statements with UNDERSCORES!"
    End Function
End Class

38

>>36
Extra keywords are just a poor substitute for having a way to group code.

39

>>37

You are correct. Semicolons are huge fail. Multiline statements are the exception not the rule. So forcing one to type a semicolon after every line, when only a few of their lines are going to be multiline is true fail.

>>38

The extra keywords at least have an explicit meaning. Where braces have no meaning other than something is ending (the starting brace does have an obvious meaning as it follows the keyword of whatever is starting). If you want to make it convey an obvious meaning (as in what exactly it is ending) you need combine it with spacing, or another popular trick is to use comments, fail). Python has shown us that spacing can be used to group code, and it does so without the braces because the spacing inherent to braces makes the braces redundant.

The only language where braces make sense is JavaScript on a webpage because of download performance concerns.

40

>>1
>>36
>>39

Public Class Nigger
    Public Function Faggot() As String
        Return "I'm a huge nigger faggot!" & _
            " Oh, and semicolons are also fail, when we can" & _
            " do multiline statements with UNDERSCORES!"
    End Function

    Public Sub DickButt(ByVal OP As Poster)
        If OP = FAGGOT Then
            MessageBox.Show("God damn I'm a faggot!  And look" & _
                ", the same symbol for testing equality as the" & _
                " one for assignment, based on where in the code" & _
                " it appears!  Fuck yeah DeVry University expert" & _
                " programming degree!",
                "EXPERT PROGRAMMER OP", MessageBoxButtons.OK, _
                MessageBoxIcon.Exclamation)
        End If
    End Sub
End Class

41

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


PINNACLE OF OPTIMISATION

42

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

43

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

44

>>40
foo

Function call or variable? YOU'LL NEVER KNOW.

45

>>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.

46

>>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.

47

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.

48

>>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)

49

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

50

>>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.)

51

>>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.

52

>>51

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

53

ONE WORD, FORCED INDENTATION OF THE CODE, THREAD OVER

54

CHACK CHACK CHACK CHACK CHACKING

55

CHACK CHACK CHACK CHACK CHACKING

56

Type Chacking

57

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

58

>>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?

59

>>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.

60

>>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.

61

aardvarks

62

>>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.

63

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

64

>>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.

65

hax my anus

66

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

67

>>66
ambiguity wins again

68

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!

71

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

72

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


Newer Posts

Name: Email:
73
Entire Thread Last 50 Posts First 100 Posts Thread List Report Thread