Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fluidedge

macrumors 65816
Nov 1, 2007
1,365
16
furry muff

I was just thinking of a simple language to start with.

I remember being overwhelmed by C when i started learning it. Pointers, arrays etc. I hated it some much i've never used it since my exam in it.
 

Aranince

macrumors 65816
Apr 18, 2007
1,104
0
California
Python is actually a language and its very easy to learn and get a program running in the matter of seconds.

As for HTML: Its not a language, its a document format just like XML. It doesn't have variables, methods, functions, flow control, etc.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
I'd steer clear of HTML. It does not teach you anything about programming really, it is mearly a document formatting tool (and arguably LaTeX would be better to learn if that was your goal).

The only document formatting language I consider to be a programming language is PostScript. But I'm not sure learning that teaches much about general purpose programming!
 

mobilehaathi

macrumors G3
Aug 19, 2008
9,368
6,353
The Anthropocene
furry muff

I was just thinking of a simple language to start with.

I remember being overwhelmed by C when i started learning it. Pointers, arrays etc. I hated it some much i've never used it since my exam in it.

I think their point is that since its not turing complete, it is not a programming language. You also don't learn basic concepts of flow and control with HTML, or basically anything that is actual programming...

Sorry you didn't like C too much! :(
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
The only document formatting language I consider to be a programming language is PostScript. But I'm not sure learning that teaches much about general purpose programming!

I didn't say it did :). I said "it doesn't teach you anything about programming really" and then went on to state that if your goal was to learn a document formatting tool then LaTeX would be a better bet than HTML.

Maybe I should have left the really off to sound more decisive on that statement.
 

fluidedge

macrumors 65816
Nov 1, 2007
1,365
16
Expressions like "Turing Complete" are what drove me away from programming software and into using software.

I once had a double lecture on the Godel Completeness theorem and the lecturer proved a bit of it. I knew then i was never destined to become a computer scientist/programmer. :(

I now do special effects :)
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
furry muff

I was just thinking of a simple language to start with.

I remember being overwhelmed by C when i started learning it. Pointers, arrays etc. I hated it some much i've never used it since my exam in it.

My response seemed to get lost at the end of the first page, but I was at least trying to be civil about it. =) I think HTML is nice because you can very quickly make changes and see the results, which can be rewarding, but i've never taken what I've learned from HTML and applied it to programming elsewhere. It's certainly not a waste, especially in this day-in-age in which so much is being pushed to browser-based applications. HTML has become the front-end for a lot of very complex applications.

-Lee

P.S. I guess i started in with "turing completeness"... I guess we computer science folk can be a bit uppity and droll at times. I am a language nerd, and when I think "general purpose" I just say "Turing complete".

P.P.S. Since you brought up Gödel, it reminded me of this: http://xkcd.com/468/
 

fluidedge

macrumors 65816
Nov 1, 2007
1,365
16
My response seemed to get lost at the end of the first page, but I was at least trying to be civil about it. =) I think HTML is nice because you can very quickly make changes and see the results, which can be rewarding, but i've never taken what I've learned from HTML and applied it to programming elsewhere. It's certainly not a waste, especially in this day-in-age in which so much is being pushed to browser-based applications. HTML has become the front-end for a lot of very complex applications.

-Lee

P.S. I guess i started in with "turing completeness"... I guess we computer science folk can be a bit uppity and droll at times. I am a language nerd, and when I think "general purpose" I just say "Turing complete".

I know you were :)

I think you know what i meant - learning and using HTML you can quickly enter gobbledy gook and quickly get back something nice and pleasing. The number of times i've sat tearing my hair out at compiler errors :( - Another reason i don't go anywhere near terminal/textEdit/Xcode these days.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
I didn't say it did :). I said "it doesn't teach you anything about programming really" and then went on to state that if your goal was to learn a document formatting tool then LaTeX would be a better bet than HTML.

Maybe I should have left the really off to sound more decisive on that statement.

I wasn't trying to disagree with you, rather expand on the point. I qualified my statement as I didn't want anyone rushing off to learn PS and then coming back saying it didn't help!

I 100% agree that HTML teaches nothing about programming.
 

Bad Paper

macrumors 6502
Apr 20, 2007
296
0
graphite clamshell
Keytachi, I don't see why you need to learn any languages right now. Go run around outside in the sunshine. This is the last chance for you to do that sort of thing for years.
 

fluidedge

macrumors 65816
Nov 1, 2007
1,365
16
Keytachi, I don't see why you need to learn any languages right now. Go run around outside in the sunshine. This is the last chance for you to do that sort of thing for years.

Sun is bad for future programmers - you must build up an immunity to sunlight so you can work for weeks in your curtain drawn hovel
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Sun is bad for future programmers - you must build up an immunity to sunlight so you can work for weeks in your curtain drawn hovel

=) One of the 4 windows in my office has the shades 1/4 open! We get some sun!

