锁定老帖子 主题:看到这么雷人的代码,真是悲催
该帖已经被评为精华帖
|
|
---|---|
作者 | 正文 |
发表时间:2011-05-13
上一家公司看到过类似的代码。
估计主要是属性都太专业了,索性就用了拼音首字母。 当时我就说了,就算用拼音也把拼音打全 |
|
返回顶楼 | |
发表时间:2011-05-13
最后修改:2011-05-13
jinzhen1978 写道 这种代码很常见,hibernate生成的pojo都是这样的,你们没有注意吗?
本人一生最讨厌的就是Hibernate,怎一个恶心了得? |
|
返回顶楼 | |
发表时间:2011-05-13
nianien 写道 public CktsQfxxHsh(String hjBh, String fqfZt, String jsfZt, String qcrDm, String qcrXm, String fhrDm, String fhrXm, String qfrDm, String qfrXm, String nsrsbhGf, String nsrxmGf, String nsrsbhXf, String nsrxmXf, String swjgDmJsf, String swjgDmFqf, String swjgJcFqf, String swjgJcJsf, String bfpryDm, String bspryMc, String lxrXm, String lxrDh, String lxrDz, String lxrYb, Date sjSc, Date sjFs, Date sjTjfh, Date sjTjqf, String hjLx, BigDecimal fpfs, BigDecimal jeHj, BigDecimal seHj, BigDecimal jshjHj, String qtqk, BigDecimal tseY, BigDecimal tseZbbl, String fhsm, Date fuhjzrq, Date rqTk, Date sjFuhfs, String dyfhBh, String yqfhBz, String fhBz, String cbBz, Date sjCbhfs) { this.hjBh = hjBh; this.fqfZt = fqfZt; this.jsfZt = jsfZt; this.qcrDm = qcrDm; this.qcrXm = qcrXm; this.fhrDm = fhrDm; this.fhrXm = fhrXm; this.qfrDm = qfrDm; this.qfrXm = qfrXm; this.nsrsbhGf = nsrsbhGf; this.nsrxmGf = nsrxmGf; this.nsrsbhXf = nsrsbhXf; this.nsrxmXf = nsrxmXf; this.swjgDmJsf = swjgDmJsf; this.swjgDmFqf = swjgDmFqf; this.swjgJcFqf = swjgJcFqf; this.swjgJcJsf = swjgJcJsf; this.bfpryDm = bfpryDm; this.bspryMc = bspryMc; this.lxrXm = lxrXm; this.lxrDh = lxrDh; this.lxrDz = lxrDz; this.lxrYb = lxrYb; this.sjSc = sjSc; this.sjFs = sjFs; this.sjTjfh = sjTjfh; this.sjTjqf = sjTjqf; this.hjLx = hjLx; this.fpfs = fpfs; this.jeHj = jeHj; this.seHj = seHj; this.jshjHj = jshjHj; this.qtqk = qtqk; this.tseY = tseY; this.tseZbbl = tseZbbl; this.fhsm = fhsm; this.fuhjzrq = fuhjzrq; this.sjFuhfs = sjFuhfs; this.dyfhBh = dyfhBh; this.yqfhBz = yqfhBz; this.fhBz = fhBz; this.cbBz = cbBz; this.sjCbhfs = sjCbhfs; } 写这个的人应该很爽,后期再维护的人,应该准备自杀了.. |
|
返回顶楼 | |
发表时间:2011-05-13
插件自动生成滴,不要大惊小怪啦
|
|
返回顶楼 | |
发表时间:2011-05-13
dbcman 写道 插件自动生成滴,不要大惊小怪啦
难道是万恶的Hibernate? |
|
返回顶楼 | |
发表时间:2011-05-13
nianien 写道 public CktsQfxxHsh(String hjBh, String fqfZt, String jsfZt, String qcrDm, String qcrXm, String fhrDm, String fhrXm, String qfrDm, String qfrXm, String nsrsbhGf, String nsrxmGf, String nsrsbhXf, String nsrxmXf, String swjgDmJsf, String swjgDmFqf, String swjgJcFqf, String swjgJcJsf, String bfpryDm, String bspryMc, String lxrXm, String lxrDh, String lxrDz, String lxrYb, Date sjSc, Date sjFs, Date sjTjfh, Date sjTjqf, String hjLx, BigDecimal fpfs, BigDecimal jeHj, BigDecimal seHj, BigDecimal jshjHj, String qtqk, BigDecimal tseY, BigDecimal tseZbbl, String fhsm, Date fuhjzrq, Date rqTk, Date sjFuhfs, String dyfhBh, String yqfhBz, String fhBz, String cbBz, Date sjCbhfs) { this.hjBh = hjBh; this.fqfZt = fqfZt; this.jsfZt = jsfZt; this.qcrDm = qcrDm; this.qcrXm = qcrXm; this.fhrDm = fhrDm; this.fhrXm = fhrXm; this.qfrDm = qfrDm; this.qfrXm = qfrXm; this.nsrsbhGf = nsrsbhGf; this.nsrxmGf = nsrxmGf; this.nsrsbhXf = nsrsbhXf; this.nsrxmXf = nsrxmXf; this.swjgDmJsf = swjgDmJsf; this.swjgDmFqf = swjgDmFqf; this.swjgJcFqf = swjgJcFqf; this.swjgJcJsf = swjgJcJsf; this.bfpryDm = bfpryDm; this.bspryMc = bspryMc; this.lxrXm = lxrXm; this.lxrDh = lxrDh; this.lxrDz = lxrDz; this.lxrYb = lxrYb; this.sjSc = sjSc; this.sjFs = sjFs; this.sjTjfh = sjTjfh; this.sjTjqf = sjTjqf; this.hjLx = hjLx; this.fpfs = fpfs; this.jeHj = jeHj; this.seHj = seHj; this.jshjHj = jshjHj; this.qtqk = qtqk; this.tseY = tseY; this.tseZbbl = tseZbbl; this.fhsm = fhsm; this.fuhjzrq = fuhjzrq; this.sjFuhfs = sjFuhfs; this.dyfhBh = dyfhBh; this.yqfhBz = yqfhBz; this.fhBz = fhBz; this.cbBz = cbBz; this.sjCbhfs = sjCbhfs; } 第一次见到这么牛B的代码!不知道Gosling看了会怎么想! |
|
返回顶楼 | |
发表时间:2011-05-13
和我所见的差不多,你的只是set值,我的还有逻辑的呢。。。
|
|
返回顶楼 | |
发表时间:2011-05-13
说实话,细看一下,命名还挺有规律的.
应该都是一些业务概念吧?估计经常接触业务的应该都能本能的拼出来. 个人感觉这种代码完全称不上悲催雷人,充其量也就是繁琐麻烦.代码生成工具啊,反射字段名自动映射啊,好歹你还有些招可以简化简化. 真正雷人悲催的代码是那种逻辑无限发散的代码,各种依赖关系交织,全局变量满天飞,各种代码风格闪现. |
|
返回顶楼 | |
发表时间:2011-05-13
这种代码怎么简化? 怎么避免呢?
|
|
返回顶楼 | |
发表时间:2011-05-13
tenderuser 写道 这种代码怎么简化? 怎么避免呢?
编码规范里讲,一个方法的参数超过3个以上就可以抽象成对象了 这样编码累死人不偿命啊, 构造一个对象,传的全是字符串,哪个和哪个能对得上,顺序错一下就死翘翘了 |
|
返回顶楼 | |