Complement for Code Style

xiaoxiao2026-04-11  7

1. Use underline to Separate different part of Variable and method's name. project_item @product_name def find_people end 2.We should have a space after comma, no space before comma and no space in method parentheses. attr_reader :product, :quantity find_product(name, id, time) 3.Javascript win = new Ext.Window({ applyTo: 'hello-win', layout: 'fit', width: 500, height: 300, closeAction: 'hide', plain: true, items: new Ext.TabPanel({ applyTo: 'hello-tabs', autoTabs: true, activeTab: 0, deferredRender: false, border: false }), buttons: [{ text: 'Submit', disabled: true },{ text: 'Close', handler: function(){ win.hide(); } }] }); Contain code like follow: [{ ... },{ ... }], ({ ... },{ ... }) 4.SQL SELECT CONCAT(parent.name,' , ',p.name) AS Project, t.name AS Task, wi.wComment AS Description, sec_to_time(wi.wBegin) AS 'Start Time', sec_to_time(wi.wEnd) AS 'End_time', sec_to_time(wi.wEnd-wi.wBegin) AS Time FROM T4U_WORKITEMS wi INNER JOIN T4U_DAYINFOS di ON ( wi.dayinfo_id = di.id ) INNER JOIN T4U_TASKS t ON ( wi.task_id = t.id ) INNER JOIN T4U_PROJECTS p ON ( wi.project_id = p.id ) INNER JOIN T4U_PERSONS per ON ( di.person_id = per.id ) INNER JOIN T4U_PROJECTS parent ON ( IFNULL(p.parent_id,p.id) = parent.id ) WHERE di.daydate = '2009-03-10' AND per.surName LIKE "eric%"
转载请注明原文地址: https://www.6miu.com/read-5047174.html

最新回复(0)