Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
alpox
@alpox
function factorial(n) {
    if(n <= 1) return 1; // Termination / end condition
    return n * factorial(n - 1);
}
You define them upfront to prevent the recursion at the step you need it to stop
Matthew McClure
@m-mcclure
@moT01 thanks
CamperBot
@camperbot
m-mcclure sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 899 | @mot01 |http://www.freecodecamp.com/mot01
Christopher Susi
@chrisandsuch
@alpox wouldn’t that first return n take you out of the function before return n * factorial(n - 1);?
alpox
@alpox
@chrisandsuch Yes thats exactly the point. But it returns n out of the function only if n is smaller or = 1
Christopher Susi
@chrisandsuch
@alpox probably looking at that wrong, my eyes are tired from going through some lessons
alpox
@alpox
@chrisandsuch So that condition does not hold for if you give in 5 as example.
In that case you don't return 5;. You return 5 * factorial(4);
In the next recursion call it calls return 4 * factorial(3); then return 3 * factorial(2) then return 2 * factorial(1); then 1 <--- end condition
Christopher Susi
@chrisandsuch
@alpox oh yeah! I see it now. Thanks for the help. Wow that is really creative. I never thought about writing a function like that.
CamperBot
@camperbot
chrisandsuch sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
:star2: 1443 | @alpox |http://www.freecodecamp.com/alpox
alpox
@alpox
@chrisandsuch In some programming languages thats the way you do all looping :D
Its very expressive actually
But for the beginning, hard to think about and track
Christopher Susi
@chrisandsuch
@alpox I can’t wait till I finish reviewing some css stuff. I should be getting to the javascript stuff soon. When you were just starting out how long did it take for that type of thinking to become natural?
alpox
@alpox
@chrisandsuch Sorry, i cannot really tell :D better ask that kind of thing other people here :-) i'm programming for 9 years by now and it just so happened in between all that :D
I started out with object oriented programming though and got into more functional programming a bit later. I did some recursive stuff, but not very deeply
Christopher Susi
@chrisandsuch
@alpox thats inspiring. I’m really a beginner with some previous learning mixed in. Most of the time when I’m writing some code I feel like I can do more but its a confidence issue. Always has me second guessing myself for some reason. I’m working to try to get through that.
@alpox thanks for the great conversation. gotta take a break but i’ll be back in a couple mins
CamperBot
@camperbot
chrisandsuch sends brownie points to @alpox :sparkles: :thumbsup: :sparkles:
api offline
alpox
@alpox
@chrisandsuch no problem :) im off to bed
dinesh
@1532j0004kg
happie morning coders..?
Christopher Susi
@chrisandsuch
@1532j0004kg hello. Where are you from? Its night here in tx
CamperBot
@camperbot
chrisandsuch sends brownie points to @1532j0004kg :sparkles: :thumbsup: :sparkles:
:cookie: 259 | @1532j0004kg |http://www.freecodecamp.com/1532j0004kg
dinesh
@1532j0004kg
i am from india
where u from
Christopher Susi
@chrisandsuch
@1532j0004kg I’m from Texas in the USA. Whats the weather like there? Its getting cold here.
@1532j0004kg favorite programming language?
dinesh
@1532j0004kg
i am just learning program.
here rainny...what about the weather in ur place..?
whats ur fav?
Christopher Susi
@chrisandsuch
@1532j0004kg starting out can be frustrating at times but stick with it. Its been cloudy the last few days. Fav is hard to say. They all have their own unique way of building on the basic concepts. Going to bed. Night
BladymirL
@BladymirL
Hey guys, I just finished the Jquery section and I'm on build a tribute page. Would you guys recommend to read the bootstrap documentation? I feel like I understand what HTML elements to use for what, however it feels like I struggle trying to figure out how to get things on the page where I want them (eg: I want the picture in the center)
Isaiah Trembley
@IsaiahCT
now
BladymirL
@BladymirL
Should I just use basic HTML / CSS and mess with padding / divs for this project? or should I try to be using bootstrap as much as possible
Isaiah Trembley
@IsaiahCT
you don't really need to
Codepen had the bootstrap built in processor
I mean, you should to know what to do.
also, just experiment where you want things to go
that is what all coders do, experiment and test
BladymirL
@BladymirL
Gotcha, so I guess I should just review the previous classes/lessons, and try to just use that to the best of my ability?
Ken Haduch
@khaduch
@BladymirL - it's good to get the basics down - there are a lot of things implemented in bootstrap. The most helpful features for the basic tribute and portfolio pages are the grid (row and column classes) text centering, and a handful of other things. Stick with the basics that freeCodeCamp covered in the lessons, good to review those. Then use Google search and ask questions like "centering text and images in Bootstrap". Sticking with Bootstrap V3 and making sure that you get the appropriate information related to that version is my recommendation - that is what the lessons are based on. That should get you started. Then, put questions and code in here and ask for help when needed. But spending some time trying to figure it out on your own will help with the learning efforts. Good luck!
Kevin K. Lee
@kevinkiklee
i highly suggest not using bootstrap, and using vanilla css with flexbox. bootstrap is a dying framework. i have been a software engineer for the past 6 months or so, and i have never seen it, nor heard of anyone planning to use it. meanwhile, flexbox is the most important skill in css.
however, it just might be the area i'm in. but no matter what, flexbox is something you will use for a long long long time, and bootstrap (and any other css frameworks) is something that's eventually going to fade away.
heroiczero
@heroiczero
@chrisandsuch https://www.codewars.com/ this is a nice resource. If you just keep on coding it becomes second nature. Sometimes, it is good to go back and read some books too. Here is a site that has some free books, https://github.com/EbookFoundation/free-programming-books. If there are bugs or something, To debug, I go through my code in blocks and check if each block of code works as intended with console.log().
Long Nguyen
@longnt80

@kevinkiklee

meanwhile, flexbox is the most important skill in css.

I'd add CSS grid for your grid now. This is the proper tool to build your grid.