Codeacademy

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

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

seven months pass...

hi i love learning

im going to be learning this stuff in classes over the next few months.

would it, iyo, be worth bashing my head off these courses first or am i best off just absorbing it in real times at college

"Asshole Lost in Coughdrop": THAT'S a story (darraghmac), Monday, 2 September 2013 14:26 (ten years ago) link

Blow through the official courses to get the gist, then mess around with the user-created code for a more significant hands-on experience. I'm not yet a 'coder' but I made some progress getting the mental framework together using this method.

shaane, Monday, 2 September 2013 17:46 (ten years ago) link

tks will give it a blast (if i get time)

"Asshole Lost in Coughdrop": THAT'S a story (darraghmac), Tuesday, 3 September 2013 10:46 (ten years ago) link

It's probably a good introduction to the mindset but your actual course may have a more pedantic focus so some of the more "this just works" aspects may need unlearning again afterwards, or not - depends a lot on the course.

What is the official title of your course and do you know what languages it'll be using?

(If it's called Computer Science it may be pedantic and hands-off; if it's called Information [___] Technology it may be hands-on, get-stuff-done-quick; if it's Software Engineering it may be hands-on but still pedantic; Informatics could be anything. These distinctions aren't made v. rigorously in the UK compared to in the US though, dunno about Ireland but may well be the same.)

also you will hate the lame jokes and Monty Python references throughout Codecademy but you'll probably hate everything 98% of your fellow students think is funny too so maybe it's good practice for that.

the supreme personality of Godhead : a summary study (a passing spacecadet), Tuesday, 3 September 2013 11:18 (ten years ago) link

it's a higher diploma in computing, i bleev it specifically says computer science here and there

"Asshole Lost in Coughdrop": THAT'S a story (darraghmac), Tuesday, 3 September 2013 16:47 (ten years ago) link

reading around the subject is always good.

koogs, Tuesday, 3 September 2013 17:02 (ten years ago) link

Yeah, reading is good, sorry if I made it sound like it isn't.

Udacity's CS101 is OK (course materials are at https://www.udacity.com/wiki/cs101/downloads if you don't want to sign up - can't remember if you can see the youtubes without signing up) and brings up more concepts that you'll probably see on your course, but on the other hand there's something to be said for Codecademy's more fun and more hands-on approach too.

PS I am a serial CS-then-ICT dropout so actually probably the worst person to take the advice of

the supreme personality of Godhead : a summary study (a passing spacecadet), Tuesday, 3 September 2013 18:13 (ten years ago) link

three months pass...

i'm doing the ruby section of this for fun and it really is fun. but i blew through like 60% of what's available in a short time. what is one to do next to make progress?

sent from my butt (harbl), Friday, 27 December 2013 22:18 (ten years ago) link

three weeks pass...

I'm doing this! Since it's been 10+ years since I had a programming class, I'm going all the way back to the beginning. I mean <em><strong>ALL</strong><em> the way back.

Karl Malone, Saturday, 18 January 2014 16:53 (ten years ago) link

can you have friends on this thing? harbl, be my friend!

Karl Malone, Saturday, 18 January 2014 16:53 (ten years ago) link

sent from my butt (harbl)
Posted: December 27, 2013 at 10:18:29 PM
i'm doing the ruby section of this for fun and it really is fun. but i blew through like 60% of what's available in a short time. what is one to do next to make progress?

build a websyteeeeee

lag∞n, Saturday, 18 January 2014 16:55 (ten years ago) link

i hope someone at codecademy is reading the funny stuff that i'm writing when they ask me to write paragraphs and stuff like that. seriously there's been some comedy gold, hope they're checking it out and laughing

Karl Malone, Saturday, 18 January 2014 16:57 (ten years ago) link

youre the one theyve been waiting for

lag∞n, Saturday, 18 January 2014 17:00 (ten years ago) link


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