Parentheses Pyramids

B2d356f97a3d0dec8ae2d8c1e1fa1c2d
0
Nerd_Skywalker 101 Apr 01, 2011 at 19:54

I’m bored so here’s another pointless thread :)

Do any of you guys have any really tall curly bracket pyramids in your code? I have a 14 high one as my record :lol:

parenthesis-2.png

Any of you have similar ones?

10 Replies

Please log in or register to post a reply.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Apr 01, 2011 at 21:58

Tsk tsk tsk… You chose to post a 49,162 byte image, in JPG format… not even PNG, which would have compressed better and look better, but ALSO when the equivalent tag would have consumed far less. This is unbelievable… I.. I.. no, I can’t say it.. It’s to much. I need to unplug now.. 6A757374 206B696464696E67 [code] tag would have consumed far less. This is unbelievable… I.. I.. no, I can’t say it.. It’s to much. I need to unplug now..

6A757374 206B696464696E67

B2d356f97a3d0dec8ae2d8c1e1fa1c2d
0
Nerd_Skywalker 101 Apr 01, 2011 at 22:10

I thought it looked better as a picture :D

But you are also correct about me posting a jpg as opposed to a png. I am ashamed of myself. Allow me to fix it.

A638aa42130293f319eda7fa4ba121f4
0
fireside 141 Apr 02, 2011 at 03:00

Those are curly brackets also known as braces.
I’ve never kept count or anything, but I know it’s at least 2.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Apr 02, 2011 at 04:04

@Nerd_Skywalker

I am ashamed of myself. Allow me to fix it.

You know I was kidding right? :lol:

As for myself, I think the longest I ever went was a triple loop, so 3. More than that and I’m doing something wrong :blink:

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Apr 02, 2011 at 19:36

Nesting more than three levels is definitely a potential “code smell”.

It could be a combination of how you approach your tests (test for the exceptional, not the normal) and/or a method that can be refactored into more focused code.

B2d356f97a3d0dec8ae2d8c1e1fa1c2d
0
Nerd_Skywalker 101 Apr 02, 2011 at 21:31

@fireside: D’oh!

@TheNut: Dang it! Well the quality was pretty low ha. I am known as “Sheldon” by some of my friends :)

@alphadog: I probably should fix it, but it seems to be working right now and I just need it for a little while.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Apr 04, 2011 at 09:15

> Nesting more than three levels is definitely a potential “code smell”.

I have 5 levels of nested if:s right now. I don’t like it, but it’s at least pretty clean. Error handling in php… I’ll not discuss code smell and elegance any further, or I’ll depress myself.

820ce9018b365a6aeba6e23847f17eda
0
geon 101 Apr 04, 2011 at 11:21

*facepalm*

I found out just now that php actually has exceptions since version 5.0. Now I feel stupid.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Apr 04, 2011 at 11:27

Well, it’s not like more than 3 deep cannot happen evar… ;) But, it shouldn’t be the norm, and 14 is very suspicious…

B2d356f97a3d0dec8ae2d8c1e1fa1c2d
0
Nerd_Skywalker 101 Apr 04, 2011 at 20:07

Hehe :D