I love FCC, it explains things (usually…) pretty well and the challenges make me feel like I’m smart and making progress. But it also reminds me of…algebra. Like, yeah it’s really useful but when am I REALLY going to use some of these things?
But…why would I ever need to do that? What situation would capitalizing words be to me? I feel this goes for a lot of the challenges, I’m learning these techniques but not being told why i would need to know them or how they are applied to real situations.
Does anyone else feel this way or have recommendations for places that give real world examples for these kind of things?
The point of the exercise isn’t to learn how to capitalise a string. It’s to give you practice at attacking a problem, planning out how you’ll get to the end result with the tools at your disposal.
What methods should I use here? What am I going to do with this array I’ve created? How am I going to make changes to the elements in this array? These are all things you are learning, the things which will be useful on a daily basis.
Some of the problems set may seem a bit abstract, but try not to focus on that. The algorithm sections of FCC are really excellent, and they’ll give you a great grounding!
The title casing one: formatting user input. Or taking data from a database and building pretty-looking html tables, or spreadsheet headers, or whatever. It’s not an uncommon thing. You couldn’t just use it out of the box though, which gives you a stepping off point: how do you title case properly? Normally in English, coordinating conjunctions, prepositions and articles should not be capitalised unless they are the first or last word in the title. And the rules are different for different languages.
As a rule, most of these little toy tasks, or variations on them, are pretty common in reality
There are many times when I have created websites with text which comes from somewhere else that I do not control. I have to be able to manipulate that text (split it up, splice it with other text), so knowing how to work with various string functions is very important. As far
an example of when you need to know how to capitalize words in a string, I have the perfect example (described below).
My main website work is with real estate companies/agents which keep all of their property listing data in a special databases. For a particular property/listing, there are many different types of information concerning the listing such as price, square footage, number of bedrooms, etc… In one particular database I was working with for a client, there was a field in the database table which contained a list of words/phrases separated by commas which represented extra features of the property (i.e. pool, handicapped accessible, home owners association, etc…). Some of the words were capitalized and some were not, because the field just stored the data how it was entered into it. My client wanted these displayed on a special part of the page and wanted to split the list of words (by comma) so that each word or phrase would be displayed on a separate line with only the first letter of each word or words in a phrase capitalized. So if the field contained the following list:
pool, handicapped accessible, home owners association
it would get displayed as:
Home Owners Association
The FCC challenges are meant to expose you to what is possible, so that when you come across a problem in the “real world”, you will have a better understanding of what can be used to solve the problem.
Wow that’s a fantastic example! Thank you for that! I can definitely see why it would be useful and little things like that make it so much more clear on why we are learning these things. Maybe little tidbits like that as we go through the challenges, like a mini story, would help a lot. Well it helps me at least
I feel like if my brain doesnt know WHY it’s learning something, it kinda shuts off. So this example is fantastic and I will start searching out more real world examples!
So… For some of these challenges (manipulating a string especially), there are lots of real-world applications that match the challenge pretty closely. But that’s not really the point. The purpose of these exercises is learning how to solve a problem. Using your algebra example, you’ll probably never actually be buying 37 watermelons, but the point of that question is to identify what you know, what you need to know, and how to get what you need to know from what you know.
In the real world, databases and APIs come with all kinds of crap data that you will have to fix. Case, format, even replacements are needed.
And you’d be surprised how many times you have to math out things because someone wants something that isn’t just in the data. Oh you needed to combine weather forecasts for a region but we only pay for city data? Gotta build a whole lotta functions for that (that is a very real world example)
And you don’t always get to use libraries. Knowing these things will give the ability to put they puzzle together.