Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSeth Warner
5,348 PointsSo whats the difference between using auto increment and just increment. What will happen Differently by typing
by typing $corn_chowder = $corn_chowder +1;
Vs typin
$corn_chowder++;
so my question is why would someone choose one way, over the other.
Seth
1 Answer
Caleb Frieze
29,582 PointsHonestly, it's preference. I think it is preferred to use $corn_chowder++ because it's less redundant. I personally also think it's more readable that way. Especially if I am reading someone else's code. Hope that helps!
Seth Warner
5,348 PointsSeth Warner
5,348 PointsSo if you like using $corn_chowder++ how would u increase in an increment of 5? Or in that case would you have to use $corn_chowder = $corn_chowder +5;
Caleb Frieze
29,582 PointsCaleb Frieze
29,582 PointsActually you can do $corn_chowder++5 in that case. Or whatever amount you want to increment by.
Seth Warner
5,348 PointsSeth Warner
5,348 PointsNice! Thank u