D******n 发帖数: 2836 | 1 People are crazy in our company..
ex1: File2 includes file1. File1 has a "%macro xxx" but it does not have
"%mend", turned out it is in file2 while file2 has many macros too.
ex2: macros inside a macro...wtf....
other stuffs, no indents, no comments... |
l*********s 发帖数: 5409 | 2 good for job security,hehe |
s*r 发帖数: 2757 | 3 i know you will hate it
【在 D******n 的大作中提到】 : People are crazy in our company.. : ex1: File2 includes file1. File1 has a "%macro xxx" but it does not have : "%mend", turned out it is in file2 while file2 has many macros too. : ex2: macros inside a macro...wtf.... : other stuffs, no indents, no comments...
|
o****o 发帖数: 8077 | 4 job security 啊
【在 D******n 的大作中提到】 : People are crazy in our company.. : ex1: File2 includes file1. File1 has a "%macro xxx" but it does not have : "%mend", turned out it is in file2 while file2 has many macros too. : ex2: macros inside a macro...wtf.... : other stuffs, no indents, no comments...
|
r***k 发帖数: 13586 | 5 “macros inside a macro”,这个有问题么? |
c*******o 发帖数: 8869 | 6 理论上说不太好, 其实也没什么。 正确的方法是在一个macro里invoke另一个macro
【在 r***k 的大作中提到】 : “macros inside a macro”,这个有问题么?
|
p********a 发帖数: 5352 | 7 我倒觉得没什么,只是放的位置在里面而已。我就经常这么干。因为有时候别人阅读的
时候,到处乱翻乱找MACRO不大好,放在里面一目了然
【在 c*******o 的大作中提到】 : 理论上说不太好, 其实也没什么。 正确的方法是在一个macro里invoke另一个macro
|
p********a 发帖数: 5352 | 8 我比较CRAZY的是一个老家伙,从来不用MACRO,他的程序经常到50页,然后发过来让我
校对。
【在 D******n 的大作中提到】 : People are crazy in our company.. : ex1: File2 includes file1. File1 has a "%macro xxx" but it does not have : "%mend", turned out it is in file2 while file2 has many macros too. : ex2: macros inside a macro...wtf.... : other stuffs, no indents, no comments...
|
A*******s 发帖数: 3942 | 9 做笔记中...原来可以这样secure job... |
c*******o 发帖数: 8869 | 10 如果内嵌的MACRO位于外围MACRO的一个LOOP里, 那么如果执行外围MACRO一次, 这个
内嵌的MACRO也会被重复的编译, 这是不必要的, 如果放在外面的话, 就只会被编译
一次, 然后被重复的CALL. 当然这一切其实都无所谓,因为跑SAS对内存的要求一般不
大, 呵呵。
【在 p********a 的大作中提到】 : 我倒觉得没什么,只是放的位置在里面而已。我就经常这么干。因为有时候别人阅读的 : 时候,到处乱翻乱找MACRO不大好,放在里面一目了然
|
|
|
b******e 发帖数: 539 | 11 我的理解:其实对SAS来说,放在里面还是放在外面是一样的,一个macro每被call一次
,这个macro里面的程序都会被"编译"一次.所谓的"编译"就是把程序展开...
【在 c*******o 的大作中提到】 : 如果内嵌的MACRO位于外围MACRO的一个LOOP里, 那么如果执行外围MACRO一次, 这个 : 内嵌的MACRO也会被重复的编译, 这是不必要的, 如果放在外面的话, 就只会被编译 : 一次, 然后被重复的CALL. 当然这一切其实都无所谓,因为跑SAS对内存的要求一般不 : 大, 呵呵。
|
D******n 发帖数: 2836 | 12 It is not about compiling efficiency.
I am talking about readability.
If u put macros inside macro it becomes too big a chunk of shit, and very
hard to read. It is against the structured/modular programming paradigm.
But this definitely enhances job security...hoho.
【在 c*******o 的大作中提到】 : 理论上说不太好, 其实也没什么。 正确的方法是在一个macro里invoke另一个macro
|
c*******o 发帖数: 8869 | 13 are you in health care or finance? is utilization of SAS a must?
【在 D******n 的大作中提到】 : It is not about compiling efficiency. : I am talking about readability. : If u put macros inside macro it becomes too big a chunk of shit, and very : hard to read. It is against the structured/modular programming paradigm. : But this definitely enhances job security...hoho.
|
r***k 发帖数: 13586 | 14 可读性不一定有问题吧,只要你把所有的子macro放在母macro的开头,作好注释就行了
。其实和放外边没区别的。当然如果是母macro写了一半再开始子macro,然后子macro
完了又是母macro,那样可读性确实有问题。
【在 D******n 的大作中提到】 : It is not about compiling efficiency. : I am talking about readability. : If u put macros inside macro it becomes too big a chunk of shit, and very : hard to read. It is against the structured/modular programming paradigm. : But this definitely enhances job security...hoho.
|
w**********r 发帖数: 986 | 15 Have you ever met these examples?
http://www2.sas.com/proceedings/sugi23/Training/p275.pdf
【在 D******n 的大作中提到】 : People are crazy in our company.. : ex1: File2 includes file1. File1 has a "%macro xxx" but it does not have : "%mend", turned out it is in file2 while file2 has many macros too. : ex2: macros inside a macro...wtf.... : other stuffs, no indents, no comments...
|
D******n 发帖数: 2836 | 16 fun to read!!!!!!
【在 w**********r 的大作中提到】 : Have you ever met these examples? : http://www2.sas.com/proceedings/sugi23/Training/p275.pdf
|
s*****n 发帖数: 2174 | 17 惊了, 竟然还有这种training, 这是SAS的特例还是general practice?
我一直都追求让我的code尽量well-structured, rich-commented,
easy to understand and maintained by anyone. 原来这个有伤
job security啊.....
【在 D******n 的大作中提到】 : fun to read!!!!!!
|
D******n 发帖数: 2836 | 18 I think this is joke. In a formal company with a mindset of constant pursue
of efficiency and reliability , i guess, if some1 writes code like this ,he
should be red-flagged if not fired. Although in many companies where they do
analytics, unlike many hard-core software companies, the management ppl
might not know or care about this. Without a top-down and documented mandate
,ppl will just write their own styles of codes securing their jobs(its
dangerous though, cause some1 can just not use that |
o****o 发帖数: 8077 | 19 哈哈,这个是art写的反例集合,有种修辞手段叫啥来着,跟这个一个路子
其实说的是伤job security的事,如果老板懂行的话。。。
不过感觉很多SAS programmer都在business经理手下干活,所以只要不出大问题,反而
有利于job security
我原来工作的一家公司,那群用SAS做数据的,程序写得糟糕透了,效率极低,结果人
家给老板打报告说,1.不得不加班,你看,一个job要跑整整一天,还需要很多人工干
预;2.请增加人手和机器。。。。那个管业务的老板也不懂,觉得丫们干的活太nb了,
1个contractor转正,又加了几个openning
程序写得好不如嘴巴吹得妙啊
【在 s*****n 的大作中提到】 : 惊了, 竟然还有这种training, 这是SAS的特例还是general practice? : 我一直都追求让我的code尽量well-structured, rich-commented, : easy to understand and maintained by anyone. 原来这个有伤 : job security啊.....
|
d*******1 发帖数: 854 | 20 老大你的R编程功力很牛, 但是英文阅读能力可成问题啊。
【在 s*****n 的大作中提到】 : 惊了, 竟然还有这种training, 这是SAS的特例还是general practice? : 我一直都追求让我的code尽量well-structured, rich-commented, : easy to understand and maintained by anyone. 原来这个有伤 : job security啊.....
|
s*****n 发帖数: 2174 | 21 ok, that makes more sense. :) |
S******y 发帖数: 1123 | 22 I am always adding 'near-excessive' level comments to my SAS, R & Python
code to make sure other people can pick it up and put it to use immediately
(i.e., zero cost of adoption). I also make sure my programs are readable and well-structured. It makes me feel good, and we all become
more productive. It is a win-win situation. (In Python, it forces
indentation. So good coding styles are enforced automatically.)
But I fully understand what people mentioned here can be described as a "
dark-art" |