I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up Simple object-oriented calculator - follow-up
I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up
I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up
Edit
I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up
Edit
I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up
Object-Oriented Simple Calculatorobject-oriented calculator
After studying several ways of doing OOP in JavaScript I think I finally came up with one that seems OK to me. My question is: isIs it okay? Do you see some problems I can face by using OOP in JavaScript like this?
- I can't do a call to a higher method version (I. I mean, call to a "grandfather" class's method that has already been overridden. Only to the last method version. I rarely do this, so I think it's okay.
- Too different from what's normally done in JavaScript. Although, I'm really not sure about this one.
Any comments or criticisms welcomed.
Edit
The objective of this question isn't a code review of a simple calculator. I'm a senior developer and studing jsstudying JS for some time now and I develop in several other languages and FWs. You can take a look on other (more verbose) OOP methods I studied before in my blog's post here.
So I'm perfectly aware how an MVC works and what should be the function for each layer. I have done a simple calculator as an example to show how I intend to do JS OOP. I have mixed UI handling code and logic on purpose just to simplify the example. In a real system I would have separated it in different classes. That goes to the names also. In actual code I allways VERY verbose names.
Actually, the first name ofI'm perfectly aware how an MVC works and what should be the question was: "Is this way of doingfunction for each layer. I have done a simple calculator as an example to show how I intend to do JS OOP ok?". It was editedI have mixed UI handling code and as it's my first question here,logic on purpose just to simplify the example. In a real system I didn't wantwould have separated it in different classes. That goes to revert the editionnames also. In actual code I always use VERY verbose names.
This question's intention is present this oop format to other developers to see if it has any problems I'm not seeing. So I'm not worried with this specific task as it's a mere example. So in order to focus answers to this point, I ask the readers of this question and anyone who can possibly answer it to stick to problems this way of doing oop can have. If someone thinks it's ok I also would like to hear from you. :)
Nevertheless, thanksThis question's intention is present this OOP format to all who caredother developers to analysesee if it has any problems I'm not seeing.
Edit 2 So I'm not worried with this specific task as it's a mere example. In order to focus answers to this point, please stick to ways of doing this in OOP.
If someone thinks it's ok I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up also would like to hear from you.
Object-Oriented Simple Calculator
After studying several ways of doing OOP in JavaScript I think I finally came up with one that seems OK to me. My question is: is it okay? Do you see some problems I can face by using OOP in JavaScript like this?
- I can't do a call to a higher method version (I mean, call to a "grandfather" class's method that has already been overridden. Only to the last method version. I rarely do this, so I think it's okay.
- Too different from what's normally done in JavaScript. Although, I'm really not sure about this one.
Any comments or criticisms welcomed.
Edit
The objective of this question isn't a code review of a simple calculator. I'm a senior developer and studing js for some time now and I develop in several other languages and FWs. You can take a look on other (more verbose) OOP methods I studied before in my blog's post here.
So I'm perfectly aware how an MVC works and what should be the function for each layer. I have done a simple calculator as an example to show how I intend to do JS OOP. I have mixed UI handling code and logic on purpose just to simplify the example. In a real system I would have separated it in different classes. That goes to the names also. In actual code I allways VERY verbose names.
Actually, the first name of the question was: "Is this way of doing JS OOP ok?". It was edited and as it's my first question here, I didn't want to revert the edition.
This question's intention is present this oop format to other developers to see if it has any problems I'm not seeing. So I'm not worried with this specific task as it's a mere example. So in order to focus answers to this point, I ask the readers of this question and anyone who can possibly answer it to stick to problems this way of doing oop can have. If someone thinks it's ok I also would like to hear from you. :)
Nevertheless, thanks to all who cared to analyse it.
Edit 2
I created a new question with many of the recommended modifications, here: Simple object-oriented calculator - follow-up
Simple object-oriented calculator
After studying several ways of doing OOP in JavaScript I think I finally came up with one that seems OK to me. Is it okay? Do you see some problems I can face by using OOP in JavaScript like this?
- I can't do a call to a higher method version. I mean, call to a "grandfather" class's method that has already been overridden. Only to the last method version. I rarely do this, so I think it's okay.
- Too different from what's normally done in JavaScript. Although, I'm really not sure about this one.
The objective of this question isn't a code review of a simple calculator. I'm a senior developer and studying JS for some time now and I develop in several other languages and FWs. You can take a look on other (more verbose) OOP methods I studied before in my blog's post here.
I'm perfectly aware how an MVC works and what should be the function for each layer. I have done a simple calculator as an example to show how I intend to do JS OOP. I have mixed UI handling code and logic on purpose just to simplify the example. In a real system I would have separated it in different classes. That goes to the names also. In actual code I always use VERY verbose names.
This question's intention is present this OOP format to other developers to see if it has any problems I'm not seeing. So I'm not worried with this specific task as it's a mere example. In order to focus answers to this point, please stick to ways of doing this in OOP.
If someone thinks it's ok I also would like to hear from you.
- 513
- 4
- 11