This is a question I've had in the back of my mind for awhile now, not specific about any one language but just in general. I've programmed in languages that are object-oriented to the extreme, like Java and C#, and also languages like JavaScript, Python, VBA, and (as I found out yesterday) AutoHotkey; this second group of languages supports OOP but doesn't necessarily require it. And for most of them, a beginner doesn't even know there are any "objects" involved - I wrote VBA macros for two years before I ever heard of OOP. So I guess in this post I'm talking not so much about whether a language is technically OO but more the style or process of writing the code.
As an example, let me use AHK (since that's what everyone here is likely to know ). You can write a script like this:
Code: Select all
^n::
Run Notepad
MsgBox Time to get your code on!
ExitApp
Code: Select all
function go(){
var txt = document.getElementById("someInputField").value;
alert(txt);
}
So whether we're writing in AHK, JavaScript or whatever, what do you think are the advantages and disadvantages of using OOP vs. another approach? I have my opinions about it, but I thought I'd get other programmers' perspective on the subject.