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
The "basic unit" in JavaScript really is the line. You can write js like a shell script, without ever using an object or a function. –  DougM May 6 at 12:22
You might consider using web frameworks which deliver you from the curse of Javascript: HOP, Opa, Ocsigen –  Basile Starynkevitch May 6 at 12:37

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

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 went into more detail in an answer of mine over at OnStartups, but since this site died, I have reproduced in full my answer there below.

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.

Question: What are the most unhelpful startup myths that new entrepreneurs believe?

And my answer was as follows:

Myth: Failure is a the best teacher.

Confucious said:

By three methods may we learn wisdom:

  • First by reflection, which is noblest.
  • Second is by imitation, which is easiest.
  • Third is by experience, which is the bitterest. '

In my experience learning from failure is the hardest subset of experience to learn from, even if you do apply the appropriate reflection after the fact.

Knowing that you have failed doesn't necessarily tell you anything about how not to fail in the future and until you know what best practice is, it is often difficult to tell why you failed at something. I've worked on my fair share of failed projects, and it doesn't matter how many Project Post-Mortems you do, if no-one puts into practice things things you decide should be improved, nothing will change - You will just keep making the similar mistakes over and over.

Research shows that you learn the most from success, and one way to reinforce successful behaviour is deliberate practice, which is part imitation and part reflection. Through deliberate practice you maximise the reinforcement of successful behaviour while you distance yourself from, and thus minimise, the reinforcement of failing behaviour.

A friend of mine used to say "Practice doesn't make perfect, only perfect practice makes perfect!". I didn't understand what she meant at the time, but now I do. It means that if you practice the wrong way, you will only reinforce that incorrect behaviour - only by practising and getting it right, will you end up improving.

Two of the top links on a google search for deliberate practice provide good summaries of why deliberate practice is important in becoming an expert, and also bring up another relevant myth. How Do You Get to Carnegie Hall? 8 Keys to Deliberate Practice references the famous Outliers, by Malcom Gladwell which popularised the Ericsson et. al's research that 10,000 hours of practice is required to become an expert.

Myth: Natural talent counts for more than experience

Deliberate Practice ? Where Self-reflection, Work Ethic and Ambition Meet references Why Talent Is Overrated by Geoff Colvin which insists that the "conventional wisdom about natural talent is a myth.", so this may also be worth discussing with budding entrepreneurs.

share|improve this answer
The answer of yours points to answers.onstartups and and that site is gone. Much of its content has been rehosted at brightjourney.com - but without the title of the post, I can't find it. Could you please update your answer to point to your material (or inline the relevant parts)? –  MichaelT May 5 at 2:28
Since the only copy of the question was on a site with abysmal formatting, I have reproduced my referenced answer in full @MichaelT and also updated it with the broken links. –  Mark Booth May 6 at 12:16

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
} );


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

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