Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I went from C=64 Basic and assembler to FORTRAN and C to C++ and Java. Professionally I started in Visual Basic for applications then to Visual Basic 4, 5, 6. After that VB.NET AND C# with some Java here and there. I have played with Ruby and Python and found both fun.

During each step I never felt like I had to forget what I had learned before. I always felt like I was just learning better and/or slightly different ways of doing things but the difference was not major. The difference was like the difference between American, Australian and British English. (Maybe assembler was Latin and FORTRAN was Spanish.)

But now I am using JavaScript to do real, actual work. (Before used it as a "Scripting" language pure a simple.) And I just feel like I have to forget some things to become proficient in it. It feels like some old Egyptian language.

What should I forget? Is it just that code organization is different (no real classes so no one class one file)? Or is it something more basic?

*Edit. Even though closed I think the few answers provided have been very helpful. I thought about it today and looked at, and wrote, some code. I may be wrong but I think the major things are:

  1. Scope is not to be so tightly controlled or maybe it can't be as tightly controlled? Anyway I can't think of scope in JavaScript as I do in class based system. I have to forget those ideas.

  2. Classes/Interfaces are not the basic unit of functionality. Not sure what is the basic unit actually is yet (the function? the prototype? TBD) but at least I know not to try to think about classes. (This is probably the basic one.)

share|improve this question

closed as not constructive by Jim G., Mark Trapp, gnat, Walter, Doc Brown Mar 19 '12 at 19:37

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Everything that you know, like and find useful about modern programming languages... forget it :) The main difference that I've found is that it's an interpreted language. vb, java, c#.. all compiled languages and strongly typed. Javascript on the other hand... a new kettle of fish. –  LachlanB Mar 19 '12 at 1:51
    
first of all : forget jQuery. –  teresko Mar 22 '12 at 0:23

4 Answers 4

what you should forget is how functions work in OO languages. JavaScript functions are first class members of the language. So what does that mean? Well you can use functions for composition. For example if you have an array and want to select only the elements that meet some test you don't need an explicit loop, but can write a test function and use the array filter method to do that.

share|improve this answer
    
That is hardly unique or absent in many OO languages. VB.Net, C#, Ruby, and Python all have that kind of ability out of the box, and C++0x also includes it. –  Chris Pitman Mar 19 '12 at 6:37
    
True, but in many cases people don't know or use it very well. Hell even recent versions of PHP have higher order functions –  Zachary K Mar 19 '12 at 6:48
    
@Chris. Yes but the focus is always on the class. The function is there generally to support the class (and the objects that are created from classes). –  ElGringoGrande Mar 20 '12 at 0:21

I don't see why you feel you need to forget anything. Knowing things in Fortran dosen't hurt your knowledge of JavaScript. Just make sure you make a conscious effort to write actual JavaScript rather than hacked together scripts. Its natural to find it hard at first when your used to another language, just practise a lot and care about writing the best possible code.

As an aside, try understanding the scope of JavaScript as early as possible. Its very odd but very powerful.

share|improve this answer
    
+1 for scope. The idea of scope and how it is used is a pretty big thing. In Java/VB.Net/C# you find yourself using scope to express how classes are supposed to be used. I don't think this is as true in JavaScript. So I do need to forget something. (Forgetting is a form of learning. Probably the hardest part of learning is forgetting.) –  ElGringoGrande Mar 20 '12 at 0:24

Depending on what kind of use you are putting javascript to, you might have to get used to either using a queue function as an overarching design principle, or the use of inline functions as callbacks.

Great examples are node.js and JQuery. Both event driven.

$(document).ready( function( ){
    // do some magic
} );

Or

process.on( "SIGHUP", function( ){
    // reload config
} );
share|improve this answer

Trying to learn what things not to do is generally counter-productive.

It is much better to reinforce behaviour you want through deliberate practice than to try and avoid behaviour you don't want.

I go into more detail in an answer of mine over at OnStartups.

Also, since you already know Javascript syntax, you may find that a book like JavaScript: The Good Parts Unearthing the Excellence in JavaScript might be more useful than a general Javascript book. The authors video on youtube should give you a good idea of what you can expect from the book.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.