Is Javascript for Calculations or Design?

Been working through FCC Javascript. Struggled and took a break to read “Javascript for Absolute Beginners”, which has been a big help as of halfway through it. But all JS I’ve learned so far is calculation/logic-based, whereas what I find looking for “best JS websites” are all interesting interactive design (vs calculation/input-output focus).

I’m getting an understanding of these logic problems eventually. But I was liking CSS/HTML better- am I wasting my time pursuing JS if I’m more interested in presenting info creatively rather than doing various calculations?

I would say that Javascript is like the logic part of the web design. Here in FCC, at beginning you are not applying the javascript to the web, but it will be very useful at the moment. Just imagine, you wan’t to apply some logical operations, and you want to decide what content to show, its like… sometimes you want to show “Hello BCarlso”, but sometimes you would want to show another name.
Javascript will be useful for not making a static webpage; Another great plus, is that if you don’t know programming, the challenges will teach you, and that knowledge will be soo useful when learning another programming languages, and that might be useful in back-end.

If you insist on skipping javascript, I think that the only challenges section that you can work on is Bootstrap on Front End Libraries Certification; but I insist, if you skip Javascript, you won’t be able to take advantages to the other material that is GREAAT for building amazing webpages.

1 Like

if the web browser were a stage, the HTML is the actors, the CSS the costumes, and the JS is the stage-hands. Way thin analogy, I know, but work with me.

The HTML can be present, and presented, with absolutely no CSS or JS. Naked actors on a bare stage. Looks silly, but it works.

Adding purely css, a LOT changes. To see what I mean, take a look at csszengarden. Everything there is purely HTML and CSS – actors and costumes.

But behind the scenes, adding another dimension, is the js. It can allow you to fetch data from the back-end (for example, if you’re writing a multiplayer game, the server can tell you if another player just took their turn), and it can use that data to manipulate the actors (HTML) or their appearance (adding and removing CSS classes is a GREAT JS skill, and with CSS transitions looks impressive as HELL). It is used to dynamically hide or show elements, based on interaction with other elements. Yes, it does the maths, the calculations, but don’t knock that. JS does a great job with ragdoll physics in (for example) the Phaser library.

Do you need JS? depends. Do you want interactivity and complex operations? Then yes.

A lot of the lessons in FCC involve manipulating text, or numeric data. The reason? Easy to hook into and test. But all the lessons here are purely a springboard into bigger things. This here, is just the very tip of the iceberg. This is the “business logic” – it may help you in the job market. You’re interested in a bit more specialized area, and that may take a little more research on your part.


Thanks for the feedback! Sounds like Javascript is worth struggling through- definitely willing to do that, just that the challenges in JS have not felt like they are the type of thing I am good at or sparks my interest and was worried about it just leading to more of the same. But sounds like I can use the base of knowledge in various directions- glad to hear it. Thanks again.

I think @snowmonkey is spot on.

Sometimes when going through the lessons it’s hard to see the big picture and figure out what can this do for me. I can turn your question around a bit and do a Google search on ‘what can javascript do for my website’. Rather than quote the results I’ll let you type it in and read what you get. I found the second hit from Quora very informative.

On a personal note, I was bored last week and my ex plays the US based lottery games. The way she gets her numbers is to tape each of the numbers onto a penny and put all the pennies in a jar and then pull from that. I thought I could improve on that. Creating the HTML and CSS portions were easy. The hard part was deciding how I wanted to choose the random number using JS. Do I use the Math object to select the number from an array? Do I create an array and then scramble the numbers and select the first set? Do I create an array and then scramble the array and then use the Math object to select each number from the scrambled array. Do I just use the Math object to select an array of numbers? The hard part was deciding how I wanted to do it but it all boiled down do an easy JS function.
Without JS I would have had a site for lottery numbers that didn’t do anything. And when all was said and done the site is heavier in HTML than it is in JS.

Happy with that I decided I wanted to play a game and that game was rock-scissors-paper-lizard-spock. Again, JS as a factor. I actually wound up with two different ways of coding this. But again, without JS I wouldn’t have a site.

I’m not going to put in links to any of the things I’ve written. I don’t want to hijack your post. I just wanted to expand a little on what @snowmonkey said. With a little reverse engineering you can find my stuff on GitHub.

I’ll summarize and say, do the Google search I stated earlier and I think you’ll see it’s worth the effort to pursue JavaScript.

1 Like

For creative, interactive front end design you will need to use a lot of CSS, HTML and JavaScript together. The reason you’re getting a lot of design results when you search “best JavaScript websites” is because these websites are likely using a front end design library like Angular, React or Vue.

Take a look at the React Boilerplate Project on JSFiddle for a quick and easy example of the three working in unison to present a simple todo list.

Same as above, just bear in mind that JS is just a tool, and the shiny UI examples are a result of applying that tool. It’s the same as most skills, for example learning a musical instrument. You can play very basic stuff without knowing scales, techniques, finger movements, etc, but to actually be any good, you generally need to slog through those boring bits until they become automatic. A programming language is different in that you can treat everything as a small logic puzzle to be solved, but

Is Javascript for calculations or design

Well, it’s just for calculations, it’s a way of telling the computer, in human-parseable language, how you want to move 1s and 0s around in its memory. It is algebraic logic. You take some data, and you transform it into some other data.

1 Like

@bcarlso1 Basically HTML describes the structure of the web page and CSS determines the look and feel of it. But if you want to program the behavior of the webpage you need JS. It controls the how page works.
Also various frameworks used to build web apps use JS as their programming language so if you are interested in building web apps then JS is mandatory.
Hope it’ll help you. Thank you :slight_smile:

One of the newer and more powerful ways to use javascript to interact with your HTML and CSS involves a game framework, Phaser.js – it’s a very powerful game library built in javascript. It will let you do all the cool graphics and animations and “intersection detections” and things that you’re looking for, but there’s a hitch. Always, there’s a catch.

If you jump from knowing some HTML and CSS and maybe a smattering of javascript into trying to learn Phaser, you’re going to become very very discouraged, very very quickly. It is a GREAT library, gives a LOT of flexibility, but it requires a good solid working knowledge of javascript.

I just got an email, indicating that codecademy has added a Phaser course in their curriculum, may be of interest to you, but I would strongly recommend that you get comfortable with javascript itself. The things you’re learning at FCC may seem pointless and “math-y” to you, and they are, but they also teach you about the language itself, which is surprisingly powerful and robust.

Learn the language, then branch out into specifics. I’ve been playing with Phaser for a little while, and in all honesty, it both frustrates me and makes me giggle. Frustrates me, because I’ve been a developer for a very long time and I KNOW this stuff. Giggle, because I can very easily (with a little attention to details) create very cool game ideas.