Blog one-month anniversary

Dearest readers,

Beyond my skeptical expectations, it’s been over a month now and I’m still both doing FCC and blogging. I have to admit to having a week off after finishing JS but I got annoyed at myself for abandoning the opportunities that becoming a developer could bring I’ve dragged myself back to it. I’m both excited and very unsure of the next section which is basic algorithm challenges. This is where you need to start thinking like a programmer.  Which I’m looking forward to. But will also require me to be able to recall or, more importantly, understand the previous lessons… I’ll keep you updated on how each challenge goes, if or when I get them completed. Perhaps with the odd frustrated winge along the way. No. 1 is called “Reverse a String”.

Back on the horse

Well, I decided to get back on Free Code Camp a bit early as I’ve been getting disillusioned with with my text book- Sam’s HTML, CSS and JavaScript. It had started out well and I felt I was getting extra concepts that with FCC but then I started typing out the exercises and realised that there were quite a few concepts that hadn’t yet been explained, or not fully enough in order for me to properly understand what was going on.

So I’ve restarted JavaScript on FCC from the beginning. I ought to get back where I was tomorrow. I can’t totally blame my book though. I’m struggling to retain anything at the moment but maybe that’s just because JS is hard if you haven’t done any coding before at all…or maybe that’s just an excuse and I need to work smarter.

I’ve just rejoined the gym and been going through posts on Pinterest for some motivation.  My favourite is “your speed doesn’t matter. Forward is forward.” Make it so.

A penny drops

Today’s efforts have elucidated a few issues for me. Firstly, arrays. For whatever reason, I hadn’t grasped that they’re packets of information. I was viewing them as sequences of numbers. Rather than seeing the numbers within an array and the instructions relating to that number specifically,  instead its position within the array. So that’s a minor breakthrough for me.

Secondly, the evil FCC exercise that had been eluding me has become 2/3rds understandable. I now understand that:

variable x is initialised at 0 value, runs until the end of array called contacts and involves moving on 1 position after each loop.

Then, if during the loop, a first name matches a first name AND if property matches with a property, then you return the values of x(first name) and the property.

If it takes a subsequent loop and it finds a match just for a first name it returns, “No such property” and if it loops again and doesn’t find anything then “No such contact” is returned.

What I still don’t understand is the useage of ‘.firstName’ and ‘.hasOwnProperty’. I mean, I get what they stand for but I don’t know the use of the dots, nor where the hasOwnProperty bit arrived from. At least I’m not too worried and have a bit of faith that I’ll come across this in my textbook before it’s time to get back to FCC on Sunday.

Meantime, I’m going to watch the Harvard CS50 computing course videos on youtube. I’ve heard it’s really good at explaining how to think like a programmer. Ciao for now!

DUM, DUM, DOM!

Back on the books tonight and the rest of the DOM chapter. It was about using the Document Object Model to make buttons to move your browser back and forwards history-wise, make text disappear and reappear and also add text typed into a box to show further up the page. ‘Dynamically’ as they say. I’ve found the explanations really hard to visualise. While typing out the examples does certainly help, there’s tons of code that I can only hope I’m only meant to have a vague knowledge of rather than actually know off by heart (I hope). Tomorrow should bring variables, strings and arrays so hopefully more familiar territory.

Digital Nomading

Yes, I’m aware I’m getting about 5 years ahead of myself here but I’ve been thinking a lot about the concept of becoming a digital nomad once I’ve been a developer for a couple of years. For the few of you who won’t know, it’s basically working around the world pursuing jobs like in computing, IT, sales, marketing etc which can be done remotely- which is traditionally home working.  Digital nomads pick a country/city then move there for a month or three before moving on to somewhere else like a mac book carrying vagabond. Chiang Mai in Thailand seems to be ground zero with expats seeking a lower cost of living but still with things like wifi. Have a read of this and this and tell me you’re not even a little itty-bit tempted!

I love travelling- although I haven’t been able to for the past few years for health reasons. I spent 5 months in China doing tefl and there isn’t a day that goes by without me thinking about how great it was. I’ve also been to the USA and a good chunk of Europe. Aside from a return trip to China and Berlin, I’d like to see Taiwan, Japan and India. So becoming a digital nomad would seem to be the perfect solution, right?14742438450_7ec9ba4ed4_z

