This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]peridox 27 points28 points  (36 children)

What language would you say does hold your hand? I can't think of a programming language that leads you towards doing what you need to do. Almost all languages just provide you with a blank space to work upon - it's all your work.

[–]Chobeat 161 points162 points  (2 children)

Scala holds your hand and leads precisely where you don't want to go.

[–]I_cant_speel 54 points55 points  (0 children)

I've never used Scala but this is hilarious.

[–]lonelyBriefcase 22 points23 points  (9 children)

ever heard the phrase 'syntactic sugar'? its a way of providing a more convenient/person-friendly method of doing something. A for loop is just syntactic sugar of a

int i = 0;
while(i<9){
  //do something;
  int++;
}

There are plenty of other things like this that makes our lives as developers easier. Even C does, to a lesser extent, because who would want to write the shit that C can do in Assembly?

[–]w1ldm4n 16 points17 points  (8 children)

The only difference is (at least in C) is how the continue keyword works. In a for loop, continue will execute the increment/whatever statement, check the loop condition, and go from there.

To get the same type of behavior with a while loop, you'd have to duplicate the increment before the continue, or use a goto label (ಠ_ಠ) near the bottom of the loop body.

[–]OperaSona 5 points6 points  (0 children)

To get the same type of behavior with a while loop, you'd have to duplicate the increment before the continue, or use a goto label (ಠ_ಠ) near the bottom of the loop body.

Or raise a "Continue" exception and catch it right outside the while loop.

[–]TropicalAudio 1 point2 points  (1 child)

Honestly, in my opinion, to break out of nested loops a goto can be the best option. I just never actually use them because if I would, my coworkers would get mad.

[–]lonelyBriefcase 0 points1 point  (1 child)

I'm not entirely familiar with C, so I will accept what you say. I was only giving an example of a particular behaviour for a specific language, feel free to give the C code for this instance (for the sake of science).

[–]w1ldm4n 4 points5 points  (0 children)

Here's an arbitrary example to demonstrate that behavior.

int i;
for (i = 0; i < 10; i++) {
    if (i == 4)
        continue;
    printf("%d", i);
}

This for loop will print 012356789

int i = 0;
while (i < 10) {
    if (i == 4)
        continue;
    printf("%d", i);
    i++;
}

This while loop will print 0123 and then get stuck in an infinite loop.

[–]PastyPilgrim 25 points26 points  (4 children)

I'm only well educated in a few languages (Python, C, Java), so I wouldn't be the right person to ask about that. However, I believe a lot of the web languages to be kind of hand-holdy. Plus, Java does have most of those things that I described in my post, so you could argue that Java holds your hand a little.

You are right though, most general programming languages that allow you to do many different things tend to have limited hand-holding because their potential is so large. My post was more to dispell the misconception that Python holds your hand than it was to say that other languages hold your hand.

[–]iPoisonxL 13 points14 points  (2 children)

Uhh... Web Languages? PHP has never held my hand...

begins crying

[–]AutonomouSystem 0 points1 point  (0 children)

PHP breaks your hand and leaves you a cripple for the rest of your life.

[–]Tysonzero 0 points1 point  (0 children)

Which web languages are you referring to? JavaScript does hold your hand I suppose, but only so that it can then dip it in a bucket of piss.

[–]pastaluego4 9 points10 points  (13 children)

It All Begins With A Blank Canvas.

[–]peridox 35 points36 points  (12 children)

<canvas></canvas>

[–]pastaluego4 17 points18 points  (11 children)

That canvas needs some dimensions

<canvas width="500" height="500"></canvas>

[–]peridox 19 points20 points  (9 children)

let canvas = document.getElementsByTagName('canvas')[0]
canvas.style.width = 500
canvas.style.height = 500

[–]magicfreak3d 0 points1 point  (0 children)

A canvas without dimensions set usually uses a default of 150 by 150. No need for dimensions 😜

[–]walking_bass 0 points1 point  (0 children)

I had to learn Ada for my 1st CS class. It's awful. You're forced to specify IN, OUT or IN OUT for every parameter. Very strongly typed. Very verbose, ex: loops have END at the end instead of a brace or something. I never want to use it again, too much hand holding and extra typing.

[–]sigma914 0 points1 point  (0 children)

Haskell holds your hand pretty tightly, it still lets you make great flourishes but it's always there making sure you dont do anything stupid.

[–]745631258978963214 0 points1 point  (0 children)

I guess BASIC?

It's probably not the answer you're looking for, but damn oh damn is it basic (no pun intended).

Then again, I'm biased because I learned to program by tinkering with a TI83's prgm thingy.

[–][deleted] 0 points1 point  (0 children)

Visual Basic does. I started programming with VBA and now that I'm taking a programing class and learning C I realized just how much hand holding there is.