Slashdot Mirror


Ask Slashdot: Getting Feedback On Programming?

jm223 writes "I'm currently a student at a major university, where I do IT work for a fairly large student group. Most of my job involves programming, and so far everyone has been happy with my work. Since we're students, though, no one really has the experience to offer major advice or critiques, and I'm curious about how my coding measures up — and, of course, how I can make it better. CS professors can offer feedback about class projects, but my schoolwork often bears little resemblance to my other work. So, when you're programming without an experienced manager above you, how do you go about improving?"

47 of 196 comments (clear)

  1. Contribute to open source projects by dwmw2 · · Score: 5, Insightful

    Contribute to open source projects. You'll get plenty of feedback. Some of it might be quite, erm, 'robust', especially with certain projects. But it'll almost all be useful, and you'll be doing something worthwhile.

    1. Re:Contribute to open source projects by buchner.johannes · · Score: 4, Interesting

      Contribute to open source projects. You'll get plenty of feedback. Some of it might be quite, erm, 'robust', especially with certain projects. But it'll almost all be useful, and you'll be doing something worthwhile.

      In open source projects, there are problems of all scales. As a newbie, and unfamiliar with the code base, you will only be able to tackle few bugs. So choose a project and a bug you are interested in, and get into it. Bug after bug, you will be able to tackle bigger problems, improving your programming skills (reading code, design, implementation, testing, communication, etc.).
      Don't get bummed if your first code contribution doesn't work out or a interesting project isn't communicating with you. Just move on or do your own thing if you really think it is worth it.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    2. Re:Contribute to open source projects by wrook · · Score: 5, Informative

      When asked this question, I often think, "How do aspiring writers learn their craft?" People who study English read ridiculous numbers of books. This gives them a base to start from when they are writing.

      Writing your own code is invaluable, but when you are just starting out it helps not only to contribute to open source projects, but also to read, read, read. I recommend going through some interesting projects and then forming an opinion about which ones have the best code. Don't just look at it superficially; try to form opinions on specific practices, idioms and designs. Then choose a project to work on and try to follow those ideas. From that point the feedback will be more valuable.

      One of the things that Kent Beck said one time (possibly in an interview with Floss Weekly; I can't remember) was that his level really improved when he sat down and really thought about what he was doing. He just kept writing things over and over again until he could say exactly why he did everything. IIRC, he wrote down all his ideas and put it in a book on Smalltalk coding practices (which I haven't read yet...) I've been trying to do the same thing lately and it is really beneficial. Forming your own ideas and *then* getting feedback seems to be more productive than writing "just to make it work" and getting feedback.

      Just be open minded when you think you have it all sorted out, but someone else thinks your ideas suck ;-)

  2. Try coding for OSS by JoeMerchant · · Score: 2, Informative

    It's going to be nigh impossible to get anyone to review your work code, even though they should.

    If you want some brutally honest critiques of your code, along with a healthy dose of nit-picking and "cultural bias", try writing for one of the major open source projects like FFmpeg, Gimp, KDE, Qt, etc.

    1. Re:Try coding for OSS by W3BMAST3R101 · · Score: 5, Funny

      Your "idea" doesn't work within his original request. Is that all you fucking retards know is to caw on about open source? A bunch of fucking jokers. If you can't offer up advice to adhere to the original request then shut your fucking ass. Fuck you and fuck your open source. Fucking retarded bitch ass cunt.

      Please don't sugar coat it. Tell us how you really feel.

    2. Re:Try coding for OSS by Anonymous Coward · · Score: 3, Insightful

      The quality of open source is usually pretty high, and there is a ton to choose from - from trivial to major projects. Telling someone to look at properietary or closed source code is likely to lead to a dead end.

      Contributing to open source is a different issue: there are usually barriers to entry and a degree of "cliqueness", but thats understandable. Open source projects provides a good vehicle for understanding how groups of people interact. Sometimes its not just about coding and algorithms, but also about acceptance by peers.

    3. Re:Try coding for OSS by wrook · · Score: 5, Insightful

      It's going to be nigh impossible to get anyone to review your work code, even though they should.

      This is unfortunately all too true in most cases. Most organizations do not understand the benefit of rigorous code reviews. If they review code at all, they often only look to see if there are bugs, or if (usually fairly arbitrary) coding standards are followed. I've been lucky enough to work on a few teams with brutally honest reviews. It can be intimidating, but in the end it is incredibly useful for developing yourself. Things like pair programming can also be very useful in this regard.

      One of the things that always bugged me as a programmer was that never once in 20 years did anyone ever evaluate my performance on the basis of the quality of my code. In fact, it was unbelievably rare when the person who evaluated my performance ever even looked at my code. Many of my immediate superiors would not have had the ability to judge one way or another, but even then they never bothered to ask my peers to look at my code and comment.

      For some reason, I often think about programming teams as if they were sports teams. The way most teams are run, you have a manager who knows little about the game you are trying to play and never watches a game. There are no coaches. You performance is loosely evaluated on whether or not your team wins games, but even then the manager usually tries to make it appear that the team won every game whether they did or not. When they try to get new players, they don't bother looking at the success of the player on their previous teams, or even watch them play. At most they set up some artificial 5 minute drill and evaluate that, but usually they base their decisions on a feel-good interview.

      It's quite literally crazy IMHO. In the case of sports it is obvious that this isn't going to work. I'm not sure why it isn't obvious for programming teams.

    4. Re:Try coding for OSS by Anonymous Coward · · Score: 2

      Codebases are of vast different quality. For example,

      mplayer - not very nice code base - something I would not want to immitate. Not for beginners.

      Qt - fairy good, sometimes rushed. Reasonaly good architecture. Most recommended out of these 3 for beginners - plenty of documentation.

      Linux - mostly top-notch, especially the core stuff. Recommended for experts - code is documentation.

    5. Re:Try coding for OSS by bloodhawk · · Score: 4, Insightful

      telling someone that wants critique of his current work to go and do a whole new swag of work on some other project while would provide him with feedback (much of it negative and argumentative about style rather than real substance) is really about the hardest possible way to go about this.

      If you really want comments on your work you need to find someone with experience that is willing to give up some time to mentor/review your work. "Sometimes" you may even find the odd lecturer that has some industry experience, though they seem to be pretty rare and many have a highly inflated (and unexplanable) opinion of there own work. Or perhaps look at some of the online programming forums, many people want peer reviews and swapping code for review not only gets your own work reviewed but gives you exposure to what others produce.

    6. Re:Try coding for OSS by philip.paradis · · Score: 3, Insightful

      On the Internet, nobody may know you're a dog, but everybody knows you're an asshole.

      --
      Write failed: Broken pipe
    7. Re:Try coding for OSS by JoeMerchant · · Score: 4, Interesting

      If you really want comments on your work you need to find someone with experience that is willing to give up some time to mentor/review your work. "Sometimes" you may even find the odd lecturer that has some industry experience, though they seem to be pretty rare and many have a highly inflated (and unexplanable) opinion of there own work. Or perhaps look at some of the online programming forums, many people want peer reviews and swapping code for review not only gets your own work reviewed but gives you exposure to what others produce.

      This would be great, if you can make it happen. In the world I live in, the number of people available to think about anything - programming, or otherwise, decreases like an e^(-x) curve, thousands will give you the 30 seconds it takes to whip off a quick sound-bite of "what they think" after skimming over your question, hundreds will give an extra 60 seconds to actually read the question skim the reference material and cogitate about what you might want to hear rather than what they want to say, tens might take the time to look at a one page program and think about what you're trying to do, by the time you get to 10 pages of code you'll be lucky to find one (experienced, knowledgeable) person who will actually do it. If he's been programming for long, I assume his projects are getting up there in size.

      At least the arrogant pricks defending their OSS fiefdoms will read your code most of the time, if you've submitted it in the proper form. Sure, they'll throw it back in your face if you've used superfluous parenthesis or non-style compliant indenting without even checking to see if it works; but, occasionally, they really do want that bug fixed and they will give you some substantial feedback about your methods. And, if you keep submitting to different projects long enough, you'll eventually find a reviewer who isn't an arrogant prick. The guys at Qt were rather nice about it when they said "oh, nice fix, but we're deprecating that whole branch for version 5, so we're not going to take the time to regression test your code and just leave the 4.x trunk broken for every Intel laptop graphics chipset made in 2008-2010, after all, it's actually Intel's drivers that are buggy."

    8. Re:Try coding for OSS by phantomfive · · Score: 4, Interesting

      One of the things that always bugged me as a programmer was that never once in 20 years did anyone ever evaluate my performance on the basis of the quality of my code. In fact, it was unbelievably rare when the person who evaluated my performance ever even looked at my code. Many of my immediate superiors would not have had the ability to judge one way or another, but even then they never bothered to ask my peers to look at my code and comment.

      It's so hard to do this. I had one coworker who wrote basically unreadable code, that was riddled with bugs. He knew that he had problems, but wasn't sure what. I tried to suggest a few things, but he was really defensive. He disagreed with me, and argued every step of the way. So I took a slow approach, and gave him extremely mild suggestions over time. Eventually he started to improve, but then he quit.

      It is really hard to give programmers coding advice, because usually they are defensive, and will defend their code. On the other hand, I did have one coworker who actually asked for advice from time to time, and when I saw places he could improve, I emailed them to him.

      --
      "First they came for the slanderers and i said nothing."
    9. Re:Try coding for OSS by cowdung · · Score: 4, Insightful

      Unprofessional programmers are defensive. A good programmer will listen and learn when he can.

  3. Post it by datavirtue · · Score: 5, Funny

    Go ahead and post it. We'll offer plenty of........critique.

    --
    I object to power without constructive purpose. --Spock
    1. Re:Post it by Anonymous Coward · · Score: 4, Interesting

      Seriously, though, the problem is that so, so much about programming structure and form is debatable. Since he's a student, he probably does have some obvious rookie mistakes that can be corrected, but he'll still get told many absolutes that are really not at all absolute among good programmers. Some people will correct you for having variable names over, say, 10 characters; others will tell you NEVER use a goto; others will give you a very hard limit on the number of lines any method should be -- on /., I've seen someone claim no more than 10, which is ludicrous to me. A result of all this is that you should ask for advice but judge the reasoning of the advice rather than accepting it blindly (and re-judge it again when you have more experience), and doing that while also pleasing the person giving you advice can be a tricky social situation.

  4. dont worry so much by Anonymous Coward · · Score: 5, Informative

    don't worrry so much about improving. you've probably been coding for 2 years or so (given you're in college) and have made amazing progress in those 2 years. the most important thing you can do is use existing libraries. when you reinvent the wheel, no one understands your code. when you use standard libraries, people still may not understand it, but it's going to be faster and more stable than equivalent code you wrote.

    i've been coding for 8 years and as long as your code is maintainable, works, commented, and capable, you're doing a good job. also, for the love of god, don't hardcode your file paths or operating system. use a standard library, never do a system call. when you have do, error check it.

    1. Re:dont worry so much by History's+Coming+To · · Score: 4, Insightful

      You're right, and I agree, but please humour me with a little devil's advocate...

      I recently worked on a pub website that needed to change to reflect the weather (they've got a big beer garden). My first stop was some code I'd written a couple of years back which parsed METAR data from airport weather stations - I'd already done most of the work I needed to do, but there were a couple of bits that I needed to add. Not wanting to use a bunch of (billable) time I had a look around and found a PEAR module that did much the same, plus a lot more. But it was pretty heavyweight for what I wanted, it was producing four dimensional arrays for example, when all I needed was $wind[speed], $wind[direction] and so on.

      In the end it turned out to be far simpler to hand code my own, an entire PEAR module was replaced by 20 odd lines of code.

      As I said at the start, I generally agree, it's important to be aware of resources like PEAR, CPAN and the like, but (especially when you're learning) you can progress by leaps and bounds by doing some things yourself. Plus sometimes there's a 5 minute solution compared with 20 minutes figuring out how Module-X works and how to integrate the results.

      --
      Please consider this account deleted, I just can't be bothered with the spam anymore.
    2. Re:dont worry so much by phantomfive · · Score: 3, Insightful

      It's a tradeoff. You need to be able to estimate the amount of time required:

      1) to write, debug, and maintain your own code
      vs 2) to understand, debug, and maintain (your integration with) someone else's code

      The way to get good at estimating those things is to try it. Try integrating someone else's code, and try writing from scratch. After a while, you get a feel for how long each one will take.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:dont worry so much by wrook · · Score: 4, Insightful

      i've been coding for 8 years and as long as your code is maintainable, works, commented, and capable, you're doing a good job. also, for the love of god, don't hardcode your file paths or operating system. use a standard library, never do a system call. when you have do, error check it.

      It's hard to comment based solely on what you have written because I've never seen your code. But I have to question the level to which you are aspiring. There is a huge gulf in quality between code that works and code that is minimal and obvious. You say "maintainable, works, commented and capable". Unfortunately, that could describe code that is barely acceptable all the way up to excellent. I don't really know what you mean, so this might be superfluous to you.

      Code that works and is understandable is the minimum quality of code that I think is acceptable. But when you are designing (or refactoring) code, the decisions you make can have a large impact on the rest of the system. Because I read a lot of the original papers on design patterns, I tend to think of code as having a shape (a lot of the earlier descriptions used this kind of metaphor). Code that has an appropriate shape fits nicely with the rest of the code. It has a minimal complexity (i.e., the code is no more complex than the problem it is trying to describe). It also doesn't complicate other code that needs to talk to it.

      On the other hand, code with a shape that is not appropriate does not fit in. It introduces complexity based on its shape alone (independent of the problem it is trying to solve). Code that needs to talk to it often has to do something extra, or carry around some extra data to make it work. This creates an inappropriate shape for this new code. When you have one thing that doesn't fit well, it can have a ripple effect that increases complexity all through the code. Not only that, but there can be a multiplying effect. Each work-around that you introduce to accommodate inappropriate code causes more and more complexity.

      When I look at large software projects, most of the complexity usually comes from dealing with other code rather than solving the problem. The more code you have, the more complex your system becomes. Most software projects actually solve simple problems, but are still very, very complex. You might think that there is nothing you can do about this, but if you look at system libraries they often simplify your life. This seems opposite to the "more code = more complexity" argument. The difference is that these system libraries usually have an appropriate shape for what they are doing.

      Your advice is generally sound. Learning to use appropriate idioms, learning to use appropriate reuse libraries, writing understandable, working code is the basis of programming. But there is another level beyond this. Choosing appropriate code shapes, keeping complexity to a minimum, understanding trade-offs of coupling and cohesion -- This is quite hard and requires a fair amount of practice. Excellent code is not just maintainable and documented, but also minimal and obvious. When other code interfaces with excellent code, it is easy to do so and it introduces a minimum of extra complexity.

      IMHO, you should strive for this. If you think that you already accomplish this without thinking about it, then I invite you to look again. I suspect you may be overlooking something.

  5. It's all in the comments... by History's+Coming+To · · Score: 3, Insightful

    Ask somebody else to make changes to your code. You'll see plenty of arguments over pre-v-post incrementing or whatever, but the big thing is how well laid out and commented your code is...commercially, the chances of you being the only maintainer in perpetuity are practically nil, so it has to be readable to humans as well as computers. I'm well aware it's my major issue as a programmer, and one that I'm constantly working to improve.

    --
    Please consider this account deleted, I just can't be bothered with the spam anymore.
  6. Learn from others by Anonymous Coward · · Score: 4, Insightful

    No matter how experienced a coder you are, you can only learn from others. Your code should meet the standards of others - eg look at equivalent source (open source projects). If your code is less than 1000 lines of code, then it can be considered "trivial" - by all means compare with other small projects. But look at 10,000-100k+ line projects and try to understand them. Now, look at your own code, and does it have the same modularity.

    Is your code "clever"? Then its wrong. (Vast generalisation, apologies).

    Learn the tools to debug and look at memory leaks, bad constructs, coverage etc. Try them - as many as possible, on your code.

    And when you have done all of this, if you believe your code is good, then go back to the start of this subject and start again.

    Additional points: measure your code quality after you have written 100-500 scripts/programs.

    Those doing professional programming are never happy with their own code - they want to enhance and improve it continuously. Often, there is not the time to do this.

  7. Guaranteed way to improve your programs ... by petes_PoV · · Score: 4, Insightful

    So, when you're programming without an experienced manager above you, how do you go about improving?"

    Document them.

    Write man(1) pages, describe the source code, include hints about WHY you chose the algorithms you used (and which techniques didn't work). Have a high-level document to say what a program is intended to do, in what environment, with what limitations and how the output should be used (this works for "batch" right through to web pages and apps). Show how it should be built, what test data you used, what the results were and how the tests were performed.

    If nothing else, yo will learn that writing source code is the easiest 10% of being a professional programmer and that the other 90% is a hard, dull slog. However, it's that other 90% that separates the "play" programmers from the professionals.

    --
    politicians are like babies' nappies: they should both be changed regularly and for the same reasons
  8. Code Review Stack Exchange by Anonymous Coward · · Score: 5, Informative

    You can try posting at least some of the code here:

    http://codereview.stackexchange.com/

  9. Time and features/improvements by sunderland56 · · Score: 4, Insightful

    Several ways: one is time. When you go back and look at a routine you haven't seen for six months, does it still look good? Or are you tempted to rip it apart and rewrite it? Did you put in adequate comments, so that you can remember necessary details after that length of time? Sure, coding styles change, but you shouldn't hate your old code.

    Another is features. When you need to add/change/improve something, how easy is it? Do you need to rip apart old code, or can you just drop in something new with minimal changes? Does it work when the OS is updated?

    Another is *user* feedback. If the project works, doesn't crash, and is easy to use, great. If you get questions about "how do I..." or "why does it..." then think about how your code could change to help the end user.

  10. Code Review Stack Exchange by Anonymous Coward · · Score: 2, Informative

    There is a Stack Exchange site for this -- codereview.stackexchange.com

  11. Stick it in a box by phantomfive · · Score: 4, Insightful

    Stick your code in a box, then forget about it for six months. Then come back, look at it, and figure out what parts make sense, and what parts don't make sense. And what parts you think are entirely horrible. Sometimes this works on a timescale much shorter, I've seen code I've written the day before, and thought, "what idiot wrote this??" Usually it's not that bad, though.

    Three principles to follow, though, and if you get them, your code is gold. Make it:

    - Work (if your code doesn't work, or is too buggy, nothing else matters, the code is useless).
    - Readable (if no one else can read it, then your design principles won't matter because no one will figure them out).
    - Flexible (if your code is flexible, then you can easily deal with changing requirements)

    If you can get the first principle, make your code functional and mostly bug-free, then you're already in the top 50% of professional coders. If it's readable, you're in the top 1%. If it's also flexible on top of that, then you can write a book that people will admire for decades. Or a programming language. Sad but true.

    --
    "First they came for the slanderers and i said nothing."
  12. Why not professors? by buzzsawddog · · Score: 2

    Why can't you ask your professors to look at non classwork? I on more than on occasion went to my professors for non class related things. It really helped out in their classes, often times they were helpful due to the fact that I took interest outside of class in what they did. Open source is one way to have code review as posted by several other people. I find that my wife is not a good resource... She says things like "You did all that just for that, why not just use something thats already out there..." Work with upper and lower clansmen... While its true they may not have much more experience than you they do have different experience. They often times can see things different than you. Look for mentors in the industry or at work. Lots of people like to hear themselves talk so they are more than willing to ramble on to you.

  13. bit of reading by lynnae · · Score: 2

    If you haven't been taught, or feel you haven't been taught, enough about coding conventions (god knows I wasn't), try reading Clean Code by Robert Martin and also Refactoring by Martin Fowler.

    A good knowledge of design patterns is also very useful to cultivate. It makes problems easier to handle and solutions faster to devise.

  14. Coop by Dogbertius · · Score: 2

    Doesn't your university offer coops or internships? A few months of work in industry should help, even if the wage is shit.

  15. Internal code review by gratuitous_arp · · Score: 3, Insightful

    > Since we're students, though, no one really has the experience to offer major advice or critiques

    See how the other students would feel about internal code or design reviews. They may or may not know what it is and they may take it the wrong way or not like the perceived criticism from peers, depends on your relationship with them.

    About none of you having much experience -- maybe not, but part of college is wrestling with challenging questions that you don't know the answer to with people who don't know the answers either. If you're working for the college, even better. It may only lead to marginally better code, but hopefully you would all learn from each other. And it would look good on a resume to say you "improved coding standards and helped foster growth among colleagues by proposing and implementing a peer code review system."

  16. Interact with people you respect by Yoik · · Score: 4, Insightful

    You must know other students who code, trade reviews with friends.

    One problem is that to do a decent job of reviewing code, you need to know what it is supposed to do. Practice writing requirements, program specifications, design documents or whatever fits the development style you are being taught, but you will probably have to explain a lot verbally to your friend unless you are amazing. Then he can give you a meaningful review and your users will have a more valuable product.

    Doing the reviews of a friends code will teach you as much as getting yours reviewed does. You may be surprised at how much work it takes to make good suggestions for improvement. Also, there is a skill to offering criticism in a way that it will be accepted instead of generating anger.

    There are development styles based on this practice, I hope you have good luck with it.

  17. Start reading TheDailyWTF by MrEricSir · · Score: 4, Insightful

    You should start reading TheDailyWTF. If your code ends up there, you are doing something very, VERY wrong.

    And if it doesn't, even better -- you can learn from others' mistakes.

    --
    There's no -1 for "I don't get it."
  18. Find a mentor by SQLGuru · · Score: 2

    Find a mentor.

    Join a local user group for the language/technology of your choice and make friends. Find one that is quite experienced and learn everything you can from them.

  19. Document with care by Anonymous Coward · · Score: 2, Interesting
    There are a couple of problems with documentation:
    1. Too much documentation in the code renders it harder to read.
    2. The documentation will eventually become wrong because people change the code but do not then fix the documentation.
    1. Re:Document with care by Anonymous Coward · · Score: 3, Insightful

      Too much documentation in the code renders it harder to read.

      Only if you're doing it wrong. If you're doing it right, you won't be adding too much. It just won't happen.

      The documentation will eventually become wrong because people change the code but do not then fix the documentation.

      Those people should be fired. Preferably out of a cannon.

      Man pages - yes

      Documentation at the beginning of the file telling how to use it - yes

      Those are okay.

      Documentation within the code - mostly no - learn to write self documenting code.

      This is absolutely wrong and inept. Comments are not for telling what the code does; they tell why it does it. You will never write good code until you purge yourself of the stupid that comes from this fundamental misunderstanding. Once you get this straightened out, you will never produce bad comments again.

  20. Stop caring. by Ryanrule · · Score: 2

    You make more money if you dont care. And you make less stress.

  21. Try this experiment by Tim+Ward · · Score: 3, Interesting

    (1) Print out your code

    (2) White out all the actual code, using Tipp-Ex, leaving just the comments visible

    (3) Give the result to one of your fellow students, and ask him to rewrite your code in a different language.

    If s/he fails, you didn't write enough comments.

    1. Re:Try this experiment by dwmw2 · · Score: 2
      Hm, I'd have said that if s/he succeeds then you're almost certainly guilty of overcommenting your code. A lot of good code is completely self-explanatory. You really don't want to litter it with pointless comments that just detract from the value of the comments that should have been there.

      Nobody needs to see comments like:

      /* Add one to the count */
      count++;

      Yet without that kind of thing, it would be hard to reimplement the code from the comments alone. (Yes, if you have decent JavaDoc-style comments describing each function, and you have small self-contained functions, then perhaps they could reimplement each function from scratch just by knowing its arguments and behaviour — they don't need the contents of each function at all. But that's not quite the same thing.)

    2. Re:Try this experiment by msobkow · · Score: 2

      That depends what your goal is. If your goal is maintainable code, try deleting all the comments and ask people to tell you what the code does.

      If they can't figure it out from the function and variable names, you need to stop using non-descriptive names like "i".

      --
      I do not fail; I succeed at finding out what does not work.
  22. Look for professional meetups by Junior+J.+Junior+III · · Score: 2

    In my area, I'm lucky that we have a large number of self-organizing developer groups. I found a bunch through meetup.com, and since I started going I've gotten much in the way of advice and encouragement, and picked up some insight. If you participate, don't just go and hang out -- put together presentations, and ask the audience for their thoughts. Probably lurk a while before doing that, but once you get the flavor of how they are run, put something together that you feel strong at, and present on it.

    --
    You see? You see? Your stupid minds! Stupid! Stupid!
  23. Re:Don't listen by Samantha+Wright · · Score: 2

    We have a saying in bioinformatics: "sadly, that's typical of academic software." It means that the standards the submitter is coding to depend on what field he or she goes into; since we don't know, we can't really say!

    --
    Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
  24. Clean coding by Anonymous Coward · · Score: 2, Interesting

    The most useful thing that I've recently discovered in my 3 years of professional programming is "Clean Code" by Robert C. Martin. It covers most of the lessons that I've learnt the hard way.

    The things that don't necessarily seem important when you're striving to get something working are usually the things that make a difference. Naming of classes, methods and attributes so that code describes what it's doing, keeping your in-code documentation up to date so it doesn't lie and adhering to SOLID principles (http://en.wikipedia.org/wiki/SOLID)

    I'd thorougly urge you to read it. My colleagues (whom I respect greatly) have also recommended "The Practice of Programming" by Kernighan and Pike, that's probably also worth a look too.

  25. You don't need reviews. by bored · · Score: 2

    You just need to maintain/extend the same piece of code for 10+ years. That means calls at 3AM when it doesn't work. It also means having assorted 3rd parties come in and extend pieces of functionality on a regular basis and then leave.

    That will teach you more about code maintainability and stability than letting a bunch of self righteous, clever idiots, "review" your code.

    Of course, in the meantime... stick to the basics, clarity, consistency, and simplicity. Also, read a lot of other peoples code, you will discover what you like about their code, as well as what you dislike. Then don't write code like the stuff you find hard to understand. One of the big problems with software is that the KISS principle should reign supreme, but everyone thinks they are the next Mozart, and Einstein rolled into one. Rather than building the next Eiffel tower they end up creating the next Rube Goldberg contraption.

  26. Re:Form a critique group ... by wrook · · Score: 2

    Coding dojos do something similar.

  27. Re:Comments mean your code is BAD by TheRaven64 · · Score: 3, Insightful

    For some reason people on slashdot are super anti anyone that says comments are bad

    We are, because it's a stupid opinion to hold. Comments are not bad. Redundant comments are bad. There is a really good, simple, way of judging the quality of a codebase: Picking a random function, how much more code do I need to read before I understand what this function is doing and why it's working that way? Clearly named functions and variables go a long way towards explaining what the code is doing, but not necessarily why. Doc comments mean that you don't need to read any of the other functions that are called, just their documentation.

    Comments are also invaluable when the code is buggy. They tell you what the author of the code was thinking and therefore what they intended to write, which makes fixing the code much easier.

    I've had to maintain code written by people who think comments are bad. In general, I would consider removing their keyboards a good way of improving overall code quality.

    --
    I am TheRaven on Soylent News
  28. I've give my pat advice by NotSoHeavyD3 · · Score: 2

    Mostly because this is something basic you can do for yourself. Can you come back to your old code 6 months later figure out what it does without completely reverse engineering it? I've pointed this out before but I'll say it again. You probably threw away your code 5 seconds after it was graded, right? Well the first thing you'll learn if you go on to be a professional is that you or someone else will be coming back to that code to do fixes and add new features. Ok, it's one of my serious pet peeves is that programmers, codes, software engineers, or whatever you want to call them not writing code to be in any respects readable. So you come back to the code and you can't figure it out without wasting days completely reverse engineering it. (Which is frustrating as hell.) If you can learn to write readable code(so that you can come back some time afterwards and quickly pickup where you left off) you'll be way ahead of the game.(IE you'd be a better developer than most pro's. At least that's been my experience.)

    --
    Did you know 80 to 90% of the moderators on slashdot wouldn't recognize a troll even if one dragged them under a bridge.
  29. Negative is Positive by ios+and+web+coder · · Score: 2

    I can (and will) speak only for myself

    However, I have the basic philosophy that negative feedback is what improves a product. Kudos feel good, but criticism is what I need to make whatever it is I do, better.

    Feels worse, but the results are what I'm after.

    Takes a lot of humility, and the ability to look past invective and puerile garbage, to unearth the truth.

    Put your stuff out there. There's nothing that geeks like to do more than throw feces at each others' work. Some of that stuff will have merit. Be careful about what you dismiss. Also, be grateful for strokes and positive reinforcement, but also measure that against your own developing sense of aesthetics and style.

    You will rapidly learn that there are dozens of ways to do things right. There's a ton of sacred cows and third rails in the IT world (A sacred cow is a concept that is so "holy," that it cannot be attacked, and a third rail is a concept that is so toxic that it should never be touched).

    Most of these "hard and fast" rules come from singular events, or as a result of abuse by folks that don't know how to use the tools properly.

    Take, for example, C++. There are folks that believe the language is The Manifestation Of All That Is Evil, but I make my living running a C++ shop. I get to hear all the ranting and raving about how I'm contributing to the downfall of civilization, yadda, yadda..

    However, it is a very dangerous tool, in the hands of an idiot. Because lots of idiots have blown their legs off with C++, they declare that it is evil.

    In some ways, they have a point. If you don't know what you're doing, you can make a fearsome mess with C++. If you decide to become a C++ programmer, then, PLEASE listen to all the negative feedback, and keep it in mind. Be careful in the use of things like multiple inheritance. The Design phase is critical. Far more so, for C++ than for languages like Objective-C.

    Know your tools, and put your code out there. Do open source work. Make something that other folks would use. This will result in de facto code review.

    --

    "For every complex problem there is an answer that is clear, simple, and wrong."

    -H. L. Mencken