Pseudocode

  • 28,135
    Posts
    15
    Years
    So is anybody here familiar with pseudocode? It's sorta like coding, but instead uses common English to get a task done, for those not familiar with it. So for those familiar with pseudocode, what are your thoughts on it? Do you guys use it at all for coding purposes, such as algorithms, or did you ever use it in a programming class you may have taken?
     
    Had to learn it as part of our Java classes in the first year. I found it a hassle to think about what to put down for the logic of a program because due to the way we were taught ( code first then pseudo) I've gotten used to having the IDE tell me any available classes that could do what I needed. However if I was taught to do pseudo at a earlier stage in my course I might be able to get used to planning the logic before getting stuck in coding.
     
    I've heard Python described as executable pseudocode, so does that count?

    Jokes aside, I think it's okay for algorithms, but generally people write psuedocode heavily inspired by their primary languages. Programmers of C-like languages write pseudocode completely differently to those primarily influence by Basic-like languages. That annoys me because often the intent isn't clear and it defeats the point. I myself hardly ever use it unless I'm explaining something to someone else who may not be familiar with the languages I know. That is pretty much the only use case for it. If you're planning a program using pseudocode you have a problem and you should take a serious look at your design process.
     
    It's a nice way to plan what you're supposed to code, but it isn't always needed. Additionally it gets confusing when you're working with other people--some people tend to use something similar to a programming language's syntax (such as C) as pseudocode, whilst some prefer using the English language.

    If you're planning a program using pseudocode you have a problem and you should take a serious look at your design process.
    This shouldn't be necessary to say. Just because you can plan your programs with a flick of a finger, without any prior plans (such as writing pseudocodes and making flowcharts), doesn't mean everyone else can. Additionally when you're out there in the field, you'd be surprised by how useful having sufficient knowledge of pseudocodes is, especially when working with a relatively large group.
     
    This shouldn't be necessary to say. Just because you can plan your programs with a flick of a finger, without any prior plans (such as writing pseudocodes and making flowcharts), doesn't mean everyone else can. Additionally when you're out there in the field, you'd be surprised by how useful having sufficient knowledge of pseudocodes is, especially when working with a relatively large group.

    I didn't say I don't plan programs. I said using psuedocode to do so is generally bad. Flowcharts may be necessary for higher levels of development, but your tests should dictate your design and code. Putting pseudocode in the design process subverts that because it locks you into writing matching code.

    Don't get me wrong, it can be a helpful learning tool, I just don't think it's particularly helpful for design.
     
    There's no such thing as a universal solution for design. Test-driven development may very well be key in a lot of situations, but it's also a massive detour for many others. Tests don't visualise flow and delegation of information which is key for larger projects.

    Neither does pseudocode, which was my point.
     
    I only really use pseudocode in either projects where I haven't decided what language I want to use yet, or on much larger projects that require multiple components to be written in different languages. It's just so much easier to conceptualize and explain to someone else than straight up code.
     
    I disagree... at least far more than TDD. Pseudocode does not have to be about fine-grained operations. If your structure is modular and also compartmentalised, it can be easily represented with a few lines of pseudocode, and like you said, this has the ability to match imperative design. Test clusters, not so much—at least not at first glance like you could with a block of statements.

    The pseudocode on the level you're talking about sounds more like skeleton code or a class hierarchy, rather than a natural language description of an algorithm or something. When I am talking about it, I visualise more of the latter than the former. The former can provide direction and clarity, but I feel there is little to be gained from the latter. But maybe I'm wrong in having too strict a definition.
     
    Back
    Top