Sponsored by Dragon Age: Origins
See the new YouTube feature trailer for Dragon Age: Origins view!
youtube.com/DragonAge - EA presents BioWare's new dark fantasy epic Dragon Age: Origins. '9/10' from Game Informer.
62 Comments
- Nougat, on 10/12/2007, -3/+78A semicolon is what you have left after suffering from colon cancer. Only women have periods. Both are biological conditions, but they're really quite different. I can't believe you asked such a stupid question.
- mikeroySoft, on 10/19/2009, -2/+30How deep?
- trib4lmaniac, on 10/12/2007, -2/+18So is anyone going to say what the difference between semi-colons and periods is?
- iamhumble, on 10/12/2007, -3/+14Never thought of doing that. Sounds obvious. When you type it out I think you trick your brain to understand it. It is kind of like the saying that you really know about something when you teach it to someone else. Good tip. I have to try this out next week.
- Whoblah, on 10/12/2007, -1/+11@Eliasar
I'm very aware of how semicolons are used at the end of statements in C, but I assumed trib4lmaniac was asking what the differences were between the semicolons and periods in the Erlang example. - ricree, on 10/12/2007, -1/+10@ISVDamocles
Actually, as far as I can see, most of those look to be things that visual studio already does. Perhaps they do it a bit better, but it hardly looks to be $150 better. Maybe they are just really bad at marketting their product, but it seems kind of lame to me. - mtg101, on 10/12/2007, -1/+9Worse are lazy coders who DO put comments in. Then don't update them So the comment that says "takes ownership of memory" actually means "well it used to take ownership of the memory, but I changed it, but couldn't be bothered updating the comment, so when you delete it again... well who knows!!!".
Same for lazy use for Hungarian notation: ohh... so bError is a string now is it??? - Louis11, on 10/12/2007, -6/+14Wouldn't it really depend on the language?
- inactive, on 10/12/2007, -2/+9I would like to get into programming, but not sure where to start? Should i do it in windows, linux, or osx? I'm looking for something easy to start with. I thought about downloading xcode for mac? or would it be easier to write scripts in linux?
- Whoblah, on 10/12/2007, -5/+11It seems to be that when you define functions, you separate different cases by semicolons. And when you want to signal the end of a function definition, you put a period.
- mtg101, on 10/12/2007, -0/+6Do it in whatever interests you. If you've only got a windows box, maybe you want to try VB or C# to make some Windows apps. Maybe you're more interested in apps for web pages, and so Java or that Flash thing is for you. If you just want to automate your Linux backups, try scripting. Want to just make simple games? Maybe GBA programming is for you.
If you just try to learn generic programming, you might end up getting very bored learning how to calculate factorials using recursion. - my8086, on 10/12/2007, -0/+6if you want to dabble, start with the area you're interested in as already mentioned. if you really want to code, start with ANSI C.
- chrisntr, on 10/12/2007, -0/+6I always like writing out code by hand. Any one can just copy and paste code and get it to work but it seems to register in the brain when I type it out.
- ozroy, on 10/12/2007, -0/+6I would definitely NOT recommend starting with PHP or any other scripting language. If you are serious about learning to program I would suggest starting with something strict. There is a reason why a lot of courses start with crappy languages like Pascal. They force you to structure your programs in a very strict way, hopefully teaching you some good habits that will make your future programs better structured and easier to read. C may even be a bit too loose in the way it works leading to 'spaghetti code'
There is nothing worse than being handed the work of someone else that is has crap defined all over the place.
Once you know how to program you can take that knowledge to almost any programming language. - baalzebub, on 10/12/2007, -1/+6syntax highlighting helps too :)
- StarManta, on 10/12/2007, -0/+5Like mtg said, if you're learning on your own, do something that interests you. Want to make a web page, learn Javascript and PHP. Want to make games? Download a tool like Unity and give its scripting interface a whirl. (The last one is my personal choice.)
As for XCode, even after you decide to use XCode, you then have to decide what language, etc. to use; if you don't already have a strong CS background XCode is probably not going to do you a lot of good.
Final suggestion? Take classes. - molotovbliss, on 10/12/2007, -0/+5Just use an abundance of plain English comments in your code, makes your life as well as others easier. Especially when it comes time to pick it back up again. Although this sounds like a good idea for those lazy coders who don't use comments and you have to decipher it.
- safiire, on 10/12/2007, -0/+5I always do this trick, except I do it under the guise of neatening the other person's code.
- paulmdx, on 10/12/2007, -0/+5If you want to go down the Microsoft route, I would learn C#. All .NET languages are basically the same, and C# is certainly the most popular, which means it's marketable in terms of getting a job.
I can't help with Mac OSX or Linux specifically, but C++ will give you a very strong technical understanding that you can use to learn other languages easily. C++ has a steeper learning curve in terms of producing an interesting program.
If you want to learn to be a strong developer I would recommend against learning to program in an unstructured language like: php, VB6, ASP. That's not to say you can't write structured programs in those languages, but because they don't enforce structure I find it teaches bad habits.
Edit: Having given my dull job-whore blurb, I agree with mtg101 and StarManta - make sure you do something that interests you. - molotovbliss, on 10/12/2007, -0/+4Not updating comments almost defeats the purpose of even having them, still the same, lazy coders! :)
- sudonim, on 10/12/2007, -1/+4I prefer to use comments in Lojban, English just doesn't do it for me.
- Olle, on 10/12/2007, -1/+4When you start out it is good if you can get as much help as possible and instant gratification.
I would suggest that you download Visual C# Express and start with that. It will help you with syntax, has great compiler errors and quick turn-around time.
I considered recommending Visual Basic over C# because it is supposedly easier to get started with. But in the end I think I must recommend C# because then you learn a more common language structure (understand C# and you can read Java and a little C++).
I don't know about programming for the Mac, so if you want to do that then I have no direct advice other than to stay away from the command line.
Some people will tell you that you need to start with Assembly/vi/Emacs/C/make/perl to _truly_ understand programming. But I strongly disagree with that. When I argue with people about that it usually boils down to the fact that they have fond memories of that since that is how they got started, but that is a bad argument. - bergur1, on 10/12/2007, -0/+3Isn't it the same concept with almost everything? To go through everything?
- mtg101, on 10/12/2007, -0/+2Yep - re-tytpe it. Make the layout how you like it, and expand any "clever" tricks (like if(con=++addr=arr[inn+7])) so you can actually see what's going on.
And if it's worth commenting, but not logging, it might be worth looking again at the names of things, or how much stuff your method is trying to do. - swordphish, on 10/12/2007, -0/+2A nice comment here and there to explain what is going on is ESSENTIAL to public source code.
If there isn't at least 1 comment for each function, then free(crappy_programmer);
Also, instead of 'imagining yourself typing code'...why not just actually type it?
The same way you learn better by taking notes...you'll learn better by typing code instead of just reading it.
This is why I don't just copy & paste code off the web. - synae, on 10/12/2007, -1/+3omfg erlang is such a crazy language. Coming from a C/Java/Python background and never touching Prolog in my life, Erlang was a ***** trying to learn it. It has really cool built-in language features (concurrency, clustering capabilities, pattern-maching, guard statements, etc.) but trying to learn it was a bit too much for me.
As far as semicolons vs. periods vs. commas, my understanding is that a period = end of the block. semicolon = end of this portion block (statement), followed by another statement. commas separate parts of statements.
this is by no means definitive... - danggit, on 10/12/2007, -0/+2This is basically how I teach myself; only instead of imagining that I'm typing it out, I actually do that. I will look at a block of code, understand what it does; then rather than copypaste it into my editor, I'll attempt to type it out from memory.
If the code doesn't work as expected, I will return and look at the source to see what I did wrong. I've actually found errors from other peoples' code this way, and corrected them myself. I'm not a pro, but this trick has definitely helped me learn as I go along. - molotovbliss, on 10/12/2007, -0/+2" Also notice that you have to tell it you are done entering code by finishing with a full stop "." "
...
"says that the factorial of 1 is 1. Note that we end this part with a ";" which indicates that there is more of this function to come."
...
"says that the factorial of N is N multiplied by the factorial of N - 1. Note that this part ends with a "." saying that there are no more parts of this function. "
I don't know ERLang but poking around the docs here's what I've found. Hope it helps.
http://www.erlang.org/doc/doc-5.5.2/doc/getting_started/seq_prog.html#2.2 - yahoofrom, on 10/12/2007, -0/+2useless comment.
- ear1grey, on 10/12/2007, -0/+1Back in olden times before the WWW, and before removable media was cheap, computer magazines could not merely include software on their cover-disc so they'd give over large sections of their publication to program listings. Page after page just regurgitating lines of code.
We'd spend hours, sometimes days, typing them in. It was an interesting way to learn because we'd invariably end up with an "error x at line y", so checking line y would reveal a difference to the magazine and thus you'd quickly learn what caused problems like "error x", and how to fix them. - BigBrother87, on 10/12/2007, -0/+1I'll bet a story worth digging doesn't fit entirely in the description.
- Alystair, on 10/12/2007, -0/+1I think there should be a standardized amount that Digger's bury people who ACCIDENTLY put their text someplace, maybe -6 feet deep? :)
- NiLeS, on 10/12/2007, -1/+2the Insert key?
- WomunOfColour, on 10/12/2007, -1/+2Using that trick, it seems like the semicolon is used as an 'elseif'. The semicolons seem to separate each if statement, or each type of case.
- Splizxer, on 10/12/2007, -0/+1I do that quite a bit sometimes too, I think it's something to do with hand eye coordination, I know that sometimes when I'm typing without looking, I can tell if I miss typed it half way through the word even if I don't see what I'm typing.
- Jonty, on 10/12/2007, -0/+1It may just be that you're slowing yourself down enough to fully understand what's going on rather than just skimming.
- kmgrant, on 10/12/2007, -1/+1He's right, when I read code I imagine re-typing it by hand.
Of course the reason I imagine this is that most code I've encountered is written horribly. Even if the code were incredibly good, all software projects need to examine and rethink the implementation regularly: this ensures code remains well understood (and maintainable), modern, and improving.
Periodic code review also makes it harder for useless software engineers to storm through unnoticed: the kind of people who can be given a task, write terrible code that seems to work, collect many pay cheques and eventually quit before anyone has realized the disaster that was created. - dvsbastard, on 10/12/2007, -1/+1It might be a nice method when learning a new language as this will help you identify the less obvious code structure (i.e. semicolon vs period) but this technique seems mostly useless when "trying to understand" what brand of drug a previous developer was on when they wrote a particular piece of code if you are already a proficient coder.
- alex4u2nv, on 10/12/2007, -0/+0But don't do it too often (especially if it's poor code quality), because you might subconsciously taint your coding standards.
Personally, I take the stance of critiquing the code and at the same time understanding it. Takes a bit longer, but I pick up some good tips and denounce the poor codes if there are any. - BabyBrumak, on 10/12/2007, -0/+0It's an interesting method for learning the little details of the language. But once you understand programming extremely well, learning a new language isn't that difficult because you'll already be familiar with most of the logic. Then your brain will automatically look for the nuances.
For beginning/inexperienced programmers though, this is an excellent technique. - 7heGam3, on 10/12/2007, -2/+1Hasn't worked with me...
- thestaunch, on 10/12/2007, -1/+0With the mental route you're liable to cheat, forcing yourself to _actually_ type out everything you want to understand well is a rule I've used for years.
Except third party code I'm using through an API, absolutely zero code in my projects is copy/pasted. I always go through the minor pain of re-typing everything so I'm 100% sure of what went in. - paulmdx, on 10/12/2007, -4/+3So you're the one that's been screwing around with my braces!
- WomunOfColour, on 10/12/2007, -2/+1Python.
- Don_Gero, on 10/12/2007, -3/+1No kidding. I guess you can trick stupid people into actually reading the code by having them retype it.
- hackwrench, on 10/12/2007, -3/+1It would be nice if there was a program that accepted a file and displayed it, and allowed you to type as if you were just typing in the file and marked errors, that you could backspace to correct. Does anyone know of such a program?
- JorgeGT, on 10/12/2007, -3/+1my computer science teacher knows well this... he gives the code examples *printed* in a sheet of paper - "now, type it now to see if they work"
- Snipex, on 10/12/2007, -4/+2http://duggmirror.com/programming/A_Mental_Trick_for_Programmers_Coders/
- nicolaa, on 10/12/2007, -4/+2This article is jank. If you actually thought to yourself, "Wow, this is kind of neat." - then you don't deserve to call yourself a programmer.
- boaman, on 10/12/2007, -8/+5useless tip
-
Show 51 - 62 of 62 discussions



What is Digg?