Code indentation... outdated?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Code indentation... outdated?

Post by Christopher »

PCSpectra wrote:I firmly believe you...
:)
PCSpectra wrote:By virgin developer I meant someone just new to the project...not nessecarily programming in general.
Conversely if a experienced DBA came onto the project (better for the project ;)) that person would not only understand it, but would think that the team know what they were doing.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Code indentation... outdated?

Post by alex.barylski »

Conversely if a experienced DBA came onto the project (better for the project ) that person would not only understand it,
Why wouldn't they understand the more readable of the two? Certainly the example VladSun gave used clearer naming conventions, no?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Code indentation... outdated?

Post by josh »

VladSun wrote: C'mon man ;) Less typing doesn't worth the following much more reading and the headake.
Less typing is the essence of abstraction
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Code indentation... outdated?

Post by VladSun »

A DB abstraction is achieved while you use the CREATE SQL queries.
When you start using the SELECT/UPDATE/INSERT/DELETE queries it's an implementation ;)
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Code indentation... outdated?

Post by alex.barylski »

Less typing is the essence of abstraction
You love that word don't you? I hear that word and I think shampoo for some reason... :D :lol:

Less typing is the essence of abstraction? I'm not sure I understand, nor do I agree. The essence of abstraction is to "abstract" concepts and only sometimes does it result in less typing. They are in no way related, even in the field of computer science.

Working with objects is more abstract than writing machine code because the concept of objects in the real world are more easily modeled and expressed using virtual objects as opposed to assembler mnemonics. That is the essence of abstraction in the software development world.

Design patterns are yet another "higher level" abstraction and when the day comes we write our specs in a high level English like DSL, we will have taken software development to yet another level of abstraction.

Less typing is just 'a' consequence of abstraction not the essence, IMHO.

For example, when you wrote an application in Assembler a few thousand instructions wouldn't get you very far...so higher level languages were thought up and while they allowed the developer to develop more significant solutions, he number of lines and typing actually increased. Where one might have written 2000 instructions and accomplished very little...a C developer will write 10000 lines of code which compiled to 100000 instructions but still required more typing. The more abstract we become, the more indepth the problems and solutions and that is usually coupled with more work, not less.

Cheers,
Alex
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Code indentation... outdated?

Post by josh »

I don't understand your argument. Abstractions spare the programmer from repeating declarations when specifying implementations, they cut down on implementation code verbosity. Side affects of abstraction include extra indirection, diminishing returns (at first) and then ultimately more flexible code.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Code indentation... outdated?

Post by alex.barylski »

jshpro2 wrote:I don't understand your argument. Abstractions spare the programmer from repeating declarations when specifying implementations, they cut down on implementation code verbosity. Side affects of abstraction include extra indirection, diminishing returns (at first) and then ultimately more flexible code.
None of the above directly relates to less typing...I also don't think saying "cut down on implementation code verbosity" is accurate either as frameworks usually include a lot of implementation code...an abstraction however will usually hide/encapsulate those gory details from you...they are still there though.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: Code indentation... outdated?

Post by josh »

That's what I meant by implementation code. Abstraction causes more abstract code in most cases than if only ad hoc implementation code were to be written, since abstract code by nature does more things. Regardless it has nothing to do with code indenting :lol:
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Code indentation... outdated?

Post by alex.barylski »

Regardless it has nothing to do with code indenting
No it doesn't...that we can agree unequivocally. :lol:
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Code indentation... outdated?

Post by VladSun »

Sorry for waking up this topic, but ...
VladSun wrote:Well, it's a bit off topic but it's close, so I'll ask it:
Why, even professional ones, IT guys use one letter table names aliases in their SQL queries. And it's worse - the more complicated a SQL query is, the more people tend to use aliases. It's like using a one-letter-named variables in programming language, but it seems that while nearly nobody do this in his source code, a lot will do it in SQL...
I really can't understand it :(
viewtopic.php?f=1&t=93710
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply