Codeacademy

Message Bookmarked
Bookmark Removed
Not all messages are displayed: show all messages (254 of them)

I think that's a deliberate policy to get people in the habit of using === unless they're absolutely sure they want ==, which can cause some hard-to-find bugs

a lot of JS tutorials seem to be doing that now (I last used JS in like 2003 but decided to brush up on the basics a bit last year to do some HTML5 Canvas stuff)

quite tempted to try this tonight instead of doing some homework which is due tomorrow

(I also code for a living but my skills are very out of date and I'm stuck in an obscure (not difficult, just not resulting in any transferrable skills) rut at work. I can either be scared of this when in 5 weeks' time there are 250,000 new people who know just as much as I've been getting by on in paid jobs for a decade - and yes, I do think that's possible - or I can at least look at it myself...)

Schleimpilz im Labyrinth (a passing spacecadet), Tuesday, 10 January 2012 18:56 (twelve years ago) link

it's pretty good, I really like the site and its mission. Granted, I already know basic programming, but I'm curious to see how far this goes.

Nhex, Friday, 13 January 2012 00:06 (twelve years ago) link

ok, I've never heard of === before, is it just a Javascript thing?

*Checks Wikipedia*

Aha, I see: The languages JavaScript and PHP extends this syntax, with the "==" operator able to return true if two values are equal, even if they have different types (for example, "4 == "4"" is true), and the "===" operator returning true only if two values are equal and have equivalent types as well (such that "4 === "4"" is false but "4 === 4" is true).

questino (seandalai), Friday, 13 January 2012 00:32 (twelve years ago) link

huh, i thought == checked for type as well

Nhex, Friday, 13 January 2012 03:41 (twelve years ago) link

i couldn't figure out the && thing, so i just used i % 15 = 0. kinda felt like i was cheating.

i will admit to feeling legitimately proud of myself when i was able to make fizzbuzz work for a variable that you enter. looking forward to the next lesson...

and you are a part of everything and everything is like melting (ytth), Saturday, 14 January 2012 06:21 (twelve years ago) link

well the prob is you haven't covered 45 and 60 and 90 and stuff!

just make a separate if statement that looks like

if ( i % 3 === 0 && i & 5 === 0)

put it before the fizz and buzz statements, and make them else if statements. i think that's how i did it. i rewrote it to use nesting later.

call all destroyer, Saturday, 14 January 2012 14:52 (twelve years ago) link

oops that last & should be a %

call all destroyer, Saturday, 14 January 2012 14:52 (twelve years ago) link

oops that last & should be a %

call all destroyer, Saturday, 14 January 2012 14:52 (twelve years ago) link

Wait, is the thing of not covering 45 etc directed at ytth? Because those numbers are divisible by 15, so they should come up as FizzBuzz.

Has everyone else had a go at the Java courses? Haven't had time to look at those.

emil.y, Saturday, 14 January 2012 17:44 (twelve years ago) link

i went back and played around with it after reading the thread and was able to make it work with the &&. but yeah, emil.y is right - if it's divisible by 3 and 5, then it will be divisible by 15, so the program told me i had done it right - i just felt like there was a more elegant way.

i did the 'functions in javascript' course, but i didn't like it - it seemed like a refresher that would be good for someone that was already familiar with this, but just needed some tips on how to avoid bugs in their code.

and you are a part of everything and everything is like melting (ytth), Saturday, 14 January 2012 18:01 (twelve years ago) link

oh yeah; i suck at math

call all destroyer, Saturday, 14 January 2012 20:00 (twelve years ago) link

doing this from scratch - i learned a little C++ about ten years ago and lol HTMl at around the same time but i'm half considering taking courses so hopefully this gives me half an idea what i'm in for

til the power failure (darraghmac), Sunday, 15 January 2012 18:26 (twelve years ago) link

Had a rough week but was able to finish the first lessons this morning. It was okay; I haven't done much beyond basic html before (unless you count basic and logo back in grade school), and this made some sense. Felt more like I was parroting than learning, but it was only week 1.

EZ Snappin, Monday, 16 January 2012 14:22 (twelve years ago) link

yeah, tbh i felt like i was filling in blanks but couldn't write the same code from scratch or anything- i may go over the first lessons again.

modric conservative (darraghmac), Monday, 16 January 2012 14:31 (twelve years ago) link

finished for this week!

