Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is silly. It basically amounts to "waaaah I don't know angular!" because they saw funny words I a stack overflow example.

Factories etc., in angular are not the same as the Java equivalents. And you're usually not going to be using providerProviders in your application code, that stuff goes in libraries that, yes, need to be configurable.

Angular is a boon for writing testable, changeable javascript apps. Just because one of the features happens to use words you don't like in java doesn't mean JavaScript is ruined.



I don't think unit tests should dominate the architecture of your applications. I hear this a lot from the angularjs crowd.

I also disagree with architecturing your applications for things that might need to be changed in the future (but probably won't). That is something from enterprise and Java world and a lot of people including myself dislike it. I know people who love it though and that's fine, as long as I don't have to work with them. :)


Yes, most of the code will never change. But some of it will, and it's sometimes hard to predict what that will be. So, to an extent, all of your code needs to be written so it's changeable in the future. It doesn't have to be enterprise java style to be flexible -- just well encapsulated, and testable code helps with that.

Also, it seems like people in this thread who haven't used angular see that word -- factory -- and think of endless crappy java abstractions. You are overestimating the overhead that angular is bringing into your application in this case. A factory is just a component that can be shared between controllers. It's a singleton, like a lot of sharable components in vanilla Javascript applications, just with a defined way of being injected into the controller, and a way of declaring dependencies.

If your problem is with object oriented programming in general well... I can't help you there.


I think one should write testable code,past a certain "size" because somebody sometimes will have to maintain that stuff.

the question is should it be "unit testable" or is it ok just to write integration test.

I think the code you write should be unit testable,doesnt mean the units cant depend of apis you didnt write(while already tested).

should you expose everything for the sake of being able to mock stuffs up?

I'm dont know the answer. to that question.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: