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 trial

General Discussion

Joseph Torres
Joseph Torres
6,267 Points

Help with understanding the logic or programming concepts

Good morning, as I've been working on the front end track and dabbling in other tracks like C# and Python I have struggled a bit but it wasn't the individual concepts but the logic workflow. I really think this is what is hindering me from success. So for example not only in some HTML(Layout Structure) but in JS, I noticed that there is a way to write syntax out hat I'm not catching. Years ago when I learned Java, there is a set structure when writing JS out that didn't which made it simple. I really hope that someone can understand my dilemma. I really think this is my fork in the road. Is it that I lack understand programming concepts or what??? Thank you

Steven Parker
Steven Parker
229,005 Points

Can you be more specific, and perhaps give examples of the syntax that you are confused by?

2 Answers

Joseph Torres
Joseph Torres
6,267 Points

Hello Mr. Parker, it's not about a specific line of code that I don't get, it's not knowing the way it's written. For example and please understand that it's not that I dont understand the concept of the while loop but a for instance:

var randomNumber = getRandomNumber(10); var guess; var guessCount = 0;

function getRandomNumber( upper ) { var num = Math.floor(Math.random() * upper) + 1; return num; }

As you see above, for someone who's learning this how would they know to nest Math.random() within Math.floor. How would someone know to create a variable for guessCount, guess, randomNumber. How do people who learn any language know how to write out the logic just because they are told to do so in a certain way. I know this may not make sense but it does to me.

Steven Parker
Steven Parker
229,005 Points

It sounds like you're talking about "programming paradigms".

You might see some of that covered in the Computer Basics course.