tags:

views:

57

answers:

4

How picky is JavaScript and Jquery when it comes to good programming technique and correctness? Specifically What I mean is, I got some custom code to work and do basically what I want it to do but I'm sure that if any decent developer saw my technique they would have a major WTF moment.

I'm not a good developer by any stretch, in fact I'm a tester. I break code and when I code, I do things in a way just to get them to work through pure brute force and tenacity. When i'm actually programming, I kind of throw and mash a bunch of statements together until they work.

I know this is a horrible way of doing things, but I have a horrible memory and I am not that experienced.

I normally "mash" and "hack" libraries together until they resemble what I want to achieve.

Is this crazy behavior accepted and accommodated for?

+2  A: 

So you're basically asking if horrible "mashed and hacked" code is acceptable? What answer do you expect? ;)

No - it isn't accepted.

However, if the code is syntactically correct, JS or jQuery will not tell you that your code sucks. Your coworkers might have something to say about it, though.

Jani Hartikainen
i'm my own co-worker on this, so that isn't much of a problem ;) . My code does suck but I guess if it works it works right? I'm just prototyping.
egfx
+1  A: 

hmmmm....

Invest in some more intentional programming methodologies; you can do it with some studying of tutorials, reading books, following blogs and practice. It will save you hours and add to your lifespan by reducing your frustration level.

Now, if you're looking for a forgiving language if you decide to continue with your current mode of doing things Javascript is not it. It will either simply not work or it will work in ways that you don't intend. Find a language with an excellent debugger to work you through the pain of trial and error (a staticly typed language like Java, C# or VB) if you refuse to get any type of programming experience to help yourself out...

...and btw, this behavior is neither accepted nor accomodated for in the realm of development...

Tahbaza
A: 

You may want to make yourself aware of JavaScript's semicolon insertion behavior

anthony
A: 

Sorry I asked :)

But thanks for the link, and it did lead me to this article

http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/

Development is not easy for me.. I have a wondering mind.

egfx