Routing II: Correct Code, Says it's wrong


#1

Hi,

I was working on AngularJS and go to the second part of Routing. I have had this happen before, but I entered the code and was told it was wrong. Then, when I got the correct code, it was exactly the same, give some spacing/tabbing differences.

The question: Does the number of tabs truly matter in AngularJS?

I have attached the two pictures below.



#2

I don't believe they do.... In programmming languages (Except for Python) Tabs and Spacing are just used to make you code more readable, as are comments. I think the reason it didn't work the first time and worked the second time is because CodeCademy does it's own little checks to see if your code is correct, and it must've been a part of that

Regards,
Barry Allen


#3

The code in the 2 images is not the same. Look at the .when part of both(line 9).

In the first you have:____.when('/photo/:id', ... incorrect
In the second you have:_.when('/photos/:id', ... correct


#4

I am sorry, i think i will disagree with you!
Spacing means quite a deal, most especially in programs like Python and these spaces are called “INDENTATION”. there is a two and four way spacing. some languages are so sensitive that they will give you an error or tell you that the problem is to indent your codes well


#5

Yes, but we are not talking about Python.


#6

Yes, that’s just an example. I am saying it is generic, but more sensitive in other programming language such as Python as an example.
it makes coding neater no doubt, but it is also part of different program’s generic rule which varies from one language to another.

Cheers.


#7

If we were talking about Python then that be a correct story. Unfortunately, we are talking about AngularJS. AngularJS barely has any rules about indentation. There is no need to argue about indentation rules in a language that barely has any.


#8

bro i give up! nobody is arguing here, its just an expression of opinion!!
I thought it might be helpful.

Happy coding!!!