Yii Framework Forum: Am I allow to prefix interface class names with the letter "I" - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Am I allow to prefix interface class names with the letter "I" same case as class name with C prefix are reserved? Rate Topic: -----

#1 User is offline   sumwai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 30 October 2010 - 12:10 AM

As title, am I allow to prefix my interface class with the letter "I"?
tipstank.com - where I share my coding stuff
0

#2 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 2,601
  • Joined: 10-October 10
  • Location:Denmark

Posted 30 October 2010 - 12:19 AM

The reason why Yii classes are prefixed with the letter 'C' is that PHP does not have namespace support.
Starting with PHP 5.3.x it does.

If the class name doesn't clash with other class names, then it should be alright.
"Less noise - more signal"
0

#3 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 01 November 2010 - 05:02 AM

You are allowed to do anything :) - the question is, wether it's a whise thing to do:

1. Others (and maybe yourself in some month) might be confused wether something is a framework or a custom interface if you use the same naming scheme

2. You will have troubles if some day the framework introduces an interface with the same name
0

#4 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 01 November 2010 - 05:05 AM

View PostMike, on 01 November 2010 - 05:02 AM, said:

You are allowed to do anything :) - the question is, wether it's a whise thing to do:

1. Others (and maybe yourself in some month) might be confused wether something is a framework or a custom interface if you use the same naming scheme

2. You will have troubles if some day the framework introduces an interface with the same name


Totally agree
┬┐How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users