Keytachi, I don't see why you need to learn any languages right now. Go run around outside in the sunshine. This is the last chance for you to do that sort of thing for years.

I don't know where you went to college/university, but I was outdoors constantly. And sometimes even running out there! In the 10 minutes I had between 2 classes I had to make it half a mile (.8km for our metric-using friends) after going down 3 stories of stairs, then make it up another 5 stories of stairs.

-Lee
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
I like my hovel :).

Since we're so far OT by now anyway, you got started in these forums the same way the OP is. When does your first term at university start? With our help do you feel you've gotten yourself far enough ahead to embarrass your peers?

-Lee
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Since we're so far OT by now anyway, you got started in these forums the same way the OP is. When does your first term at university start? With our help do you feel you've gotten yourself far enough ahead to embarrass your peers?

-Lee

Yep, very true.

I think I've come far enough along to do some damage. Although now I just know exactly what is I don't know, rather than what it is I do know :). I feel like I know less now than I did when I started :D.

Still I can work out how to put a program together, I can follow the flow of programs and have spent some time following open source software mailing lists (OpenBSD at the moment) and while there are things I don't understand, at least I know where to look for information which is the number one lesson I have learnt. Learning to find and use information is essential.

I still manage to make a tit out of myself with spectacularly simple mistakes though :p.

As for the course I had to delay for a year for financial reasons :(.
 

mobilehaathi

macrumors G3
Aug 19, 2008
9,368
6,353
The Anthropocene
I still manage to make a tit out of myself with spectacularly simple mistakes though :p.

Hey I once spent 4 hours trying to debug code when it turned out I forgot to put semi-colons after two of my class declarations.....

Not that g++ gave me very useful error messages...telling me there was a syntax error in iostream!:eek:
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Or the infamous = instead of == :). That's always a fun one.

That one is a killer. Since = evaluates to the right-hand operand, and C treats any non-zero as true in conditionals, it can be pretty hard to track. One nice thing about Java (ha! back on topic!) and other languages that have a real boolean type (and force its use) is that you'll get a compiler error if you make that sort of mistake. That's to say, == evaluates to a boolean, and = evaluates to the type of the right-hand operand. I guess you could still make the mistake if you were testing a boolean value, but normally you'd just say:
Code:
boolean enterIf=true;
if(enterIf) {
  System.out.println("Entered 'then' section");
} else {
  System.out.println("Entered 'else' section");
}

rather than
Code:
if(enterIf == true)
which might be mistaken for
Code:
if(enterIf = true)

which would always evaluate to true, which would be unfortunate. I hadn't actually thought about this until today, so it's something to watch for. The point is that it's very easy to mess this up in C because anything you can use the assignment statement with can be evaluated in an if, even if some implicit casts are required.

-Lee
 

Cromulent

macrumors 604
Oct 2, 2006
6,816
1,101
The Land of Hope and Glory
Do you guys use the method like this:

Code:
if(NULL == someVar)

or this:

Code:
if(someVar == NULL)

?

The first gives a decent compiler error but it is not as easy to read if you ask me. Maybe it is just getting into the habit of using it. I guess I should try.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Do you guys use the method like this:

Code:
if(NULL == someVar)

or this:

Code:
if(someVar == NULL)

?

The first gives a decent compiler error but it is not as easy to read if you ask me. Maybe it is just getting into the habit of using it. I guess I should try.

I'd like to say that if I have a modifiable lvalue and a constant that I try to keep the lvalue on the right hand side of the == just in case, but in practice i probably vary. I'm mostly using Fortran and Java these days, and Fortran requires a scalar logical for conditions and Java requires a boolean, so it's not as serious of a problem for me anymore.

I think that most programming texts and teachers try to make examples "readable" and it seems more natural to say: "if X is equal to 10 then add 7 to Y" than "if 10 is equal to X then add 7 to Y". I think it's just the way we parse language... if 10 is equal just doesn't make sense. It's always equal to 10! Why would you even ask? I think we just like having a variable first.

-Lee
 

Berlepsch

macrumors 6502
Oct 22, 2007
303
48
Or the infamous = instead of == :). That's always a fun one.

For that reason alone, I use the -Wall switch as much as possible.

In university, I once spent hours to figure out why my program didn't work. Turned out, I defined a loop for(i = 0; i <... , but inside the loop, I used n as index variable :rolleyes:
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Or the infamous = instead of == :). That's always a fun one.

I injected this very bug into some production C++ code at work very recently, as part of some complicated conditional clause. The ill effect only surfaced some of the time due to the short circuiting of the logical || operator within said conditional clause.

Indeed, spending the two hours or so to track it down (down some blind alleys too) was a hoot.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
I injected this very bug into some production C++ code at work very recently, as part of some complicated conditional clause. The ill effect only surfaced some of the time due to the short circuiting of the logical || operator within said conditional clause.

Indeed, spending the two hours or so to track it down (down some blind alleys too) was a hoot.

But did you find and fix any other bugs in the process?

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.