Mordy, Wednesday, 18 January 2012 04:17 (twelve years ago) link

it's def getting harder

Mordy, Wednesday, 18 January 2012 04:17 (twelve years ago) link

If I want to recommend this to people how exactly do I do it? Like, just point them to the courses page, or is there a separate week-by-week thing?

Gravel Puzzleworth, Sunday, 22 January 2012 13:52 (twelve years ago) link

Wait wait nevermind it's codeyear not codeacademy! Got it.

Gravel Puzzleworth, Sunday, 22 January 2012 13:57 (twelve years ago) link

Did first half today. Dice game this week?

Mordy, Wednesday, 25 January 2012 04:34 (twelve years ago) link

i am finding bits of this insanely confusing - in lesson 5 of "functions in javascript" there's this bit where you're supposed to look at the code and predict the answer and though i knew the likely answer i just couldn't work out what the code was doing to get it

i.e. how does

var result = 1;
for (var i = 0; i < exponent; i++) {
result = result * base; }
return result ;

even work?

like: if you have defined result as 1, what enables it to recognise that 'result' is capable of being a number that is not 1?
would it break if you changed the fourth line of the above to

result * base = result;
? and would that be because you're departing from conventional order or because that order screws the maths up?

what a difference delay makes (c sharp major), Wednesday, 25 January 2012 12:34 (twelve years ago) link

result is a variable (hence "var") which means its value can change.

it would break if you changed the fourth line, not because of maths but because of the syntax of assigning a value - you can't assign a value to an expression like that.

The Eyeball Of Hull (Colonel Poo), Wednesday, 25 January 2012 12:49 (twelve years ago) link

i.e. the interpreter will read the line left to right, syntax being variable = expression, not the other way round.

The Eyeball Of Hull (Colonel Poo), Wednesday, 25 January 2012 12:49 (twelve years ago) link

ok, that does help.

another reason the above flummoxed me utterly: it took me forever to remember what 'i' was (i kept thinking 'integer', which is not useful).

what a difference delay makes (c sharp major), Wednesday, 25 January 2012 12:55 (twelve years ago) link

tbh I don't much like this syntax

for (var i = 0; i < exponent; i++) {
because it's not very intuitive, but it crops up all over the place. You get used to it eventually I guess.

The Eyeball Of Hull (Colonel Poo), Wednesday, 25 January 2012 12:59 (twelve years ago) link

Legacy syntax derived from C.

tinker tailor soldier sb (silby), Wednesday, 25 January 2012 13:07 (twelve years ago) link

Loosely speaking, being on the left-hand side (LHS) of the "=" in an assignment and being on the right (RHS) mean very different things. The RHS is used to compute a value (e.g. the current value of result multiplied by the current value of base) and the variable on the LHS is updated to take that value. The value of the LHS before the assignment plays no role at all, and it doesn't make sense to put result * base on the LHS because that's not a variable you can assign a value to.

Angrrau Birds (seandalai), Wednesday, 25 January 2012 14:33 (twelve years ago) link

i did the functions lesson and new york, new york thing yesterday. trying to catch back up this week.

mostly it went well, i'm a little confused about using return within a function to check if a condition is true or not but that's ok.

call all destroyer, Wednesday, 25 January 2012 14:43 (twelve years ago) link

this week starts with a really great review of all topics. it helped clarify a bunch of things for me.

Mordy, Wednesday, 25 January 2012 15:00 (twelve years ago) link

So I'm doing this. I took poorly taught C++ classes in high school (and basically haven't used it since), so a lot of the stuff is pretty familiar so far. JavaScript does seem pretty loosey-goosey with variable types. Using + in console.log() to combine strings and numerical variables really bugs me.

circles, Thursday, 26 January 2012 05:17 (twelve years ago) link

whoa u guys hi

BIG HOOS aka the steendriver, Thursday, 26 January 2012 06:14 (twelve years ago) link

i am now in

BIG HOOS aka the steendriver, Thursday, 26 January 2012 06:14 (twelve years ago) link

man i've been scratching the surface of python the last couple of weeks and i just realized i was trying to solve the first question in python

lol

BIG HOOS aka the steendriver, Thursday, 26 January 2012 06:21 (twelve years ago) link

Do it in both and examine how your solutions differ!

I haven't looked at this really but I am following this thread and will try to answer questions ppl have.

