Register - Login
Views: 99333102
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
04-21-22 11:24:52 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: 19


Posts: 31/60
EXP: 30456
For next: 5321

Since: 07-18-10


Since last post: 11.6 years
Last activity: 11.0 years

Posted on 08-29-10 08: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: 192


Posts: 6350/12211
EXP: 99212738
For next: 660833

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 08-29-10 08:06:09 PM Link | Quote
Stats
Time/Date
08-29-10 02:06:09 PM
Posts
6350
Days Here
1153
Level
116
Metal_Man88's Post
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.

____________________
Life is a mystery, unlike death.
Eisnaught - SSQ² - Mobius Roleplay - SSS
Kas
Member
Level: 28


Posts: 113/145
EXP: 128079
For next: 3259

Since: 07-28-07

From: Sheffield, UK

Since last post: 1.2 years
Last activity: 1.2 years

Posted on 08-29-10 08: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: 19


Posts: 32/60
EXP: 30456
For next: 5321

Since: 07-18-10


Since last post: 11.6 years
Last activity: 11.0 years

Posted on 08-29-10 08: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: 263


Posts: 17538/25343
EXP: 296641184
For next: 2319269

Since: 07-03-07

Pronouns: they/them/????????

Since last post: 6 days
Last activity: 8 hours

Posted on 08-29-10 08: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: 19


Posts: 34/60
EXP: 30456
For next: 5321

Since: 07-18-10


Since last post: 11.6 years
Last activity: 11.0 years

Posted on 08-29-10 08: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: 263


Posts: 17539/25343
EXP: 296641184
For next: 2319269

Since: 07-03-07

Pronouns: they/them/????????

Since last post: 6 days
Last activity: 8 hours

Posted on 08-29-10 08: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: 192


Posts: 6354/12211
EXP: 99212738
For next: 660833

Since: 07-03-07

From: 52-2-88-7

Since last post: 7.4 years
Last activity: 7.3 years

Posted on 08-29-10 09:17:44 PM Link | Quote
Stats
Time/Date
08-29-10 03:17:44 PM
Posts
6354
Days Here
1153
Level
116
Metal_Man88's Post
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.

____________________
Life is a mystery, unlike death.
Eisnaught - SSQ² - Mobius Roleplay - SSS
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 3557/5390
EXP: 29043712
For next: 291293

Since: 07-22-07

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

Since last post: 330 days
Last activity: 330 days

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

That is a horrible file naming convention.

____________________



[loading witty comment...]
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 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

30 database queries, 2 query cache hits.
Query execution time: 0.094830 seconds
Script execution time: 0.020738 seconds
Total render time: 0.115568 seconds