Codeacademy

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

(Actually I've just noticed it's ticked my 2.4 anyway so I may as well just manually go to the next section. Still feeling kind of joyless this week but maybe that's just me.)

I think what first drew me to programming is that I have a very can't-see-wood-for-trees approach: I like building things up line by line and being surprised when I have a forest because, oh, I was totally expecting to have to put some weevils under that fungus, does it really look like a forest already?

but it turns out that when people want to pay you for programming, or when you just want something that does more than amuse you and you alone for an hour or two, you need to look at it from the other end too: the boss wants a forest, what 4 main sections does it need? where are the paths between them? etc. and that's the part I'm not so good at.

also, the part where every year you have to spend your free time learning how to burn your forest down and start over with this year's new, hip kind of trees, because if you neglect to do that for 3 years running you're unemployable.

(I'm not good at metaphors either, you may have noticed)

Schleimpilz im Labyrinth (a passing spacecadet), Thursday, 23 February 2012 23:05 (twelve years ago) link

totally expecting to have to put some weevils under that fungus, does it really look like a forest already?

this might not make sense, so: most of my day job is munging sets of data input by bored, inconsistent humans, and I have SO many times thought "ok, if I do x and y it'll work on 95% of my data, and then I'll need fiddly special case z", and I've done a first pass with x and y only to find that that does in fact cover everything, special case z does not exist in my million records

I realise that if I was building software for anyone else to use all the special cases need covered, because one day someone's going to press the buttons in the wrong order and lose a day's work

(but it's not just a data-wrangling thing, either - when I was a kid I started a crappy 2d platform game, and when I put the jumping code in I just went "uhh for now I'll increment y every frame for 20 frames, then I'll decrement it again, and that's going to suck, but I'll take a look at it before I start worrying about parabolas", but it turned out to have a perfectly adequate jump-feel as it was)

sorry for tl;dr, will shut up and go to bed now

Schleimpilz im Labyrinth (a passing spacecadet), Thursday, 23 February 2012 23:17 (twelve years ago) link

(Chucky Egg did well enough using the increment / decrement thing iirc. and Manic Miner's parabolic jumps looked great but were annoyingly 1 pixel slower than walking)

koogs, Friday, 24 February 2012 08:11 (twelve years ago) link

oh my god so buggy this week. typos, poorly explained lessons, and on 6:2 in recursion you have to reload your browser to get the proper code to work. WTF.

Mordy, Friday, 24 February 2012 14:56 (twelve years ago) link

I didn't have that with 6:2 but I can't get it to OK my final code on the new dice game project even though I'm fairly sure it's doing the right thing

not liking this week's dice game, the instructions are hard to follow and the pre-written code is formatted in a really horrible way with extra line breaks and different tab stops all over the place

I mean I realise that my score on this is basically a meaningless number, damn my completist need to have 100% on every course

Schleimpilz im Labyrinth (a passing spacecadet), Friday, 24 February 2012 22:48 (twelve years ago) link

i now have two projects that aren't at 100% bc it doesn't clear like one or two lessons. driving me OCD-crazy

Mordy, Friday, 24 February 2012 22:50 (twelve years ago) link

update: in my quest for completeness I copied someone else's code from the Q&A section, except I didn't realise they'd replaced all the <s with LESS_THAN to get through the Q&A html rewriter, so it didn't run and gave me a syntax error... and the green tick I wanted

ffffuuuu etc

Schleimpilz im Labyrinth (a passing spacecadet), Friday, 24 February 2012 23:00 (twelve years ago) link

ok, for that OCD green tick, it looks like you can clear all the code in the final part of the project and hit run with a blank code window and get a "That's correct!"

I suggest you put your code in the clipboard before doing so just in case I'm wrong, of course

Schleimpilz im Labyrinth (a passing spacecadet), Friday, 24 February 2012 23:06 (twelve years ago) link

I would just like to be Uncle No-Fun and point out that if you ever find yourself in the real world typing (as you do in this week's assignment)


myVariable -= 0.1;

then you might want to think of other ways to represent your data

(because computers store everything as binary, they're OK with fractions where the bottom half is a power of 2. so a half is fine, three quarters is fine, five eighths, nine sixteenths: all OK. but they can't build up a tenth out of those fractions, the best they can do is add up ever more teeny fractions with a power of two on the bottom to get something approximately the same as 1/10.

that's probably OK if you just want to store 0.1 now, because the discrepancy is very tiny and the computer will brush it under the carpet and not tell you, but once you start repeatedly adding and subtracting 0.1s the difference gets bigger and bigger until you have a "rounding error" and suddenly all your sums are wrong or a loop doesn't finish when you think it's going to, etc.

yeah, that was quite boring. but, just saying.)

instant coffee happening between us (a passing spacecadet), Monday, 5 March 2012 22:56 (twelve years ago) link

(i actually had something very similar last night - adding items to a TreeSet and it thinking .99903 and .99904 were the same thing and refusing to add the second item (or replacing the first with the second or whatever it does. wasn't drawing one of my squares is all i know). i ended up multiplying everything by 10000. fixed point for the win...)

koogs, Tuesday, 6 March 2012 09:37 (twelve years ago) link

three weeks pass...

Is anyone still doing this? I just started it today - I've been at a new job for 3 weeks now and I have to get into Javascript (and CSS/HTML5/PHP and other webby stuff I have no idea about) so I figured I should do this in my spare time to get up to speed a bit.

In the Time Trials project there's an exercise where they change:


var totalTime = 0;
for ( i = 0; i < raceTimes.length; i++ ) {
totalTime = totalTime + raceTimes(square bracket)i(square bracket);
}

to:


for ( i = 0; i < raceTimes.length; i++ ) {
var totalTime = (totalTime || 0) + raceTimes(square bracket)i(square bracket);
}

saying it's cleaner and more efficient. This seems wrong to me, cleaner is arguable but how is it more efficient? Surely it's less efficient to have to do "or with 0" every time it loops than to not do that? Am I missing something?

The Eyeball Of Hull (Colonel Poo), Saturday, 31 March 2012 17:35 (twelve years ago) link

i would always use the former. and += in the loop.

that var in the second one just looks like a scope error to me.

koogs, Saturday, 31 March 2012 18:52 (twelve years ago) link

It looks like trying to be clever just to use fewer lines of code.

The Eyeball Of Hull (Colonel Poo), Saturday, 31 March 2012 18:55 (twelve years ago) link

yeah, that second bit of code is just ridiculous. it's good that youre already able to catch stuff like that

if i were trying to be clever and save 1 line of code, i'd write it like this:


for ( var i = 0, totalTime = 0; i < raceTimes.length; i++ )
{
totalTime += raceTimes[i];
}

diamonddave85, Saturday, 31 March 2012 19:05 (twelve years ago) link

that var in the second one just looks like a scope error to me.

I thought that at first but javascript doesn't have block scope, only function-level scope

and I can see absolutely no reason why their code is efficient or anything other than horribly ugly

(re "is anyone still doing this", I did half of last week's and like 20% of this week's and am wondering if I can be bothered any more)

instant coffee happening between us (a passing spacecadet), Saturday, 31 March 2012 19:22 (twelve years ago) link

Second one might be marginally faster, but trying to wring every ounce of speed out of a piece of Javascript isn't worth it. If execution speed was the main issue, you wouldn't be using Javascript in the first place. And it makes the code harder to read, never a good thing.

beanz meanz lulz (snoball), Saturday, 31 March 2012 19:29 (twelve years ago) link

> but javascript doesn't have block scope, only function-level scope

ok, didn't know that.

but it feels a lot like they are teaching javascript specific stuff that'll fall over in other languages and i think that's a bad idea.

(fwiw i don't like the initialisation (or incrementing) of anything other than the loop index in the for() - too easy to overlook. plus the mix of , and ; bugs me)

koogs, Saturday, 31 March 2012 21:35 (twelve years ago) link

and i'd save a line of code by having the { on the same line as the for 8)

(but only in java / javascript, in c (c++ / php) i'd have it as you have. lots of personal preferences, not all of which i can explain)

koogs, Saturday, 31 March 2012 21:37 (twelve years ago) link

I am slowly converting myself from { on the next line to on the same line. Don't really know why, especially when I held out from it even when I was writing a little Expect/tcl on the side, which will actually not sodding work if you put the braces on a new line and will give a super-cryptic error message to boot.

still don't like
} else {
but it doesn't really leave you any other option, so

(I mostly write Perl when I am not writing VBA, which doesn't have block braces, or swearing at Codecademy)

instant coffee happening between us (a passing spacecadet), Saturday, 31 March 2012 22:11 (twelve years ago) link

{ on next line till i die

makes brace matching a cinch (i suppose some smartarse will suggest i shouldn't be nesting that many braces) plus the extra white space makes things more readable imo.

God arrives for the apocalypse, having been traveling at the speed of (ledge), Saturday, 31 March 2012 22:18 (twelve years ago) link

{ on the next line, because it makes braced languages look more like white-spaced languages, and therefore easier to pick out blocks/see scopes by eye.

beanz meanz lulz (snoball), Saturday, 31 March 2012 22:21 (twelve years ago) link

i spent way too much time today getting a deck object for blackjack to work. finally realized that splice always returns an array, and trying to treat the one-element array that i was getting like the object contained within it was what was giving me all the errors.

circles, Sunday, 1 April 2012 05:58 (twelve years ago) link

is there one of these for iOS? gonna make a fb-integrated pictionary rip and ship it for $200mil to zyngas

༼◍ྀ ౪ ◍ི ༽ (cozen), Tuesday, 3 April 2012 20:40 (twelve years ago) link

good idea

lag∞n, Tuesday, 3 April 2012 20:49 (twelve years ago) link

i just tore through the html exercises to refresh my memory, took me all of 15 minutes. css is apparently forthcoming, could use that refresher too.

in the meantime javascript has taken a backseat to SQL, which is the one that might get me hired given what i'm shooting for.

BIG HOOS aka the steendriver, Saturday, 7 April 2012 05:37 (twelve years ago) link

two weeks pass...

1. Further to discussion upthread, found this about why it's a good idea to get in the habit of keeping the { on the same line as preceding code in javascript: [Removed Illegal Link]/
(if anyone is going to say that this makes JS a pretty lousy language, along with tcl which I was complaining about upthread for the same reason, well, yeah)

2. I am two weeks behind on codecademy, have I missed anything or just another 4 versions of the same old recursive function tutorials?

3. I signed up for udacity's CS101 which has just restarted for a new semester with (apparently?) no deadlines this time around, because I wanted to learn Python, and holy hell does this seem time-consuming - each week's unit is 40 short videos plus 20 multiple choice questions plus homework, and even though the videos are all only 1-5 minutes long and we haven't covered anything I didn't already know yet, it took me all afternoon to watch the first half of week 1's videos

(I was waiting for an email and, OK, ILXing a little in between videos, but still)

instant coffee happening between us (a passing spacecadet), Sunday, 22 April 2012 22:14 (twelve years ago) link

what do you want to know re: python?

Philip Nunez, Sunday, 22 April 2012 22:24 (twelve years ago) link

Bah, let's try that link again: [Removed Illegal Link]/

Philip: nothing specific really, I mainly just felt like dabbling. I write Perl for a living now, as does most of the team I'm in, and Perl obviously has a reputation as kind of old-fashioned, and the other dev team here uses mostly Python, so that's the most obvious new language to look at.

Yes, there are lots of books and ebooks and online tutorials, and I've bookmarked and downloaded probably tens of them already and never read them, so I thought having videos beamed into my home weekly might motivate me to do something...

(Also I liked the idea of building a search engine. I probably could build a basic one in a super-kludgy and horrible way in Perl, but I assume the course is going to do it in a much neater way.)

instant coffee happening between us (a passing spacecadet), Monday, 23 April 2012 13:43 (twelve years ago) link

[Removed Illegal Link]/

instant coffee happening between us (a passing spacecadet), Monday, 23 April 2012 13:44 (twelve years ago) link

[Removed Illegal Link]

instant coffee happening between us (a passing spacecadet), Monday, 23 April 2012 13:45 (twelve years ago) link

I have no idea what is wrong with the link. http://bit.ly/I0h90Z ?

instant coffee happening between us (a passing spacecadet), Monday, 23 April 2012 13:47 (twelve years ago) link

"Placing opening braces on the same line as their corresponding control statements like that is called K&R style."

that's exactly wrong, and the link he puts on 'K&R' says as much

koogs, Monday, 23 April 2012 14:07 (twelve years ago) link

oh, ok, in the third example they mention "Variant: 1TBS"

koogs, Monday, 23 April 2012 14:08 (twelve years ago) link

I write Python for a living, but I learned it on the job, so I haven't any experience in tutorials as such, but some people seem to like "Learn Python The Hard Way".

The Eyeball Of Hull (Colonel Poo), Monday, 23 April 2012 15:54 (twelve years ago) link

spacecadet, if you know perl, python will be a breeze. an easy project I'd suggest is making a CGI script that reads in an ILX page and replaces all instances of the word 'DUMPLINGS!' with something else. check pleac.sf.net for python versions of things you are familiar with in perl

Philip Nunez, Monday, 23 April 2012 18:19 (twelve years ago) link

Also doing the udacity thing, v intrigued by their stated goal of the learning equiv of a CS degree.

BIG HOOS aka the steendriver, Monday, 30 April 2012 21:43 (twelve years ago) link

i haven't checked it out, but most CS programs don't teach you very much programming, so...

Philip Nunez, Monday, 30 April 2012 21:58 (twelve years ago) link

four months pass...

do people really stick with this?

it gets frustrating pretty fast

what's wrong with this code?

for (var i=100; i<=150; i++)
var square = i*i
if (i % 2 = 0)
{console.log(i);}
else
{console.log(square);}

the late great, Sunday, 23 September 2012 11:48 (eleven years ago) link

something fishy on line 3

the late great, Sunday, 23 September 2012 11:48 (eleven years ago) link

i want even numbers 100-150 and squares of odd numbers 100-150

100, 10201, 102, 10609, etc

the late great, Sunday, 23 September 2012 11:49 (eleven years ago) link

Probably should be if i % 2 == 0.

Or strictly === 0

Colonel Poo, Sunday, 23 September 2012 12:35 (eleven years ago) link

ah i forgot about those fucking ========

the late great, Sunday, 23 September 2012 12:48 (eleven years ago) link

8======>

A.R.R.Y. Kane (nakhchivan), Sunday, 23 September 2012 12:49 (eleven years ago) link

why don't they have a sidebar that says

"parts u will need: {, %, ==, etc" so i don't have to root around like a pig for answers in forums

took me long enough to remember the modulo

the late great, Sunday, 23 September 2012 12:49 (eleven years ago) link

The for loop also needs braces.

Claudia Schiffer Kills Frog (Leee), Sunday, 23 September 2012 21:17 (eleven years ago) link

three months pass...

anyone still doing this?

Does it have C#?

let's bitch about our stupid, annoying co-ilxors (darraghmac), Tuesday, 8 January 2013 16:09 (eleven years ago) link

I dipped in when they added Python, but I'm not really "still doing it".

No C#: it has Javascript, Python, Ruby, and web stuffs (HTML, CSS, jquery). Think I finished the JS and the Python, dipped into the HTML/CSS but got bored early on, haven't tried jQuery or Ruby.

a panda, Malmö (a passing spacecadet), Tuesday, 8 January 2013 16:18 (eleven years ago) link

I need to get into this again got lazy/busy

if anyone wants to join me for python it's easier w/ a motivation buddy

iatee, Tuesday, 8 January 2013 16:30 (eleven years ago) link

I still need to do the jQuery & CSS ones. Job responsibilities currently more based in Python & SQL which I've been using for years, but will be doing more front end work in a couple of months so I need to get up to speed soon.

Just noise and screaming and no musical value at all. (Colonel Poo), Tuesday, 8 January 2013 16:58 (eleven years ago) link

I did a bunch of the Python lessons and I learned a lot, but they're all user submitted, and vary wildly in quality. Some of them are so broken that it's impossible to tell when you did everything right and the parser is still refusing to accept the code, or when you did something wrong but the parser accepts your bad code anyway. It reminds me of having, like, an incompetent community college teacher working from a good book.

Dan I., Saturday, 19 January 2013 21:40 (eleven years ago) link


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