Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Joseph Torres
Joseph Torres
6,166 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
221,328 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,166 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
221,328 Points

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

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