#1 Posted by Cyrus_Saren (530 posts) -

I am currently taking an IT class called "Fundamentals of Programming with Algorithms and Logic". What it basically boils down to is teaching me pseudocode. While I seem to understand it when I read the material and seem to have a basic grasp from reading it, I am having trouble actually writing it down. I can't seem to grasp some of the terms that are being used (integer, float, etc). Is there anyone here that knows about pseudocode that can help me out?

#2 Edited by Kidavenger (3514 posts) -

Pseudocode is just planning out your program/logic before you actually spend time composing the actual program. It's a pretty wide subject, I think google would be your best resource for general knowledge.

#3 Edited by oraknabo (1453 posts) -

I don't know a specific kind of pseudocode, but the keywords you're talking about are ways of telling the compiler what kind of data you are using. Integer or int is a straightforward positive or negative number with no decimal. A float is a decimal number.

These concepts are much easier to understand if you study computer architecture and understand binary code, memory allocation and the kind of assembly instructions you're abstracting in your code. Pseudocode seems like the worst place you can start if you want to really know what's going on.

#4 Edited by EquitasInvictus (2009 posts) -

It always eluded me why pseudocode is taught as opposed to actual code. If anything, I feel like dynamically typed programming languages convey the same points and can actually be used for practical applications. Those kinds of courses might as well teach Ruby and Python as an introduction and accomplish a lot more if they don't want to go too low-level.

Then again, it was much easier to fudge examinations that ask for pseudocode...

Online
#5 Edited by oraknabo (1453 posts) -

@equitasinvictus: I'm surprised anyone is still teaching it with all the scripting languages around. A lot of introductory courses seem to be using JavaScript. Python or Lua are also good choices. At least with these you get to see some kind of result from the code you write. I started with Logo.

Really, if all you're trying to do is teach IT students how algorithms, loops and conditionals work without talking about compilers, you could use something like Scratch and have some fun with it.

#6 Edited by Ben_H (3319 posts) -

Pseudocode is essentially like a programming language but without strict syntax and language-specific stuff, and it is used mainly for planning and getting ideas down. For example, if you are planning something that you will later implement in C++, you write it out but without all the semicolons and other C-specific syntax and more general function ideas rather than specific functions. Some of the more modern programming languages are starting to become more pseudocode-like. For example, Python. No semicolons, don't have to list a type for each variable, etc.

And yes, Google is your friend for this. It is quite hard to describe.

The other issue is that it is not really consistent. Some people treat pseudocode differently than others or write it differently. So what we tell you could be wrong compared to what your class is looking for.

As for what integer, boolean, and whatnot mean, here is the wikipedia page on it, http://en.wikipedia.org/wiki/Data_type, but I will outline some of the basics

int (integer) - a whole number - 1, 2, 100, 957483, -10

float (full name is floating point) - is a decimal number - 1.2, 3.14159, 10.0

char (character) - a character like you would see on a keyboard - A, a, #, s

string - basically a group of characters (it is more complex than that), or in simple terms, a sentence that contains characters - "Hi there"

boolean - true or false - when used true is output as 1, false is output as 0

Those are the basics of data types. They are essentially universal across languages. When declaring a variable, in some languages (and usually always in pseudocode, just to keep things clear), you have to put a data type first

For example, say you have a variable 'x' and you want it to be an integer value (so a whole number). In pseudocode and in languages like C you would declare it "int x".

@oraknabo said:

@equitasinvictus: I'm surprised anyone is still teaching it with all the scripting languages around. A lot of introductory courses seem to be using JavaScript. Python or Lua are also good choices. At least with these you get to see some kind of result from the code you write. I started with Logo. Really, if all you're trying to do is teach IT students how algorithms, loops and conditionals work without talking about compilers, you could use something like Scratch and have some fun with it.

It all depends the course. I discussed this topic with my professor in great detail (He's taught for 25 years. He hates C with a passion). The reason some universities teach C or C++ and pseudocode as opposed to Python, Javascript, Perl, etc. when starting out is because those more modern languages do all the work for you, and it doesn't help with deeper understanding. Sure it takes less work, but you don't really get to know WHY they are working how they do, just that they work. He said the goal of using C and pseudocode was to take all the "magic" out of programming so we have stronger fundamentals (for example, we aren't allowed to use the string type until second year because they want us to understand how strings work, so instead we have to use character arrays). However, for technical schools where you have a more focused task a lot of the time, this level of understanding isn't necessarily needed, and that is why more modern languages are taught (plus time is usually more limited since most technical school courses are 2 years rather than 4 for university). My school actually forces students to use the Terminal in Linux (or Mac, which is what I use) for compiling as well so they understand that it isn't just "click the button and go" like it would be if they used an IDE. It makes things much more difficult early on, but down the line things go much smoother.

#7 Edited by Cyrus_Saren (530 posts) -

Pseudocode is just planning out your program/logic before you actually spend time composing the actual program. It's a pretty wide subject, I think google would be your best resource for general knowledge.

