From: matt d. <mm_...@ya...> - 2009-11-14 02:23:18
|
This is my ten year anniversary on this list! I've helped a few people, annoyed some others (smarty?, drupal?) and, never been to single meeting? (What do you guys look like?- the original CHIPUG site had pics (if I used emoticons there would be a sad face here)) I really should be moving on to my next career- tending some grape vines and cooking an occasional brick oven pizza for anyone who stops by my future South American coastal highway digs. Until I actually make that happen(xxx)- I offer this sure to be ridiculed screed for your perusal/amusement... You’re doing nice work- apologies if I’m short lately. Long hours and stress make me demanding. On appearance- the user and company edit looks okay. That said… You are at a level where I expect good code always. Anything short will be called out. I want this portal to be CLEAN- no choppy code allowed. This is a fresh start on the mishmash that makes (redacted) a pain (and buggy). So, even though we have deadlines- I expect everything to be thought out and planned. Not hacked. Always think- What is best for the end-user experience? And- what is efficient (code-wise) and can be isolated as a ‘tight’ application that won’t be buggy. Generally when you write code you should be thinking- ‘how will I test this’ first. Not after you write it. I’m not making a statement on what you do- just saying what I expect. There are two things that will bug me- Extra code. Not well formatted code. Reason being, both lead to errors- Extra code is more code that can break. Badly formatted code is hard to read and leads to errors. It also takes extra time for other dev’s to read. THE FIRST thing I do when I re-factor is to format everything so I know exactly what I’m looking at. I usually spot errors and see efficiencies at this point that color what I will do when I make changes. Whenever we take the time to re-factor code I expect it to be perfectly formatted with no duplication of efforts (i.e. if a class is declared I don’t want to see a row array of the same data later). When you can- move procedural code to classes. Also- if there is some linked global function (which (redacted) liked to do) and it’s not annotated- comment the code as to where the function came from.Especially if you had to search for it. Also- if that function is in a class, use the construct if(function_exists($somefunction)) so classes don’t break out of context. Which is a problem I’m seeing now. It’s not enough to re-write something and have it work. You need to own it and, after it works you need to ask yourself if it’s the most efficient solution. And could it be done better? Re-write it if that’s the case. It’s better to have good ‘flexible’ long lasting code then code that works temporarily. Always think about what would break your code and how it could be more flexible to that prospect. I know you are touching some bad India dev code but you need to clean it up. I will be reviewing this code specifically as it’s potentially embarrassing and could be a security lapse. It’s particularly context sensitive. On formatting code: For work files it should be self explanatory (indent and match brackets). On body files I expect to be able to read the HTML tags in context, they should line up logically. The PHP should be unobtrusive and in context to the HTML. I prefer embedded PHP as opposed to echo’d HTML except for things like loops etc. where it would be obvious to use PHP to generate HTML. Notes: The function $u->perms() allows for a sequence of perms - $u->perms(“OFFICE_MAMANGER”,”ADMIN”) etc.. Consolidate these please. The biggest issue with the user and company edit is the insane permissions mishmash. Try and make this coherent. Also- again, the render.inc file should be used in the context of a valid html page i.e. in the body.x (inclosed in the header tags)- not in the work.x file. (redacted)is full of crapped out HTML and I don’t want that to be the case in the (redacted) portal. All the pages you render should be perfect HTML. Ideally I want to re-factor and use (redacted) code but the over-riding concern should be for a tight application that never breaks. Matt chi...@li... https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss |