Jump to content


Parentheses Pyramids


10 replies to this topic

#1 Nerd_Skywalker

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 01 April 2011 - 07:54 PM

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:

Posted Image

Any of you have similar ones?
Re-dun-dant adj. 1. See redundant

TheNut said:

"Hmm, yes. Strong is the force with this one"

#2 TheNut

    Senior Member

  • Moderators
  • 1718 posts
  • LocationCyberspace

Posted 01 April 2011 - 09:58 PM

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 [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
http://www.nutty.ca - Being a nut has its advantages.

#3 Nerd_Skywalker

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 01 April 2011 - 10:10 PM

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.
Re-dun-dant adj. 1. See redundant

TheNut said:

"Hmm, yes. Strong is the force with this one"

#4 fireside

    Senior Member

  • Members
  • PipPipPipPip
  • 1616 posts

Posted 02 April 2011 - 03:00 AM

Those are curly brackets also known as braces.
I've never kept count or anything, but I know it's at least 2.
Currently using Blender and Unity.

#5 TheNut

    Senior Member

  • Moderators
  • 1718 posts
  • LocationCyberspace

Posted 02 April 2011 - 04:04 AM

Nerd_Skywalker said:

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:
http://www.nutty.ca - Being a nut has its advantages.

#6 alphadog

    DevMaster Staff

  • Moderators
  • 1716 posts

Posted 02 April 2011 - 07:36 PM

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.
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#7 Nerd_Skywalker

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 02 April 2011 - 09:31 PM

@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.
Re-dun-dant adj. 1. See redundant

TheNut said:

"Hmm, yes. Strong is the force with this one"

#8 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 04 April 2011 - 09:15 AM

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

#9 geon

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 04 April 2011 - 11:21 AM

*facepalm*

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

#10 alphadog

    DevMaster Staff

  • Moderators
  • 1716 posts

Posted 04 April 2011 - 11:27 AM

Well, it's not like more than 3 deep cannot happen evar... ;) But, it shouldn't be the norm, and 14 is very suspicious...
Hyperbole is, like, the absolute best, most wonderful thing ever! However, you'd be an idiot to not think dogmatism is always bad.

#11 Nerd_Skywalker

    Valued Member

  • Members
  • PipPipPip
  • 215 posts

Posted 04 April 2011 - 08:07 PM

Hehe :D
Re-dun-dant adj. 1. See redundant

TheNut said:

"Hmm, yes. Strong is the force with this one"





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users