tinker tailor soldier sb (silby), Thursday, 26 January 2012 06:26 (twelve years ago) link

My day job is Python, among other things. If you get stuck on anything I can probably help out.

The Eyeball Of Hull (Colonel Poo), Thursday, 26 January 2012 09:26 (twelve years ago) link

Woo. Finished the dice game. I think they're becoming much better at explaining concepts and teaching the material. Last week was a mess but this week was really intuitive and even fun.

Mordy, Thursday, 26 January 2012 18:33 (twelve years ago) link

Now, I did the dice game by using if/else statements (which is how they want you to do it). Can you do it using 'switch' cases tho?

Mordy, Thursday, 26 January 2012 18:36 (twelve years ago) link

err I'm getting on this tonight, I swear

iatee, Thursday, 26 January 2012 18:40 (twelve years ago) link

IM me if you need help... just did the Startup project too.

Mordy, Thursday, 26 January 2012 18:50 (twelve years ago) link

haha yeah I prob will, getting stuck on one thing killed my momentum

iatee, Thursday, 26 January 2012 18:51 (twelve years ago) link

I think I used switch for the dice game. Definitely used it for something this week that was expecting if/else. I like doing the tasks in a different way to the one asked for, to see what the checker does and doesn't find acceptable.

I'd be interested to see the back-end for the checker - it's clearly not just checking the output, but it's happy for things to be done in different ways. Dunno if each exercise has a list of automated test values or if it's doing something more clever that I might understand if I hadn't slept through compilers class. (end geeky side-note)

(I write Perl and, ahem, Excel VBA for a living, but dabble with more closely javascript-resembling languages occasionally in my spare time for graphical tinkering, though it will not be many more weeks before my knowledge of JS itself is exhausted)

Schleimpilz im Labyrinth (a passing spacecadet), Thursday, 26 January 2012 19:03 (twelve years ago) link

> Now, I did the dice game by using if/else statements (which is how they want you to do it). Can you do it using 'switch' cases tho?

you can't really use switch for comparing a variable against another variable (for checking the doubles) - the case values have to be known at compile time. ifs are better here.

(there might be more to the dice project that i missed - i only skimmed it)

koogs, Thursday, 26 January 2012 19:56 (twelve years ago) link

That's what I was thinking. I couldn't figure out how to get it to evaluate the relationship between the two dice rolls.

Mordy, Thursday, 26 January 2012 19:57 (twelve years ago) link

finished this weeks - building the blackjack game was fun, but some of the planning stuff was a little wonky. little bugs here and there...

Mordy, Wednesday, 1 February 2012 02:54 (twelve years ago) link

also, it seems like there are odds problems with the way they have it set up since you have an equal chance of getting a face card and getting, say, a '9' card, when getting a card that equals '10' should happen 4 times more often than getting one that equals '9'

Mordy, Wednesday, 1 February 2012 03:05 (twelve years ago) link

haha the thought of doing something like that intimidates me, is it pretty step by step?

iatee, Wednesday, 1 February 2012 03:07 (twelve years ago) link

yes, definitely

Mordy, Wednesday, 1 February 2012 03:11 (twelve years ago) link

i think there are positive and negative aspects w/ this as a learning style. individual things seem easier to learn, but it's hard to keep them together in your head. I think they could benefit from mixing up the lesson styles. maybe have one part that's just super repetitive to get stuff in your head like math problems, another part where you really have no guidance and it's a bigger puzzle, etc.

iatee, Wednesday, 1 February 2012 03:27 (twelve years ago) link

like, why not throw a video lecture in? etc.

iatee, Wednesday, 1 February 2012 03:28 (twelve years ago) link

nobody in the world has any idea how to teach programming. There is a big computer science education conference every year where CS profs get together and propose new and different ways of teaching programming. Software engineers complain that people graduate with CS degrees without knowing how to work on a big project. People who learned to program entirely on their own and never went to college assume that everybody should be able to do the same. It's just really hard to learn and really hard to teach if you're not predisposed to it.

tinker tailor soldier sb (silby), Wednesday, 1 February 2012 03:33 (twelve years ago) link

so presumably these folks just guessed a way of teaching it like everybody else and decided to see if it works

tinker tailor soldier sb (silby), Wednesday, 1 February 2012 03:36 (twelve years ago) link


You must be logged in to post. Please either login here, or if you are not registered, you may register here.