Advertising (This ad goes away for registered users. You can Login or Register)

Are constructors and destructors Evil?

Discuss about your favorite (gaming...or not) devices here. The most popular ones will end up getting their own categories
Programming discussions for your favorite Device
Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.

Are constructors and Destructors Evil?

Yes
0
No votes
No
4
100%
 
Total votes: 4

User avatar
Infinite Chalupas
Posts: 92
Joined: Thu Feb 20, 2014 9:00 pm

Re: Are constructors and destructors Evil?

Post by Infinite Chalupas » Mon Mar 17, 2014 1:31 pm

Acid_Snake wrote:the problem with it is that it takes more time for the programmers to read the code and see what it does than with other methods. Python for example uses underscores to declare private attributes, this is better as with less code you are giving away more information, and the way I do it (as shown on the other thread) is even better.
The problem with that is that underscores are internally used to declare functions that use the cdecl calling convention; and @ is used for stdcall. It may look prettier, but it opens a bucket of worms if you are wanting to compile the language to native code.
Acid_Snake wrote:structs weren't intended for OOP either but it evolved into it, same applies with namespaces, not being developed for that doesn't mean you have to stay archaic and continue to use namespaces like that. Modular programming has been proven to be a really good way of structuring code and the ultimate evolution to namespaces.
You're comparing apples to oranges though, criticizing namespaces for not doing something they weren't intended for :|
Modularization should be done through classes. Actually, given a second thought, namespaces aren't really necessary anymore now that there are abstract classes. It's kinda redundant.
Acid_Snake wrote:I see that your language is following the trend that Java and C# have followed, which is also the trend that keeps them archaic: OOP-only, no modular programming, god-awful old-looking not-at-all sexy C syntax. Do one simple test: write a hello world in C and a hello world in your language, if it takes more code in your language then you are going the wrong way.
Modular programming is OOP. As for the 'not-at-all sexy C syntax', you can see I'm trying to avoid that, but while you may prefer whitespacing, I prefer using brackets.
Advertising

User avatar
Acid_Snake
Retired Mod
Posts: 3099
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: Are constructors and destructors Evil?

Post by Acid_Snake » Mon Mar 17, 2014 1:40 pm

if you think for a moment that modular programming is OOP then you really have no idea about OOP, modular programming, or anything outside C# and Java.
Advertising

User avatar
Infinite Chalupas
Posts: 92
Joined: Thu Feb 20, 2014 9:00 pm

Re: Are constructors and destructors Evil?

Post by Infinite Chalupas » Mon Mar 17, 2014 1:57 pm

Acid_Snake wrote:if you think for a moment that modular programming is OOP then you really have no idea about OOP, modular programming, or anything outside C# and Java.
Wiki wrote:Modular progr is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules
The mispelling of "programming" aside (wtf wiki?) modular programming divides all the code into modules, therefore everything is part of an object, so regardless of whether or not it's listed as such, I consider it a variant of object oriented programming.

User avatar
Acid_Snake
Retired Mod
Posts: 3099
Joined: Tue May 01, 2012 11:32 am
Location: Behind you!

Re: Are constructors and destructors Evil?

Post by Acid_Snake » Mon Mar 17, 2014 3:36 pm

that doesn't mean OOP can easily replace it, both are two completely different techniques of separating software, and are both 100% compatible with each other, unless you are an OOP terrorist which thinks everything can be done with classes, to which I laugh at you.

When trying to replace modular programming with OOP you end up with code smells, overly convoluted, dirty and hackish code that should be available at all costs.

User avatar
Infinite Chalupas
Posts: 92
Joined: Thu Feb 20, 2014 9:00 pm

Re: Are constructors and destructors Evil?

Post by Infinite Chalupas » Mon Mar 17, 2014 6:09 pm

Acid_Snake wrote:that doesn't mean OOP can easily replace it, both are two completely different techniques of separating software, and are both 100% compatible with each other, unless you are an OOP terrorist which thinks everything can be done with classes, to which I laugh at you.

When trying to replace modular programming with OOP you end up with code smells, overly convoluted, dirty and hackish code that should be available at all costs.
I definitely agree with you. As much as I like structure, trying to call system functions from C# or Java code is hideous.

Post Reply

Return to “Programming and Security”