Register - Login
Views: 95181860
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
09-22-18 01:09:43 AM

Jul - General Chat - The next big change New poll - New thread - New reply
Pages: 1 2Next newer thread | Next older thread
Leroy
Member
Level: 18


Posts: 31/60
EXP: 25401
For next: 4496

Since: 07-18-10


Since last post: 7.0 years
Last activity: 7.0 years

Posted on 08-29-10 05:01:08 PM (last edited by Leroy at 08-29-10 05:09 PM) Link | Quote
Originally posted by Terra
I never liked or understood OOP much. I learned programming in Commodore 64 BASIC, complete with line numbers, at the age of 8
I didn't want to have anything to do with 'hip' and 'trendy' Object Oriented Programming years ago, in my board scripting era, either. Nowadays I have a pretty much identical set of scalable classes I can use without adapting changes in every new project.

Call it a matter of taste, but I'd rather work with this:

... than this:


The first, object oriented method allows IDEs with auto-completion (such as Intellisense for Visual Studio) to create a list with all properties/fields/methods your object contains. With just a few keystrokes and small amounts of code, you can make very effective and functional scripts and even programs. And best of all, you aren't required to know everything about your database (IE column names and the like) every time you want to work with data, because your business logic class takes care of that.

Plus, it's generally bad practice to put SQL queries in your most front presentation files. That's very prone to errors, not very scalable and crops your files with logic that belongs elsewhere. It's better to make a so called 'Data Access Layer' where all the interaction between application and database takes place. That way it's easier to maintain and secure, not to mention make it easier to port (parts of) your application. I've had projects where the application had to be compatible with MySQL, MS SQL Server and Paradox. Good luck achieving that when you put all your loose, database platform specific queries in your presentation files.

Originally posted by OoBurns
I like OOP, but I don't often use it when coding in PHP. PHP's objects feel like they were tacked on to a scripting language as an afterthought (probably because they were). I will create classes in PHP if they'll obviously make things simpler, though.

Logic programming, on the other hand, is something I still haven't gotten the hang of.
QFT. I'm currently rewriting the core code base for the PHP version of my CMS, and I'm once again made clear how annoying PHP can be by not properly supporting/implementing basic stuff such as enumerations, strong typing, method overloading, etcetera. Even the 'type hinting' alternative PHP offers because of the lack of strong typing is extremely limited, and doesn't even work on native types such as string and int.
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 185


Posts: 6350/12211
EXP: 86387954
For next: 1371781

Since: 07-03-07

From: 52-2-88-7

Since last post: 3.0 years
Last activity: 3.0 years

Posted on 08-29-10 05:06:09 PM Link | Quote
I program in procedural stuff, mostly because my first language was C. PHP fits with it like a glove, so while I can make vast fields of objects, I don't even touch them with PHP, since PHP doesn't seem to offer very good support for them.
Kas
Member
Level: 27


Posts: 113/144
EXP: 110289
For next: 5870

Since: 07-28-07

From: Sheffield, UK

Since last post: 3.0 years
Last activity: 3.0 years

Posted on 08-29-10 05:20:40 PM Link | Quote
Although pretty much everything PHP does is "tacked on", it would be misguided to suggest that one shouldn't use an object-oriented methodology because PHP doesn't implement advanced OO functionality. PHP's OO implementation still allows for significantly better software design than procedural code alone does.

I will admit that object orientation is a significant concept to grasp, but there simply is no debate any more. Object Orientation is a superior methodology for software development and will remain so until a better methodology is developed.
Leroy
Member
Level: 18


Posts: 32/60
EXP: 25401
For next: 4496

Since: 07-18-10


Since last post: 7.0 years
Last activity: 7.0 years

Posted on 08-29-10 05:28:02 PM (last edited by Leroy at 08-29-10 05:30 PM) Link | Quote
Originally posted by Kas
Although pretty much everything PHP does is "tacked on", it would be misguided to suggest that one shouldn't use an object-oriented methodology because PHP doesn't implement advanced OO functionality. PHP's OO implementation still allows for significantly better software design than procedural code alone does.

I will admit that object orientation is a significant concept to grasp, but there simply is no debate any more. Object Orientation is a superior methodology for software development and will remain so until a better methodology is developed.
Very true. Even in PHP, it's possible to make a class with fields, properties and methods that represent a logical object of your application. It's quite a chore as opposed to how easy it is in languages such as C#, but still, possible.

And I pretty much agree with you on the "there is no debate any more" statement. OOP makes your life as a programmer so much more easier and enjoyable. Thinking back of the days where I worked with generic code only, never used a debugger and had to rewrite custom code every time over again makes me shiver.
Xkeeper

Level: 244


Posts: 17538/23358
EXP: 228551912
For next: 1635354

Since: 07-03-07

Pronouns: they/them, she/her, etc.

Since last post: 2 hours
Last activity: 21 min.

Posted on 08-29-10 05:42:21 PM Link | Quote
I must use some sort of psuedo-mix, then, I guess, at least outside of PHP.

It's not quite complete (and hasn't been touched for a few weeks now, as usual) but just rename .love to .zip and have at it. The files are all in one spot for now because I haven't gotten that far.
Leroy
Member
Level: 18


Posts: 34/60
EXP: 25401
For next: 4496

Since: 07-18-10


Since last post: 7.0 years
Last activity: 7.0 years

Posted on 08-29-10 05:51:06 PM Link | Quote
Originally posted by Xkeeper
I must use some sort of psuedo-mix, then, I guess, at least outside of PHP.

It's not quite complete (and hasn't been touched for a few weeks now, as usual) but just rename .love to .zip and have at it. The files are all in one spot for now because I haven't gotten that far.



require "ai.lua" -- Eventually these will be split into their functions, but for now...


And this isn't much code, so it's not a necessity to split it in a ton of files anyway.
Xkeeper

Level: 244


Posts: 17539/23358
EXP: 228551912
For next: 1635354

Since: 07-03-07

Pronouns: they/them, she/her, etc.

Since last post: 2 hours
Last activity: 21 min.

Posted on 08-29-10 05:52:20 PM Link | Quote
Yeah. Later ai.lua will be split into individual files for objects (e.g. weapons/basic.lua and enemy/dumb.lua and such).

Right now, though, they're unorganized
Lyskar
12210
-The Chaos within trumps the Chaos without-
Level: 185


Posts: 6354/12211
EXP: 86387954
For next: 1371781

Since: 07-03-07

From: 52-2-88-7

Since last post: 3.0 years
Last activity: 3.0 years

Posted on 08-29-10 06:17:44 PM Link | Quote
Oh, well, procedural is not superior to object oriented, just something I tend to rely on for fast and dirty things. That and most PHP things.
Rena

Star Mario
Fennel
Level: 128


Posts: 3557/5257
EXP: 24345293
For next: 36407

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 8 hours
Last activity: 8 hours

Posted on 08-30-10 02:35:56 PM (last edited by HyperHacker at 08-30-10 02:36 PM) Link | Quote
Originally posted by Leroy
Call it a matter of taste, but I'd rather work with this:

That is a horrible file naming convention.
Pages: 1 2Next newer thread | Next older thread
Jul - General Chat - The next big change New poll - New thread - New reply




Rusted Logic

Acmlmboard - commit 5d36857 [2018-03-03]
©2000-2018 Acmlm, Xkeeper, Inuyasha, et al.

30 database queries, 2 query cache hits.
Query execution time: 0.172445 seconds
Script execution time: 0.016038 seconds
Total render time: 0.188483 seconds
Memory used: 786432