Bojack_human's blog

By Bojack_human, history, 4 years ago, In English

Why do programmers visualize/draw trees upside down? why root is not at the bottom?

  • Vote: I like it
  • +72
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +224 Vote: I do not like it

To distinguish from actual trees.

»
4 years ago, # |
  Vote: I like it +270 Vote: I do not like it

Hmmmm, it is pretty interesting question. I think the reason why we draw them upside down is the fact that we have not seen real trees.

»
4 years ago, # |
  Vote: I like it +92 Vote: I do not like it

What do you mean by upsite down? Don't trees look like that irl too?

»
4 years ago, # |
Rev. 3   Vote: I like it +34 Vote: I do not like it

Cause we programmers know our responsibility towards the environment and we don't cut real trees recklessly just for our selfish motive of solving problems. Hence we only use artificial trees that differ significantly from real trees.

»
4 years ago, # |
  Vote: I like it +206 Vote: I do not like it

In order to draw them starting from leaves, you would need to compute all depths first to know where to draw each vertex.

»
4 years ago, # |
Rev. 2   Vote: I like it +43 Vote: I do not like it

Same reason (in most cultures) we write top to bottom

»
4 years ago, # |
  Vote: I like it +87 Vote: I do not like it

hardwood-tree-400x266.jpg
I couldn't understand what you're talking about. Doesn't this look realistic?

»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

May be programmers visualize the roots instead of the brunches of a tree.

»
4 years ago, # |
  Vote: I like it +81 Vote: I do not like it

False. They are not upside down. Real trees are the ones which are upside down.

»
4 years ago, # |
  Vote: I like it +16 Vote: I do not like it

i was about to ask the same question, why are trees upside down irl

»
4 years ago, # |
  Vote: I like it +14 Vote: I do not like it

we write and read things top-bottom, i think i feels natural and easy to do same with trees

»
4 years ago, # |
Rev. 2   Vote: I like it +8 Vote: I do not like it

.

»
2 years ago, # |
  Vote: I like it +17 Vote: I do not like it