Unfortunately, the more I think about it, the more I don’t think it’s for me. I like my little flat. I have a dog and a mother that I care about deeply and, as time ticks by, I get a bit more edgy at the thought of nipping off round the world for a few years ‘just in case’ something were to happen due to mum’s age. I also don’t make friends very easily and don’t see the ones I do have very often. I’d be throwing that away for more transient acquaintances. I also like working with people. I enjoy office banter and silliness. I wouldn’t get that squirreled away in some hotel room or on my own in a sea of strangers in some co-working space abroad.  I also live in the UK and there’s so much still to see. I’ve not been to the Orkneys or Shetland, Nottingham Castle, Cornwall or Cardiff.

I think my perfect solution would be the opportunity to go abroad for a month or two every year. That way I could get the travel out of the system while having my home comforts waiting for me. Only, I don’t know if I could knuckle down and concentrate when there’s so much to explore. So, unless I couldn’t get a decent office located job and it had to be remote working, I think I’d rather go for something more conventional.

What are your opinions about remote working and becoming a digital nomad? Inspired? Put off? Do you know someone who does it already? I’d love to know.

Diverted

I was meant to be doing more on JavaScript this evening- which I did for a bit- until I developed the irrational notion that I had to jazz up my clock project beyond the bit I copied  learned from the book. So, behold the wonderous borders. Be amazed at the use of a box shadow and blinded by central alignment of my text here. It took me 2 bloody hours of going round in circles losing my alignments and chasing the rectangles around. It won’t win any design awards but it’s as done as I can think to make it right now. I did also learn about wrappers/containers and how to overlap text on a shape so it was a good exercise in itself. However. No more excuses and back to DOMs tomorrow.

Switching causing violent twitching!

The basic JavaScript section continues slowly. It started off with simple addition/subtraction etc. But now has gone into the logic side of things using ‘If’ ‘else’ statements. Now, that’s not too hard if you remember where to put your brackets and semi-colons. Then came a more involved task that involved using a switch statement to create a blackjack decision making tool. These are (slightly) simplified version of if/else which is less wordy but does the same job.  However, the task didn’t specifically say that you needed to use a switch statement. As you needed to go back through the unit to the more basic concepts (pre-switch) it didn’t occur to me that there’d be a problem doing it long-hand.

However, there seems to be a divide between those who successfully managed the job with switch and those who tried to do it otherwise and failed miserably, like myself. For reference/in case you’re interested, here’s the solution.  I tried to redo the task myself using Switch before I totally succumbed to the full answer and I wasn’t using the ++ or — operators. I had understood the task but not the ‘how to’ although the answer does make complete sense. I can only hope that this is a minor hiccup…

This is the answer:

function cc(card) switch(card){ case 2: case 3: case 4: case 5: case 6: count++; break; case 10: case “J”: case “Q”: case “K”: case “A”: count–; break; } if (count > 0){ return count + ” Bet”; } else { return count + ” Hold”; }

Look how tiny and pretty it is!

 

Bootstrap!

Today was Bootstrap day. Bootstrap is like a ready made css file that you can upload to your html. It has lots of pre-made classes for you to choose from. I didn’t find it much easier than doing long-form css but given both are difficult for me right now, that’s probably not a true reflection of what it can do.

I made an other version of my 1st website using Bootstrap this time. I managed to centre text plus use rows and columns to help with spacing. Still nothing to write home about but I’m glad I did it for the practice. Again, you’re missing out on the glorious animated gif and can’t make out the alternative to Lorem Ipsum- Bacon Ipsum that I used. Google them!

Bacon and eggs website snip

 

Bacon and eggs

Screenshot of first website

I’ve just made the most basic of sites using html and css using most of the commands I’ve learned so far. It won’t be winning any prizes for design but it was a good exercise. You’re also missing out on the glorious dancing bacon and egg gif…I made lots of little errors, generally to do with spelling. Unfortunately, just one letter wrong cause big problems. But it only took 1.5-2 hours so it wasn’t bad. Next up: Bootstrap…