13 Replies - 903 Views - Last Post: 05 April 2019 - 02:54 PM

#1 Nwb   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 98
  • Joined: 11-November 18

Bottom-up Approach VS Top-down Approach?

Posted 28 February 2019 - 10:48 PM

Can somebody please give me a small example of Top-down vs Bottom-up? I know what they are, but I need an example, even a small one would do. Like in terms of writing a program with a programming language, what would be the difference to using either approaches?
Is This A Good Question/Topic? 0
  • +

Replies To: Bottom-up Approach VS Top-down Approach?

#2 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 976
  • View blog
  • Posts: 3,849
  • Joined: 13-June 14

Re: Bottom-up Approach VS Top-down Approach?

Posted 28 February 2019 - 10:50 PM

Are you talking about the two approaches to doing TDD or something else?
Was This Post Helpful? 0
  • +
  • -

#3 Nwb   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 98
  • Joined: 11-November 18

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 02:54 AM

Two approaches to solve a problem, yas. One (top-down) relies on breaking the problem into pieces and the other (bottom-up) apparently relies on "building pieces"? I'm not able to imagine programming situations for 'em.

This post has been edited by Nwb: 01 March 2019 - 02:55 AM

Was This Post Helpful? 0
  • +
  • -

#4 NeoTifa   User is offline

  • NeoTifa Codebreaker, the Scourge of Devtester
  • member icon





Reputation: 4449
  • View blog
  • Posts: 18,977
  • Joined: 24-September 08

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 08:39 AM

Bottom up: you have a general idea, code the thing, then requirements based on how it works, given that the working functionality is cool with business. More Agile. So, you know you have to make a web page, so you'd make the base html, header, footer, etc based on existing functionality then tweak it to do what business thinks they want.

Top down: every little itty bitty thing is written in requirements first and you have to code exactly to spec. More waterfall. You code what business tells you and only what business tells you, having mainly to regard new functionality, and might have to tweak existing stuff to match the exact req's.

This is my interpretation of the terms. Could be completely wrong. I hope this is what you're asking?

This post has been edited by NeoTifa: 01 March 2019 - 08:39 AM

Was This Post Helpful? 0
  • +
  • -

#5 h4nnib4l   User is offline

  • The Noid
  • member icon

Reputation: 1366
  • View blog
  • Posts: 1,943
  • Joined: 24-August 11

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 09:22 AM

Is that like face down, bottom up?
Was This Post Helpful? 4
  • +
  • -

#6 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2249
  • View blog
  • Posts: 6,877
  • Joined: 15-January 14

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 09:49 AM

Depending on the client, it can feel substantially similar.
Was This Post Helpful? 3
  • +
  • -

#7 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11473
  • View blog
  • Posts: 19,536
  • Joined: 19-March 11

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 10:30 AM

Top-down would be an approach where you start by writing a high-level function that solves a problem, and assumes the existence of supporting functions. You then fill in the supporting functions, which might require support functions of their own, and continue until all of your support functions are implemented. Typically you would "stub out" the functions whose existence you're assuming, for example returning a static value or otherwise indicating that the function has been called, and then replace the stubbed implementations with real ones.

Bottom-up would an approach where you assume you'll need some low-level function and write it, then write a function that makes use of that low-level function, and so forth until eventually you have a high-level function that solves the problem you originally were interested in.
Was This Post Helpful? 2
  • +
  • -

#8 NeoTifa   User is offline

  • NeoTifa Codebreaker, the Scourge of Devtester
  • member icon





Reputation: 4449
  • View blog
  • Posts: 18,977
  • Joined: 24-September 08

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 March 2019 - 12:43 PM

Yeah I'm bad at this lmao. I'm so nervous for my interview on monday then. v_v
Was This Post Helpful? 0
  • +
  • -

#9 Martyn.Rae   User is offline

  • The programming dinosaur
  • member icon

Reputation: 555
  • View blog
  • Posts: 1,436
  • Joined: 22-August 09

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 April 2019 - 12:29 PM

So what do we call starting in the middle and working middle downwards and middle upwards - a kind of middle-top-up-down approach?
Was This Post Helpful? 0
  • +
  • -

#10 h4nnib4l   User is offline

  • The Noid
  • member icon

Reputation: 1366
  • View blog
  • Posts: 1,943
  • Joined: 24-August 11

Re: Bottom-up Approach VS Top-down Approach?

Posted 01 April 2019 - 02:04 PM

I think we call that "sandwich action"...
Was This Post Helpful? 1
  • +
  • -

#11 gameroo   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-April 19

Re: Bottom-up Approach VS Top-down Approach?

Posted 05 April 2019 - 08:54 AM

And what approach do you guys use? Does the top-down approach makes most sense for me only?
Was This Post Helpful? 0
  • +
  • -

#12 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14929
  • View blog
  • Posts: 59,615
  • Joined: 12-June 08

Re: Bottom-up Approach VS Top-down Approach?

Posted 05 April 2019 - 08:55 AM

Seems a number of folk gave their approach opinion. ;)
Was This Post Helpful? 0
  • +
  • -

#13 andrewsw   User is online

  • quantum multiprover
  • member icon

Reputation: 6777
  • View blog
  • Posts: 27,953
  • Joined: 12-December 12

Re: Bottom-up Approach VS Top-down Approach?

Posted 05 April 2019 - 09:10 AM

I prefer a bit of both, although, mainly top down.

Outline the whole, main, application in some way.

Build some scaffolding with mainly empty namespaces classes and methods.

I then like to try and build towards a class and method that I suspect to be a challenge. This challenge might cause me to reconsider some of the architecture.

In an ideal world...
Was This Post Helpful? 0
  • +
  • -

#14 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5378
  • View blog
  • Posts: 14,286
  • Joined: 18-April 07

Re: Bottom-up Approach VS Top-down Approach?

Posted 05 April 2019 - 02:54 PM

Honestly I do both and have found that the best approach. Much like what andrew has been saying. I think top down to take a large problem and break it up, then a bottom up approach of creating supporting functions that will solve the pieces I broke down. There is an advantage to this...

1) Most people think top down when they approach problems in general. You think in "steps" to do something. This helps you get an idea if you have everything you need.
2) Bottom up is implementing the small steps to support the bigger steps and "fill in the details"
3) You can test the bottom up stuff from a unit testing perspective, but then test from the top down in the integration testing

I find that if you go all one way or another you run into difficulties and things don't always get implemented the most efficiently.

:)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1