4 ms·
Because the guy who wrote this: if (MonthNbr == 1) {MonthDesc = "January"} ; if (MonthNbr == 2) {MonthDesc = "February"} ; if (MonthNbr == 3) {MonthDesc = "M
by edw519 19y ago
Because the guy who wrote this:
if (MonthNbr == 1) {MonthDesc = "January"} ;
if (MonthNbr == 2) {MonthDesc = "February"} ;
if (MonthNbr == 3) {MonthDesc = "March"} ;
if (MonthNbr == 4) {MonthDesc = "April"} ;
if (MonthNbr == 5) {MonthDesc = "May"} ;
if (MonthNbr == 6) {MonthDesc = "June"} ;
if (MonthNbr == 7) {MonthDesc = "July"} ;
if (MonthNbr == 8) {MonthDesc = "August"} ;
if (MonthNbr == 9) {MonthDesc = "September"} ;
if (MonthNbr == 10) {MonthDesc = "October"} ;
if (MonthNbr == 11) {MonthDesc = "November"} ;
if (MonthNbr == 12) {MonthDesc = "December"} ;
is a retired millionaire while I'm still cleaning up his mess.
I think I can do better.
- hhm 19y agoBut really, is that it? Are you in a startup for the money, or is there another motivation?
- mrtron 19y agoMoney is not a bad reason. With money comes freedom in aspects of your life, you no longer would need to work a normal job to get by.
- hhm 19y agoI don't think it's a bad reason. But from what I see in this site, I don't think it's the main reason for most hackers to do what they do. That's why I ask.
- iamwil 19y agoIf your wants and standard of living balloon, you'll always think you need more money to gain freedom.
- mrtron 19y agoAbsolutely. The key to getting freedom financially is living well below your means. That starts before you get rich, and has to continue at that point. Money can either be a tool used by you to build freedom or dig yourself in a little hole.
- Tichy 19y agoWhat about the freedom to donate a couple of billion dollars to HIV research or whatever else you fancy (ending world hunger etc)?
- edw519 19y agoNo, I'm not in it for the money. The money is a barometer of something else. If someone can make money in this business (not that hard to do), then something they wrote is successful at some level. I can confidently say that 90% of the code I have ever had to maintain is total garbage. I am often stunned that it even runs and I used to wonder how it ever made it into production. (I don't wonder any more, now I know, hardly anyone QA's source code anymore.) (Another example: Today I refactored 1200 lines of code that edits credit card numbers down to 46 lines, removing 4 bugs in the process. This has been running in production for 18 years. This is not a joke.) I realize that what I see is not a random sample of all code. I never get to work on the good stuff; no one does - that's the whole point. My work, OTOH, has been wildly received by my customers and users for many years. I love what I do and love providing value to others. I can't imagine doing anything else. I am currently working on my ultimate start-up, one that produces so much value that no one ever has to put up with garbage like my OP. For some reason (my internal metaprogams or something), I am much more highly motivated by seeing someone else's garbage doing well and thinking, "I can do WAY better than that," instead of people saying, "That was good." I don't know why. Also, it's my experience that most people do not see the possibilities for truly excellent software (present readers excluded, of course). They believe they have to put up with my previous example. I can't wait to show them otherwise. My OP was somewhat in jest, but not really. I hope you now understand why. Thanks for asking.
- hhm 19y agoThanks a lot for your interesting reply. And: "I never get to work on the good stuff; no one does" is true most of the time if you don't do a startup, or work by your own way. Or maybe if you work in some cool lab?
- deleted 19y ago[deleted]
- david927 19y agohttp://steve-yegge.blogspot.com/2006/07/get-famous-by-not-programming.html http://steve-yegge.blogspot.com/2006/07/get-famous-by-not-pr... "Can programming make you rich? Well, let's figure it out: think of all the fantastically rich programmers you know. Not a very long list, is it? And did they get rich by virtue of being incredible programmers?" "A startup that manages to get acquired doesn't have to have had great code; they simply had to either establish a lead in a new market, or put on a damn good road show."
- pius 19y agoIt's worth noting that the programmer who wrote this string-based numerical rounding procedure: # round to one decimal place and # separate into whole and fractional parts parts = str(round(star_sum/num_raters, 1)).split('.') whole = int(parts[0]) frac = int(parts[1]) if frac < 3: ___frac = 0 elif frac > 7: ___frac = 0 ___whole += 1 else: ___frac = 5 # recombine for a star rating rounded to the half stars = float(str(whole)+'.'+str(frac)) is running a pretty famous startup.
- stcredzero 19y agoThe semantics of that are no different than a case statement. (Unless this is in a performace-critical loop, and you'd gain something though a compiler optimization of the case statement.) You're equating using case statement syntax to good programming? That's the best example you have of a "mess?" That makes me suspect that you don't think about programming at a very high level and that you like making largely arbitrary changes to code for (unacknowledged) ego-driven reasons.
- edw519 19y ago"You're equating using case statement syntax to good programming?" No. I'd prefer something a little closer to: Months = ['January','February','March','April','May','June','July','August','September','October','November','December']; MonthDesc = Months[MonthNbr - 1]; "That's the best example you have of a mess?" No. Just what came to mind. "That makes me suspect that you don't think about programming at a very high level" You suspect wrong. Don't suspect. Ask and find out. "you like making largely arbitrary changes to code for (unacknowledged) ego-driven reasons" If only I had the time, that would be my dream come true!
- stcredzero 19y agoArray indexing is just another way of getting it done. Often a case statement is going to be faster. 90% of the time, it just doesn't matter. If you're getting paid for doing such useless code changes, you might as well get paid for surfing Y Combinator news. Perhaps that's why the original programmer is a successful founder, and you're fixing the code. > You suspect wrong. Don't suspect. Ask and find out. Don't have to ask. You actually think minutiae at this level is interesting discussion. That's evidence against you.
- brlewis 19y agoI actually think cutting 12 lines of code down to 2 is worthwhile. He could have posted an example of 600 lines of code that should have been 50, but I'm glad he didn't.
- 19y ago