代码格式化是这样的:
if (flag == 1 && yemian.shop_price == '0.00') {
if (yemian.member_price != '0.00') {
yemian.shop_price = yemian.member_price;
} else if (yemian.retail_price != '0.00') {
yemian.shop_price = yemian.retail_price;
}
}
可不可以做成这样:
if (flag == 1 && yemian.shop_price == '0.00')
{
if (yemian.member_price != '0.00')
{
yemian.shop_price = yemian.member_price;
}
else if (yemian.retail_price != '0.00')
{
yemian.shop_price = yemian.retail_price;
}
}
这样感觉很清晰
我写任何语言都是这样的风格,一目了然
一看你就是C系程序员 😀
扶额.jpg。以前写c的时候我也是那样的,后来换了java跟php,风格就变了,,,