I have used Google pretty extensively but it is still kind of lost on me.

@oraknabo said:

I don't know a specific kind of pseudocode, but the keywords you're talking about are ways of telling the compiler what kind of data you are using. Integer or int is a straightforward positive or negative number with no decimal. A float is a decimal number, usually with only 2 decimal places allowed.

These concepts are much easier to understand if you study computer architecture and understand binary code, memory allocation and the kind of assembly instructions you're abstracting in your code. Pseudocode seems like the worst place you can start if you want to really know what's going on.

I thought that's what integer and float was but I wasn't certain. I have no knowledge of programming and even with a fake form, it's all just over my head. If I didn't have to take this class, I wouldn't have.

#8 Posted by 49th (2697 posts) -

You should have a good understanding of the different types of variables or constants (int, double, string, ect.), learn about the basic kind of loops and statements (if, else, for, ect.) also how booleans work, then combine all of these concepts and see how they work together.

Pseudocode does not need to be completely accurate, that's the whole point - as long as it sort of describes what the program is supposed to do and makes sense you should be ok.

#9 Edited by oraknabo (1453 posts) -

@cyrus_saren: If the way the class is being taught isn't working for you but you are still interested in doing well, try approaching the material from a different direction. I'd suggest using Scratch or Snap to try out your assignments in a fun way and then write pseudocode based on what works there.

If you want to come at it from a deeper understanding (which it seems like you don't), spend some time with The Definitive Guide to How Computers Do Math : Featuring the Virtual DIY Calculator or The Elements of Computing Systems: Building a Modern Computer from First Principles.

These are all fun ways to grasp the concepts of computing from the lowest levels of binary code to the highest levels of abstraction.

#10 Edited by Chaser324 (6345 posts) -

@cyrus_saren said:

I thought that's what integer and float was but I wasn't certain. I have no knowledge of programming and even with a fake form, it's all just over my head. If I didn't have to take this class, I wouldn't have.

That's a pretty odd class for someone with no programming knowledge to be required to take. What would you stand to gain from it? If you have no programming knowledge at all, some sort of simple introduction to C, Python, Ruby, etc. would probably be more valuable and accessible. If that's the way your curriculum is setup, you're going to have to suck it up and take it, but I'd definitely recommend submitting some sort of complaint/inquiry to whoever is in charge of your program about changing it for future students.

Moderator
#11 Edited by lanerobertlane (137 posts) -

Pseudocode isn't real code, its fake code to help you write the real code later. Imagine it as writing out in normal English what you want each line of code to do. here's an example of how psudocode works:

print hello world

go back to the start and repeat

in BASIC that would translate to the following code:

10 Print "Hello World"

20 goto 10

in C++ it would translate to:

Top: Cout << "Hello World" << endl; goto top;

 

#13 Edited by Cyrus_Saren (530 posts) -

Thanks everyone.

@cyrus_saren said:

I thought that's what integer and float was but I wasn't certain. I have no knowledge of programming and even with a fake form, it's all just over my head. If I didn't have to take this class, I wouldn't have.

That's a pretty odd class for someone with no programming knowledge to be required to take. What would you stand to gain from it? If you have no programming knowledge at all, some sort of simple introduction to C, Python, Ruby, etc. would probably be more valuable and accessible. If that's the way your curriculum is setup, you're going to have to suck it up and take it, but I'd definitely recommend submitting some sort of complaint/inquiry to whoever is in charge of your program about changing it for future students.

I already have. Their whole idea behind it was that, if you're in IT, you should have some basic knowledge of programming. Or at least some way to explain to programmers how you want something done.

#14 Edited by Chaser324 (6345 posts) -

@cyrus_saren said:

Their whole idea behind it was that, if you're in IT, you should have some basic knowledge of programming. Or at least some way to explain to programmers how you want something done.

As a programmer, I totally agree with that sentiment, but I'm not 100% sure if the way they're going about it is the best.

Moderator
#15 Edited by TyCobb (1948 posts) -

@chaser324 said:

@cyrus_saren said:

Their whole idea behind it was that, if you're in IT, you should have some basic knowledge of programming. Or at least some way to explain to programmers how you want something done.

As a programmer, I totally agree with that sentiment, but I'm not 100% sure if the way they're going about it is the best.

Agreed. I don't think one learning pseudo code is very beneficial. 1) it won't stick after the class is over. 2) The knowledge gained will be too simplified and probably sound like a jackass to a programmer that already knows the program.

Pseudo Coder: Management is saying we need historical reporting on Y and Z. I told them okay because it should be as simple as loop through Xs and print Y and Z.

Real Coder: We don't store that information....

#16 Edited by Brenderous (1098 posts) -

I had a co-worker that pronounced pseudo "puh-soo-ay-doh" and I wanted to slap his face every time.

#17 Edited by TyCobb (1948 posts) -

