作者yoco315 (眠月)
看板Soft_Job
標題Re: [閒聊] 大家工作上看過哪些誇張的 CODE ?
時間Mon May 17 01:05:53 2010
※ 引述《wa120 (哇120)》之銘言:
不嘴炮,來,你現在接手 maintain 這個程式給我看
我幫你 syntax high light
if ( n % 2 ) {
<div class="question-summary narrow" id="question-summary-2831775">
<div
onclick="javascript:window.location.href='/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">68</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time"
class="question-hyperlink" title="Sorry, this is probably a terrible
question. I've JUST started learning python today. I've been reading a Byte
of Python. Right now I have a project for Python that involves time. I can't
find … ">Running a python script for a user-specified amount of
time?</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time/?lastactivity"
class="started-link"><span title="2010-05-16 16:41:22Z"
class="relativetime">6m ago</span></a>
<a href="/users/143880/shavenwarthog" >shavenwarthog</a>
<span class="reputation-score" title="reputation score">71</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844554">
<div
onclick="javascript:window.location.href='/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">3</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items"
class="question-hyperlink" title="I have written a Python application and
would like to give my users the option of having the app automatically launch
itself when the user logs in. It is important that the user is able to toggle
this … ">Using Python to add/remove Ubuntu login script items</a></h3>
<div class="tags t-python t-ubuntu t-linux t-login-script">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/ubuntu" class="post-tag" title="show questions tagged
'ubuntu'" rel="tag">ubuntu</a> <a href="/questions/tagged/linux"
class="post-tag" title="show questions tagged 'linux'" rel="tag">linux</a> <a
href="/questions/tagged/login-script" class="post-tag" title="show questions
tagged 'login-script'" rel="tag">login-script</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:54Z" class="relativetime">6m
ago</span>
<a href="/users/138256/codebox-rob" >codebox_rob</a> <span
class="reputation-score" title="reputation score">58</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844553">
<div
onclick="javascript:window.location.href='/questions/2844553/explaining-verity-index-and-document-search-limits'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">1</div>
<div>view</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844553/explaining-verity-index-and-document-search-limits"
class="question-hyperlink" title="As present, we currently have a CF8
standard edition server which have some limitations around verity indexing.
According to Adobe
Verity Server has the following document search limits (limits are
… ">Explaining verity index and document search limits</a></h3>
<div class="tags t-coldfusion t-verity t-collections t-indexing
t-limits">
<a href="/questions/tagged/coldfusion" class="post-tag"
title="show questions tagged 'coldfusion'" rel="tag">coldfusion</a> <a
href="/questions/tagged/verity" class="post-tag" title="show questions tagged
'verity'" rel="tag">verity</a> <a href="/questions/tagged/collections"
class="post-tag" title="show questions tagged 'collections'"
rel="tag">collections</a> <a href="/questions/tagged/indexing"
class="post-tag" title="show questions tagged 'indexing'"
rel="tag">indexing</a> <a href="/questions/tagged/limits" class="post-tag"
title="show questions tagged 'limits'" rel="tag">limits</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:50Z" class="relativetime">7m
ago</span>
<a href="/users/268667/ahmad" >Ahmad</a> <span
class="reputation-score" title="reputation score">173</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2840271">
<div
onclick="javascript:window.location.href='/questions/2840271/handling-email-bouncebacks-in-rails'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2840271/handling-email-bouncebacks-in-rails"
class="question-hyperlink" title="Hi there,
I've built a very basic CRM system for my rails app that allows me to
send weekly user activity digests with custom text and create multi-part
marketing messages which I can configure and … ">Handling Email
Bouncebacks in Rails</a></h3>
<div class="tags t-ruby-on-rails t-email t-bouncedemail
t-retrieve">
<a href="/questions/tagged/ruby-on-rails" class="post-tag"
title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a
href="/questions/tagged/email" class="post-tag" title="show questions tagged
'email'" rel="tag">email</a> <a href="/questions/tagged/bouncedemail"
class="post-tag" title="show questions tagged 'bouncedemail'"
rel="tag">bouncedemail</a> <a href="/questions/tagged/retrieve"
class="post-tag" title="show questions tagged 'retrieve'"
rel="tag">retrieve</a>
</div>
<div class="started">
<a
href="/questions/2840271/handling-email-bouncebacks-in-rails/?lastactivity"
class="started-link"><span title="2010-05-16 16:40:45Z"
class="relativetime">7m ago</span></a>
<a href="/users/242134/aressidi" >aressidi</a> <span
class="reputation-score" title="reputation score">27</span>
</div>
</div>
</div>
<div class="question-summary width" id="question-summary-2839959">
<div
onclick="javascript:window.location.href='/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications'"
class="cp">
<div class="votes">
<div class="mini-counts">-3</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">52</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications"
class="question-hyperlink" title="jQuery+jQueryUI Vs Yahoo UI..Which is the
best UI to use in asp.net web applications?
">jQuery+jQueryUI Vs Yahoo UI..Which is the best one for web
applications?</a></h3>
<div class="tags t-aspunet t-jquery-ui t-yahoo t-ui t-subjective">
<a href="/questions/tagged/asp.net" class="post-tag"
title="show questions tagged 'asp.net'" rel="tag">asp.net</a> <a
href="/questions/tagged/jquery-ui" class="post-tag" title="show questions
tagged 'jquery-ui'" rel="tag">jquery-ui</a> <a href="/questions/tagged/yahoo"
class="post-tag" title="show questions tagged 'yahoo'" rel="tag">yahoo</a> <a
href="/questions/tagged/ui" class="post-tag" title="show questions tagged
'ui'" rel="tag">ui</a> <a href="/questions/tagged/subjective"
class="post-tag" title="show questions tagged 'subjective'"
rel="tag">subjective</a>
</div>
<div class="started">
<a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:24Z"
class="relativetime">8m ago</span></a>
<a href="/users/135494/clement-herreman" >Clement
Herreman</a> <span class="reputation-score" title="reputation
score">1,412</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844516">
<div
onclick="javascript:window.location.href='/questions/2844516/python-filter-a-dictionary'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">25</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844516/python-filter-a-dictionary"
class="question-hyperlink" title="Hi,
I have a dictionary of points, say:
>>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)}
I want to create a new dictionary with all the points whose x and y value
is smaller than … ">Python: Filter a dictionary</a></h3>
<div class="tags t-python t-dictionary t-filter">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/dictionary" class="post-tag" title="show questions
tagged 'dictionary'" rel="tag">dictionary</a> <a
href="/questions/tagged/filter" class="post-tag" title="show questions tagged
'filter'" rel="tag">filter</a>
</div>
<div class="started">
<a
href="/questions/2844516/python-filter-a-dictionary/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:17Z"
class="relativetime">8m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-556525">
<div
onclick="javascript:window.location.href='/questions/556525/raw-socket-implementation-in-windows'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts warm"><span title='1446
views'>1</span></div>
<div class='warm'>kviews</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/556525/raw-socket-implementation-in-windows"
class="question-hyperlink" title="I need to create TCP/IP headers manually
for my application. For that i used Raw socket. My system os is win xp
(SP3).
My code compiles fine :) but it throws a run time error:
Initialising … ">Raw socket implementation in windows?</a></h3>
<div class="tags t-ccc t-sockets t-socket-programming t-tcpip">
<a href="/questions/tagged/c%2b%2b" class="post-tag"
title="show questions tagged 'c++'" rel="tag">c++</a> <a
href="/questions/tagged/sockets" class="post-tag" title="show questions
tagged 'sockets'" rel="tag">sockets</a> <a
href="/questions/tagged/socket-programming" class="post-tag" title="show
questions tagged 'socket-programming'" rel="tag">socket-programming</a> <a
href="/questions/tagged/tcpip" class="post-tag" title="show questions tagged
'tcpip'" rel="tag">tcpip</a>
</div>
<div class="started">
<a
href="/questions/556525/raw-socket-implementation-in-windows/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:15Z"
class="relativetime">8m ago</span></a>
<a href="/users/342456/dfak" >dfak</a> <span
class="reputation-score" title="reputation score">1</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844253">
<div
onclick="javascript:window.location.href='/questions/2844253/php-url-detection-regexp-includes-line-breaks'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">2</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">20</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks"
class="question-hyperlink" title="I want to have a function which gets a text
as the input and gives back the text with URLs made to HTML links as the
output.
My draft is as follows:
function autoLink($text) {
return … ">PHP: URL detection (regexp) includes line
breaks</a></h3>
<div class="tags t-regex t-php t-function">
<a href="/questions/tagged/regex" class="post-tag"
title="show questions tagged 'regex'" rel="tag">regex</a> <a
href="/questions/tagged/php" class="post-tag" title="show questions tagged
'php'" rel="tag">php</a> <a href="/questions/tagged/function"
class="post-tag" title="show questions tagged 'function'"
rel="tag">function</a>
</div>
<div class="started">
<a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:06Z"
class="relativetime">8m ago</span></a>
<a href="/users/89771/alix-axel" >Alix Axel</a> <span
class="reputation-score" title="reputation score 12100">12.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2842579">
<div
onclick="javascript:window.location.href='/questions/2842579/equivalent-to-unix-less-command-within-r-console'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">62</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console"
class="question-hyperlink" title="Is there an equivalent to the unix less
command that can be used within the R console?
">Equivalent to unix “less” command within R console</a></h3>
<div class="tags t-less t-r t-shell">
<a href="/questions/tagged/less" class="post-tag" title="show
questions tagged 'less'" rel="tag">less</a> <a href="/questions/tagged/r"
class="post-tag" title="show questions tagged 'r'" rel="tag">r</a> <a
href="/questions/tagged/shell" class="post-tag" title="show questions tagged
'shell'" rel="tag">shell</a>
</div>
<div class="started">
<a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:03Z"
class="relativetime">8m ago</span></a>
<a href="/users/16632/hadley" >hadley</a> <span
class="reputation-score" title="reputation score">4,252</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2841183">
<div
onclick="javascript:window.location.href='/questions/2841183/access-tree-object-in-netbeans-outline'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">14</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2841183/access-tree-object-in-netbeans-outline"
class="question-hyperlink" title="I'm using Outline from netbeans to display
some structured data.
How can I map selected row to an object in tree?
">Access tree object in netbeans outline</a></h3>
<div class="tags t-java t-swing t-outline">
<a href="/questions/tagged/java" class="post-tag" title="show
questions tagged 'java'" rel="tag">java</a> <a href="/questions/tagged/swing"
class="post-tag" title="show questions tagged 'swing'" rel="tag">swing</a> <a
href="/questions/tagged/outline" class="post-tag" title="show questions
tagged 'outline'" rel="tag">outline</a>
</div>
<div class="started">
<a
href="/questions/2841183/access-tree-object-in-netbeans-outline/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:58Z"
class="relativetime">8m ago</span></a>
<a href="/users/230513/trashgod" >trashgod</a> <span
class="reputation-score" title="reputation score">5,490</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844165">
<div
onclick="javascript:window.location.href='/questions/2844165/wpf-hwndhost-keyboard-focus'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844165/wpf-hwndhost-keyboard-focus"
class="question-hyperlink" title="The chart area in the screenshot is a
HwndHost control which hosts a native Win32 window (with it's own registered
WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is
hosted in a … ">WPF HwndHost keyboard focus</a></h3>
<div class="tags t-wpf t-interop t-win32 t-hosted t-focus">
<a href="/questions/tagged/wpf" class="post-tag" title="show
questions tagged 'wpf'" rel="tag">wpf</a> <a href="/questions/tagged/interop"
class="post-tag" title="show questions tagged 'interop'"
rel="tag">interop</a> <a href="/questions/tagged/win32" class="post-tag"
title="show questions tagged 'win32'" rel="tag">win32</a> <a
href="/questions/tagged/hosted" class="post-tag" title="show questions tagged
'hosted'" rel="tag">hosted</a> <a href="/questions/tagged/focus"
class="post-tag" title="show questions tagged 'focus'" rel="tag">focus</a>
</div>
<div class="started">
<a
href="/questions/2844165/wpf-hwndhost-keyboard-focus/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:46Z"
class="relativetime">9m ago</span></a>
<a href="/users/212865/adal" >Adal</a> <span
class="reputation-score" title="reputation score">259</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2843053">
<div
onclick="javascript:window.location.href='/questions/2843053/go-through-a-number-of-functions-in-python'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">6</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">77</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2843053/go-through-a-number-of-functions-in-python"
class="question-hyperlink" title="I have an unknown number of functions in my
python script (well, it is known, but not constant) that start with site_...
I was wondering if there's a way to go through all of these functions in
some … ">Go through a number of functions in Python</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2843053/go-through-a-number-of-functions-in-python/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:33Z"
class="relativetime">9m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
else {
<div class="question-summary narrow" id="question-summary-2831775">
<div
onclick="javascript:window.location.href='/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">68</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time"
class="question-hyperlink" title="Sorry, this is probably a terrible
question. I've JUST started learning python today. I've been reading a Byte
of Python. Right now I have a project for Python that involves time. I can't
find … ">Running a python script for a user-specified amount of
time?</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2831775/running-a-python-script-for-a-user-specified-amount-of-time/?lastactivity"
class="started-link"><span title="2010-05-16 16:41:22Z"
class="relativetime">6m ago</span></a>
<a href="/users/143880/shavenwarthog" >shavenwarthog</a>
<span class="reputation-score" title="reputation score">71</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844554">
<div
onclick="javascript:window.location.href='/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">3</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844554/using-python-to-add-remove-ubuntu-login-script-items"
class="question-hyperlink" title="I have written a Python application and
would like to give my users the option of having the app automatically launch
itself when the user logs in. It is important that the user is able to toggle
this … ">Using Python to add/remove Ubuntu login script items</a></h3>
<div class="tags t-python t-ubuntu t-linux t-login-script">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/ubuntu" class="post-tag" title="show questions tagged
'ubuntu'" rel="tag">ubuntu</a> <a href="/questions/tagged/linux"
class="post-tag" title="show questions tagged 'linux'" rel="tag">linux</a> <a
href="/questions/tagged/login-script" class="post-tag" title="show questions
tagged 'login-script'" rel="tag">login-script</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:54Z" class="relativetime">6m
ago</span>
<a href="/users/138256/codebox-rob" >codebox_rob</a> <span
class="reputation-score" title="reputation score">58</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844553">
<div
onclick="javascript:window.location.href='/questions/2844553/explaining-verity-index-and-document-search-limits'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status unanswered">
<div class="mini-counts">0</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">1</div>
<div>view</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844553/explaining-verity-index-and-document-search-limits"
class="question-hyperlink" title="As present, we currently have a CF8
standard edition server which have some limitations around verity indexing.
According to Adobe
Verity Server has the following document search limits (limits are
… ">Explaining verity index and document search limits</a></h3>
<div class="tags t-coldfusion t-verity t-collections t-indexing
t-limits">
<a href="/questions/tagged/coldfusion" class="post-tag"
title="show questions tagged 'coldfusion'" rel="tag">coldfusion</a> <a
href="/questions/tagged/verity" class="post-tag" title="show questions tagged
'verity'" rel="tag">verity</a> <a href="/questions/tagged/collections"
class="post-tag" title="show questions tagged 'collections'"
rel="tag">collections</a> <a href="/questions/tagged/indexing"
class="post-tag" title="show questions tagged 'indexing'"
rel="tag">indexing</a> <a href="/questions/tagged/limits" class="post-tag"
title="show questions tagged 'limits'" rel="tag">limits</a>
</div>
<div class="started">
<span title="2010-05-16 16:40:50Z" class="relativetime">7m
ago</span>
<a href="/users/268667/ahmad" >Ahmad</a> <span
class="reputation-score" title="reputation score">173</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2840271">
<div
onclick="javascript:window.location.href='/questions/2840271/handling-email-bouncebacks-in-rails'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2840271/handling-email-bouncebacks-in-rails"
class="question-hyperlink" title="Hi there,
I've built a very basic CRM system for my rails app that allows me to
send weekly user activity digests with custom text and create multi-part
marketing messages which I can configure and … ">Handling Email
Bouncebacks in Rails</a></h3>
<div class="tags t-ruby-on-rails t-email t-bouncedemail
t-retrieve">
<a href="/questions/tagged/ruby-on-rails" class="post-tag"
title="show questions tagged 'ruby-on-rails'" rel="tag">ruby-on-rails</a> <a
href="/questions/tagged/email" class="post-tag" title="show questions tagged
'email'" rel="tag">email</a> <a href="/questions/tagged/bouncedemail"
class="post-tag" title="show questions tagged 'bouncedemail'"
rel="tag">bouncedemail</a> <a href="/questions/tagged/retrieve"
class="post-tag" title="show questions tagged 'retrieve'"
rel="tag">retrieve</a>
</div>
<div class="started">
<a
href="/questions/2840271/handling-email-bouncebacks-in-rails/?lastactivity"
class="started-link"><span title="2010-05-16 16:40:45Z"
class="relativetime">7m ago</span></a>
<a href="/users/242134/aressidi" >aressidi</a> <span
class="reputation-score" title="reputation score">27</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2839959">
<div
onclick="javascript:window.location.href='/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications'"
class="cp">
<div class="votes">
<div class="mini-counts">-3</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">52</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications"
class="question-hyperlink" title="jQuery+jQueryUI Vs Yahoo UI..Which is the
best UI to use in asp.net web applications?
">jQuery+jQueryUI Vs Yahoo UI..Which is the best one for web
applications?</a></h3>
<div class="tags t-aspunet t-jquery-ui t-yahoo t-ui t-subjective">
<a href="/questions/tagged/asp.net" class="post-tag"
title="show questions tagged 'asp.net'" rel="tag">asp.net</a> <a
href="/questions/tagged/jquery-ui" class="post-tag" title="show questions
tagged 'jquery-ui'" rel="tag">jquery-ui</a> <a href="/questions/tagged/yahoo"
class="post-tag" title="show questions tagged 'yahoo'" rel="tag">yahoo</a> <a
href="/questions/tagged/ui" class="post-tag" title="show questions tagged
'ui'" rel="tag">ui</a> <a href="/questions/tagged/subjective"
class="post-tag" title="show questions tagged 'subjective'"
rel="tag">subjective</a>
</div>
<div class="started">
<a
href="/questions/2839959/jqueryjqueryui-vs-yahoo-ui-which-is-the-best-one-for-web-applications/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:24Z"
class="relativetime">8m ago</span></a>
<a href="/users/135494/clement-herreman" >Clement
Herreman</a> <span class="reputation-score" title="reputation
score">1,412</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844516">
<div
onclick="javascript:window.location.href='/questions/2844516/python-filter-a-dictionary'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">25</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844516/python-filter-a-dictionary"
class="question-hyperlink" title="Hi,
I have a dictionary of points, say:
>>> points={'a':(3,4), 'b':(1,2), 'c':(5,5), 'd':(3,3)}
I want to create a new dictionary with all the points whose x and y value
is smaller than … ">Python: Filter a dictionary</a></h3>
<div class="tags t-python t-dictionary t-filter">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a> <a
href="/questions/tagged/dictionary" class="post-tag" title="show questions
tagged 'dictionary'" rel="tag">dictionary</a> <a
href="/questions/tagged/filter" class="post-tag" title="show questions tagged
'filter'" rel="tag">filter</a>
</div>
<div class="started">
<a
href="/questions/2844516/python-filter-a-dictionary/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:17Z"
class="relativetime">8m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-556525">
<div
onclick="javascript:window.location.href='/questions/556525/raw-socket-implementation-in-windows'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered-accepted" title="one of the answers
was accepted as the correct answer">
<div class="mini-counts">4</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts warm"><span title='1446
views'>1</span></div>
<div class='warm'>kviews</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/556525/raw-socket-implementation-in-windows"
class="question-hyperlink" title="I need to create TCP/IP headers manually
for my application. For that i used Raw socket. My system os is win xp
(SP3).
My code compiles fine :) but it throws a run time error:
Initialising … ">Raw socket implementation in windows?</a></h3>
<div class="tags t-ccc t-sockets t-socket-programming t-tcpip">
<a href="/questions/tagged/c%2b%2b" class="post-tag"
title="show questions tagged 'c++'" rel="tag">c++</a> <a
href="/questions/tagged/sockets" class="post-tag" title="show questions
tagged 'sockets'" rel="tag">sockets</a> <a
href="/questions/tagged/socket-programming" class="post-tag" title="show
questions tagged 'socket-programming'" rel="tag">socket-programming</a> <a
href="/questions/tagged/tcpip" class="post-tag" title="show questions tagged
'tcpip'" rel="tag">tcpip</a>
</div>
<div class="started">
<a
href="/questions/556525/raw-socket-implementation-in-windows/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:15Z"
class="relativetime">8m ago</span></a>
<a href="/users/342456/dfak" >dfak</a> <span
class="reputation-score" title="reputation score">1</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844253">
<div
onclick="javascript:window.location.href='/questions/2844253/php-url-detection-regexp-includes-line-breaks'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">2</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">20</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks"
class="question-hyperlink" title="I want to have a function which gets a text
as the input and gives back the text with URLs made to HTML links as the
output.
My draft is as follows:
function autoLink($text) {
return … ">PHP: URL detection (regexp) includes line
breaks</a></h3>
<div class="tags t-regex t-php t-function">
<a href="/questions/tagged/regex" class="post-tag"
title="show questions tagged 'regex'" rel="tag">regex</a> <a
href="/questions/tagged/php" class="post-tag" title="show questions tagged
'php'" rel="tag">php</a> <a href="/questions/tagged/function"
class="post-tag" title="show questions tagged 'function'"
rel="tag">function</a>
</div>
<div class="started">
<a
href="/questions/2844253/php-url-detection-regexp-includes-line-breaks/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:06Z"
class="relativetime">8m ago</span></a>
<a href="/users/89771/alix-axel" >Alix Axel</a> <span
class="reputation-score" title="reputation score 12100">12.1k</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2842579">
<div
onclick="javascript:window.location.href='/questions/2842579/equivalent-to-unix-less-command-within-r-console'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">3</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">62</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console"
class="question-hyperlink" title="Is there an equivalent to the unix less
command that can be used within the R console?
">Equivalent to unix “less” command within R console</a></h3>
<div class="tags t-less t-r t-shell">
<a href="/questions/tagged/less" class="post-tag" title="show
questions tagged 'less'" rel="tag">less</a> <a href="/questions/tagged/r"
class="post-tag" title="show questions tagged 'r'" rel="tag">r</a> <a
href="/questions/tagged/shell" class="post-tag" title="show questions tagged
'shell'" rel="tag">shell</a>
</div>
<div class="started">
<a
href="/questions/2842579/equivalent-to-unix-less-command-within-r-console/?lastactivity"
class="started-link"><span title="2010-05-16 16:39:03Z"
class="relativetime">8m ago</span></a>
<a href="/users/16632/hadley" >hadley</a> <span
class="reputation-score" title="reputation score">4,252</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2841183">
<div
onclick="javascript:window.location.href='/questions/2841183/access-tree-object-in-netbeans-outline'"
class="cp">
<div class="votes">
<div class="mini-counts">0</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">14</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2841183/access-tree-object-in-netbeans-outline"
class="question-hyperlink" title="I'm using Outline from netbeans to display
some structured data.
How can I map selected row to an object in tree?
">Access tree object in netbeans outline</a></h3>
<div class="tags t-java t-swing t-outline">
<a href="/questions/tagged/java" class="post-tag" title="show
questions tagged 'java'" rel="tag">java</a> <a href="/questions/tagged/swing"
class="post-tag" title="show questions tagged 'swing'" rel="tag">swing</a> <a
href="/questions/tagged/outline" class="post-tag" title="show questions
tagged 'outline'" rel="tag">outline</a>
</div>
<div class="started">
<a
href="/questions/2841183/access-tree-object-in-netbeans-outline/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:58Z"
class="relativetime">8m ago</span></a>
<a href="/users/230513/trashgod" >trashgod</a> <span
class="reputation-score" title="reputation score">5,490</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2844165">
<div
onclick="javascript:window.location.href='/questions/2844165/wpf-hwndhost-keyboard-focus'"
class="cp">
<div class="votes">
<div class="mini-counts">1</div>
<div>vote</div>
</div>
<div class="status answered">
<div class="mini-counts">1</div>
<div>answer</div>
</div>
<div class="views">
<div class="mini-counts">10</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a href="/questions/2844165/wpf-hwndhost-keyboard-focus"
class="question-hyperlink" title="The chart area in the screenshot is a
HwndHost control which hosts a native Win32 window (with it's own registered
WNDCLASS) implemented in C++/CLI and drawn with Direct2D. The HwndHost is
hosted in a … ">WPF HwndHost keyboard focus</a></h3>
<div class="tags t-wpf t-interop t-win32 t-hosted t-focus">
<a href="/questions/tagged/wpf" class="post-tag" title="show
questions tagged 'wpf'" rel="tag">wpf</a> <a href="/questions/tagged/interop"
class="post-tag" title="show questions tagged 'interop'"
rel="tag">interop</a> <a href="/questions/tagged/win32" class="post-tag"
title="show questions tagged 'win32'" rel="tag">win32</a> <a
href="/questions/tagged/hosted" class="post-tag" title="show questions tagged
'hosted'" rel="tag">hosted</a> <a href="/questions/tagged/focus"
class="post-tag" title="show questions tagged 'focus'" rel="tag">focus</a>
</div>
<div class="started">
<a
href="/questions/2844165/wpf-hwndhost-keyboard-focus/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:46Z"
class="relativetime">9m ago</span></a>
<a href="/users/212865/adal" >Adal</a> <span
class="reputation-score" title="reputation score">259</span>
</div>
</div>
</div>
<div class="question-summary narrow" id="question-summary-2843053">
<div
onclick="javascript:window.location.href='/questions/2843053/go-through-a-number-of-functions-in-python'"
class="cp">
<div class="votes">
<div class="mini-counts">2</div>
<div>votes</div>
</div>
<div class="status answered">
<div class="mini-counts">6</div>
<div>answers</div>
</div>
<div class="views">
<div class="mini-counts">77</div>
<div>views</div>
</div>
</div>
<div class="summary">
<h3><a
href="/questions/2843053/go-through-a-number-of-functions-in-python"
class="question-hyperlink" title="I have an unknown number of functions in my
python script (well, it is known, but not constant) that start with site_...
I was wondering if there's a way to go through all of these functions in
some … ">Go through a number of functions in Python</a></h3>
<div class="tags t-python">
<a href="/questions/tagged/python" class="post-tag"
title="show questions tagged 'python'" rel="tag">python</a>
</div>
<div class="started">
<a
href="/questions/2843053/go-through-a-number-of-functions-in-python/?lastactivity"
class="started-link"><span title="2010-05-16 16:38:33Z"
class="relativetime">9m ago</span></a>
<a href="/users/20862/ignacio-vazquez-abrams" >Ignacio
Vazquez-Abrams</a> <span class="reputation-score" title="reputation score
36114">36.1k</span>
</div>
</div>
</div>
}
來,if 成立跟不成立的兩段,幾乎都一樣,
但是有一個地方套用的 css 不同,完全就是你所舉的例子,
那你現在就是接手的那個人,
現在客戶有兩個要求:
1. 他 else 的地方要換一種 css,請把那個不同的找出來吧。
2. 不管 if 成立不成立,他在尾端倒數第二個 div 要換個字體。
靠北,嘴炮都很簡單,
if ( n % 2 ) {
/// 幾百行前半部
xxxx
/// 幾百行後半部
}
else {
/// 幾百行前半部
oooo
/// 幾百行後半部
}
這樣虛擬碼寫起來的確不一樣的地方一眼就可以看到,
請問他媽的真的幾百行展開的時候,你還會跟我說那叫做好 maintain 嗎?
你知道什麼叫做好 maintain 嗎?
if ( n % 2 ) {
幾百行前半部() ;
xxxx
幾百行後半部() ;
}
else {
幾百行前半部() ;
oooo
幾百行後半部() ;
}
你沒發現你舉的例子,
剛好就是在說明為什麼應該要抽函數嗎?
或是你要
幾百行前半部() ;
n % 2 ? xxxx : oooo ;
幾百行後半部() ;
也行,都比他媽的幾百行還要好好嗎?
用點腦,我不是說你沒用腦,我只是希望你多思考,
真的 code 擺在眼前的時候,你再說說看 duplicated code 好 maintain 阿?
說阿。
--
To iterate is human, to recurse, divine.
遞迴只應天上有, 凡人該當用迴圈. L. Peter Deutsch
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.160.116.174
→ james732:光是按→就按到暈了....orz 05/17 01:08
→ derekQQ:我也是... 05/17 01:16
→ andymai:我居然看到類似我以前看過的寫法XD 因為功能要因應權限而 05/17 01:17
推 wa120:我說的是function深度的問題 不是這種連function都用不到 05/17 01:17
→ wa120:的code 05/17 01:18
→ andymai:而顯示或隱藏~所以他乾脆Copy貼再把不同的部份改掉後用if 05/17 01:18
→ yoco315:拜託 先生 怎麼簡單的 duplicated code 都沒辦法 maintain 05/17 01:19
→ yoco315:你如何說服別人當狀況複雜到連用 function 都難 maintain 05/17 01:19
→ wa120:我可以把之前那個Color刪除 因為那個本來就很爛 05/17 01:19
→ andymai:區隔...當時看完只覺得:還好這不是我要接的code XD 05/17 01:19
→ yoco315:的時候用 dup code 會比較好 maintain?? 說說看 05/17 01:19
→ wa120:這問題還要用到function嗎 05/17 01:19
→ yoco315:可以,我等你重新舉個好例子,非常期待.. 05/17 01:20
→ wa120://幾百行前半部 05/17 01:20
→ wa120:xn % 2 ? xxxx : oooo ; 05/17 01:20
→ wa120://幾百行後半部 05/17 01:21
→ andymai:這篇作者真的很氣~但就算再氣~也不用寫些情緒化的字眼吧.. 05/17 01:21
→ yoco315:我等你舉個好例子說明 dup code 的好處,來 :) 05/17 01:23
→ yoco315:完全看不下去你在那邊胡說八道.. 05/17 01:23
→ AmosYang:dup code的好處: 當薪水是用LoC計價時… XD 05/17 01:24
→ yoco315:他就是在胡說嘛..「我是說function開太深的狀況」 05/17 01:27
→ yoco315:如果連用上function都很難處理的乾淨,那我真的很好奇 05/17 01:27
→ yoco315:很好奇他要如何用 dup code 處理的更好... 05/17 01:28
→ yoco315:更別說加個功能的時候還要改好幾份... -_- 05/17 01:29
→ yoco315:到底懂不懂阿??? 又不是小大一,軟工都唸了還講這種話?? 05/17 01:29
→ yoco315:搞笑阿? joke 版歡迎你.. 05/17 01:30
推 VegasBlvd:有笑有推 05/17 09:43
→ yoco315:有沒有大大可以教一下黑單要怎麼設? 05/17 12:03
→ yoco315:現在 wa120 一直寄信來跟我開示 ^C^V 的好處,我快崩潰了 05/17 12:03
推 dryman:主選單->特別名單->黑名單->A 新增黑名單使用者 05/17 12:05
→ dryman:BTW 可不可以把信轉給我笑一下XD 05/17 12:06
→ yoco315:歹事捏,砍了,但是大致就是說他不抽函數是因為他一抽 05/17 12:11
→ yoco315:就要動十幾個地方,而哪邊會出錯不知道... 05/17 12:11
→ yoco315:真的很想告訴他:「會發生這種事就是因為 dup code」 05/17 12:12
→ yoco315:辯論的時,正方辯友拿出來的例子剛好支持反方.. 真的很讚.. 05/17 12:12
推 dryman:XDDDDDDDD 就算真的很深層,有debugger也可以追的出來啊 05/17 12:17
→ dryman:通常排版等也不太會用到深層迴圈啦,其他程式開發通常會用 05/17 12:18
→ dryman:物件導向來取代深層迴圈,還有遞迴可用呢(茶) 05/17 12:18
→ twnin:完完全全把Html寫到ASP裡面真的很機歪 05/17 14:35
推 legendmtg:設黑單好像也不能防信件 05/17 16:40
→ TonyQ:設黑名單可以防信件 寄信時會找不到收件者 05/17 16:51
推 wa120:是yoco315自己私底下回信酸我 何必拿來板上嘲諷 05/17 17:35
→ wa120:除了智障 白吃 你還有什麼話會講? 05/17 17:36
推 dryman:樓上還是programming小版主呢...很厲害的 05/17 17:39
推 dryman:弄錯,是版主喔~版主大人是對的 科科 05/17 17:44
推 ggg12345:長度蠻嚇人,但如果剪下存檔用IE來看,似乎沒有那麼眼花啊! 05/17 18:33
→ yoco315:wa120 大大請息怒.. 你還沒給個好範例呢... 啾咪 等你喔 05/17 18:37
→ yoco315:竟然這麼有自信^C^P好維護,想必背後一定有精良的例子 05/17 18:40
→ yoco315:相信大大你不會只是嘴砲而已,不妨拿出來大家學習一下..XD 05/17 18:40
→ yoco315:wa120你先寄信來的,我都叫你不要寄了,你還寄.. 05/17 18:43
→ yoco315:現在說我回文酸你,哩馬好了,話都給你講,自己來又自己走.. 05/17 18:43
→ yoco315:叫你不要寄信給我你是看不懂嗎.. 看不懂看不懂看不懂嗎?? 05/17 18:44
→ wa120:沒生氣 我先收到信才回的 沒先看到你SJ板的酸文 05/17 18:45
→ wa120:你是推文才要我不要寄的喔 05/17 18:46
→ yoco315:那就好.. ^_____^ 另外不要再寄啦, 我都沒看直接砍的... 05/17 18:47
→ yoco315:這麼愛找人講話可以到板上講,很多人會回你 :D 05/17 18:47
→ wa120:謝謝喔 你還真好 05/17 18:48
→ yoco315:狗屁,老早就回信叫你別寄了,豪洨不用錢... 跟 ^C^P 一樣.. 05/17 18:48
→ yoco315:~_~||||| 我竟然跟你這種程度的人打爛仗.. 真是白癡死了.. 05/17 18:56
→ yoco315:算了.. = =" ^C^V 很贊 你都對.. 05/17 18:56
推 kami1119:這篇是萬里長城code xD 05/17 20:49
→ newjoy:我發現問題在哪了... "自己做一個屬於自己的library 05/17 23:02
→ newjoy: 然後下次在開發的時候就複製貼上" ........... 05/17 23:03
→ rofellosx:只能複製貼上的library... 05/17 23:33
→ Sigma322:不用太認真 有太多公司是用行數來算錢的 05/18 01:58
推 yauhh:我認為,妳的例子中難以維護的原因是程式內容太多,而不是分二 05/18 02:13
→ yauhh:段不容易維護. 05/18 02:13
→ yauhh:至於這種東西,何必打爛仗? 一個梗玩久了會很厭,不是嗎? 05/18 02:14
→ yauhh:未看先猜,某仁兄不要討論我"言下之意".請討論"言中之意".謝 05/18 02:15
推 luciferii:天,這種笑話推文還要繼續下去嗎?這篇要看推文很累底 05/18 02:32
→ yauhh:我仔細看完這篇了,覺得這問題是...當你走入一個死巷時,不要 05/18 02:40
→ yauhh:花很多時間抱怨當初為什麼不在對的地方繞彎. 當初能繞就繞了 05/18 02:41
→ yauhh:然後,它只是個爛例子.一個爛例子用以延伸到徹底否定一套方法 05/18 02:43
→ yauhh:你的對手也能做出同樣的辦法呢. 但方法論不是這樣處理的. 05/18 02:44
推 luciferii:沒救了...話說回來按$看廢推文很累XD 05/18 02:49
→ yauhh:那請你不要製造廢推文啊 05/18 02:53
→ yauhh:別人的推文就是廢推文,你的推文就不是廢推文,笑話 05/18 02:54
推 dryman:噗,就是因為c&p才會變得太多啊 05/18 05:36
→ dryman:改用function call只會有一半長度... 05/18 05:37
→ yauhh:case by case 05/18 08:03
推 dryman:那你拿出個case好不好,嘴砲人人都會,東西做出來才是真的 05/18 08:18
→ yauhh:不好意思,並不是每個人一定要貼出一些碼才能說不嘴砲. 倒是 05/18 08:22
→ yauhh:為了討論是否嘴砲而回應推文的,當句就是嘴砲啊. 05/18 08:23
→ yauhh:function call只會有一半長度誰都知道. 問題是,當初這樣的 05/18 08:26
→ yauhh:code怎麼長出來的,你能掌握嗎? 如果你能掌握當然會收進func 05/18 08:26
→ yauhh:,但就是因為你不能掌握,而原code又沒有很特別不好的地方, 05/18 08:27
→ yauhh:那你要說"為什麼不生個function call節省碼長",也是嘴砲. 05/18 08:28
→ yauhh:本文這段碼,如果c-p一大堆只為了換一個style,當然很差. 05/18 08:29
→ yauhh:我所指容易維護的是,如果以上code前一段是新增資料,後一段 05/18 08:30
→ yauhh:是修改資料,則分開寫是不錯的. 05/18 08:30
→ yauhh:你要case,我給你二句話一個case就搞定. 刁難別人很容易嗎? 05/18 08:31
→ yauhh:如果要把二種情況用心寫成一份程式碼,就會撞到維護時要有 05/18 08:34
→ yauhh:觀點整合的問題:你本來知道這程式有四個phase,但是維護的人 05/18 08:35
→ yauhh:要慢慢讀,讀的過程中會一直猜"3個phase?2個phase?"把觀念重 05/18 08:36
→ yauhh:建. 而c-p的情況是,你從大結構就看出到底有幾個phase,而且 05/18 08:37
→ yauhh:每個phase有明確的標示.所以你會問:"要修改哪裡?" 然後拉到 05/18 08:37
→ yauhh:要修改的位置去馬上改. 05/18 08:38
→ juriolegend:改的過程中就會一直這個phase改了,下個phase會不會死 05/18 23:00
→ juriolegend:下個phase死過後,挖..還有兩個...等死好了 05/18 23:00
→ juriolegend:因為他們都長的好像一樣,卻要去找他們哪邊不一樣 05/18 23:00
推 ku399999:我怎麼覺得c-p好改的地方function call也很好改.. 05/20 00:39