I had a co-worker that pronounced pseudo "puh-soo-ay-doh" and I wanted to slap his face every time.

That's a Dragon Shout right?

#18 Edited by Chaser324 (6345 posts) -

@brenderous said:

I had a co-worker that pronounced pseudo "puh-soo-ay-doh" and I wanted to slap his face every time.

You should have given him an M Bison style "puh-sy-coh" crusher.

Moderator
#19 Posted by SSully (4130 posts) -

It always eluded me why pseudocode is taught as opposed to actual code. If anything, I feel like dynamically typed programming languages convey the same points and can actually be used for practical applications. Those kinds of courses might as well teach Ruby and Python as an introduction and accomplish a lot more if they don't want to go too low-level.

Then again, it was much easier to fudge examinations that ask for pseudocode...

I would have to agree completely. My programming 101 class gave a high level view of programming languages by having us mess with HTML and psuedocode. Then we jumped into Java, where we had to do pseudocode along with our assignments for the first 2 weeks or so. I honestly found pseudocode more confusing then the actual code. It just makes more sense when you are actually working with the code and seeing when and how something breaks, it makes the learning process much easier.

#20 Edited by Ravenlight (8040 posts) -

10 PRINT "BUTTS"

20 GOTO 10

#21 Edited by Cyrus_Saren (530 posts) -

I kept reading that there was no point to learning pseudocode. I guess it is not something I should really put too much effort in trying to retain after the class is done?

I veered away from programming because I knew it was something that I would not be able to grasp. This class just kind of proved that.

#22 Edited by Ben_H (3319 posts) -

@ssully said:

@equitasinvictus said:

It always eluded me why pseudocode is taught as opposed to actual code. If anything, I feel like dynamically typed programming languages convey the same points and can actually be used for practical applications. Those kinds of courses might as well teach Ruby and Python as an introduction and accomplish a lot more if they don't want to go too low-level.

Then again, it was much easier to fudge examinations that ask for pseudocode...

I would have to agree completely. My programming 101 class gave a high level view of programming languages by having us mess with HTML and psuedocode. Then we jumped into Java, where we had to do pseudocode along with our assignments for the first 2 weeks or so. I honestly found pseudocode more confusing then the actual code. It just makes more sense when you are actually working with the code and seeing when and how something breaks, it makes the learning process much easier.

This is what happened with probably 90% of my class when we were forced to use pseudocode. I talked earlier in the thread about pseudocode somewhat allowing you to have a higher understanding but I think it should be taught later on after you have a really concrete grasp of programming and you can better visualize what is happening.

For my assignments that had to be in pseudocode, at first all I did was write everything in C++ then remove all the C-related jargon (literally copy/paste then get rid of syntax) and I aced all the assignments. Now I can write just in pseudocode but I do think it is a bit of a superfluous step, especially in basic IT classes where the basics are all you need to know.

They are actually getting rid of the pseudocode components of some of the classes I took this year next year at my school. The first term class I had this year had already done that (everything was in C++. I liked that waaaaay more), but the second term hadn't, so we spent the entire term looking at pseudocode and translating it into C++ since they wouldn't give straight up C++ code anymore.

Edit:

I kept reading that there was no point to learning pseudocode. I guess it is not something I should really put too much effort in trying to retain after the class is done?

I veered away from programming because I knew it was something that I would not be able to grasp. This class just kind of proved that.

A lot of people bad mouth it because it has a tendency to needlessly complicate things compared to just building a program in an actual language. Programming is able to be learned by anyone, you just need the right teacher. Unfortunately some teachers like to make it look like they are hotshots and complicate things by making it seem harder than it actually is. It sounds like your class is kind of like that. I had the luck of having the opposite when I first started. My professor did everything in the most basic terms possible so everyone could understand.

What I would suggest you maybe do is check out a few tutorials on Youtube. There are people on there that are better teachers than most technical school teachers or university profs. This guy I am about to link you in particular is quite good. He teaches the basics in a very simple to understand way that helped me make sense of things. I would recommend checking out either his beginner C++, beginner Python or really any of the beginner stuff, just for the basic ideas. Ignore the language specific stuff and just focus on the concepts (like data types. How the various loops work, and whatnot).

http://www.youtube.com/user/thenewboston/videos?flow=grid&view=1

There are other people who have really good tutorials as well.

#23 Edited by oraknabo (1453 posts) -

@cyrus_saren: I can understand having to read a little pseudocode here or there to get the idea of an algorithm, but I don't see any need to have to memorize it or be tested on your ability to write it. I read books that used it back when I started learning to code a couple of decades ago, but these days, most books I read about coding give concrete examples in C++, Java or C#.

Don't let a badly designed course scare you away from programming. You might actually find out that you like it. I know you probably already feel like the stuff you're being given in the class is more than you want to bother with, but if you do ever end up wanting to really understand this stuff, the book Code by Charles Petzold is a very readable general-interest look at the basic concepts they're probably trying to teach you in the class.