Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Comment Re:This guy hasn't done his research. (Score 1) 648

It's actually really simple (though I agree that it is surprising): if an identifier is assigned inside a code block (which is e.g. a body of function or a class; but not a body of a loop or a conditional statement), that variable is treated as a local variable throughout that entire block, unless there is a "global" declaration for it in that block. So:

x = 1; y = 2
 
def f():
  x = y
 
def g():
  y = x
 
def h():
  global x
  x = y
 
def m():
  print(x)
  x = y

Inside f, x is a local (because it is assigned to), and y is a global. Inside g, y is a local and x is a global. Inside h, both x and y are globals.

This gets more interesting in m, where you'll get an error trying to read an unassigned variable when printing x, because x is treated as a local throughout the body, not after assignment (and the scope is still lexical, not dynamic - it doesn't even matter if assignment executes or not).

Comment Re:instant disqualification (Score 1) 648

I'd pick VisualBasic over Python as a beginners language.Plus VisualStudio is really good; its a good IDE, good debugger; its stable, its free; its widely used in the 'real world'

And you can use it for Python, with everything that you wrote still being true.

and you can focus 100% on "learning to program" without getting bogged down in configuring your environment or managing your toolchain or phyhon package management, library versions (python 2 vs 3), etc, etc, etc.

For this kind of stuff you really don't need to. I would be extremely surprised if all the tasks that he covers in his class wouldn't be covered even by the base Python install downloaded from http://python.org/ (which PTVS will even tell you to do if it finds that you don't have Python). And if that is not true, then a prepackaged Python distro like Anaconda - again, a single-click install - will surely be enough.

Besides, VB.NET is basically C# with training wheels; so you switch BEGIN and END for curly braces, realize procedures are just functions that return "nothing", and a little bit of other syntax and you are up and running in something that is pretty relevant.

I would argue that the cruft that VB.NET puts on top of C# is mostly useless as training wheels - it's no big difference between IF..END IF and curly braces - and in some cases is actively harmful because it uses its own terminology that is not shared with any other programming language, in lieu of terms that are commonly used throughout the field (like MustOverride/MustInherit instead of abstract).

Basically, if you are teaching people VB, you might as well teach them C# right away. It'll take 1% more effort, but they'll have a more useful skill from the get go, and knowledge of syntax will help them when it'll come to C++, Java, JavaScript etc.

Comment Re:instant disqualification (Score 1) 648

This is exactly why Python is so popular as a teaching language these days - it also lets you skip most of the boilerplate for the initial exercises, and focus on the core concepts like conceptual execution, the notion of variables and values, conditionals and loops etc. It's a true OO ("everything is an object") language, but you won't ever see a class or a method call in hello world type code.

Oh, and it has a built-in turtle graphics package. I don't think a better tool to explain things such as loops and recursion has ever been devised.

Comment Re:instant disqualification (Score 3, Insightful) 648

It also randomly renames things that have well-established terms already. E.g. "abstract" methods - all languages that have them, have agreed on the meaning of it for the past 30 years or so. But VB calls them "MustOverride". And "abstract" on classes is "MustInherit". And those labels don't even make much sense, because, taken literally, they make claims that are plainly not true (you don't have to inherit from an abstract class - you just can't instantiate its instances; and even if you do inherit, you don't have to override any abstract methods - it's just that your class is also abstract if you don't).

Comment Re:What do you expect to find? (Score 1) 335

It doesn't explain admin roles (where there are a lot), and I don't think that low-level HR jobs are all that cushy, either, or pay well compared to developers, especially a few years in when you get a couple of raises and associated cash bonuses.

FWIW, the (immigrant) women who are devs or dev managers do pretty well for themselves - I'm talking about senior positions here, the ones where combined base pay and bonuses would typically go $200k and above.

Comment Re:I would rather see 1000 terrorists go free... (Score 1) 562

You know who has trouble with "bad cops?" The people who don't respect authority in the first place. The people who have done things that harm others and the society at large. My daughter will never be in a confrontation with the authorities - never become a Michael Brown - because she has been raised to understand the need for the police and for keeping the peace (as much as I can teach her).

Your daughter will be in confrontation with authorities if, say, her house gets SWATed on a false charge (because an unreliable informant pointed at it), or simply because they got the wrong address or the wrong door. She won't get a chance to say "yes sir, please and thank you", because she won't be asked - the first thing she'll know is when her door is blown off the hinges with a shotgun and a flashbang comes in. Maybe it lands into her baby's crib, too. Maybe she gets a limb or two broken when they put her face down into the floow. Best case, they will only shoot the dogs and mess up the room with the entrance before they figure out something's wrong and leave (with no apologies and no compensation for damages).

Or perhaps she'll be driving around with a couple thousand dollars in cash, that she won in a lottery, and gets stopped by cops because they'll claim she's speeding (but really because she's cute). And when they see the money they will claim that such a large amount in cash is suspicious, and arrest it as proceeds from drug sales, because they get to pocket a good part of it for their PD (i.e. to buy more toys like MRAPs and .50 BMG sniper rifles for themselves).

If she is black, it might get even more interesting. For example, during a routine traffic stop (for which she needn't do anything wrong, they might just be randomly pulling people over) an officer will ask her for ID, and she'll reach for her pocket because that's where the wallet is... and get shot point blank because the officer thought she's reaching for the gun. Because that's what he thinks of first when he sees a black person reach for their waist.

Or maybe she'll get arrested on an outright false charge just because she happens to come across a cop who "just hates niggers, that is all".

FYI, all of the above is not a figment of my imagination. It's all real stories that happened right here in USA with different people. The chances of something like that affecting your daughter are still orders of magnitude higher than the chances of being killed by a terrorist. So rather promoting more surveillance state, you might want to talk to your representative in Congress about police militarization first.

Comment Re:2nd/3rd generation of immigrants are IMMIGRANTS (Score 1) 219

The European countries are ethnic states, have been for thousands of years

You might want to brush up on your history. Up until 200 years ago or so, there wasn't even such a nationality as "French" or "Spanish". There were Bretons, Catalans etc. And most European states up until then were united not by shared ethnicity, and in many cases not even by shared culture or religion, but by allegiance to the same monarch. It wasn't until the advent of what we now call Romantic nationalism at the end of the 18th century, that ethnicity really began to matter in national politics in a big way.

In fact, the current relatively uniform ethnic composition of European states didn't crystallize until a lot of borders were redrawn after WW1 (e.g. treaty of Trianon), and massive population transfers in the aftermath of WW2. So the current state of affairs is literally 70 years old.

Of course, the notion that just because your ancestor ten generations removed has lived in a political entity with roughly similar borders and/or name two centuries ago, you get some special entitlement in the current political entity in its place, is absurd on its face anyway.

Comment Re:Let's be blunt (Score 1) 361

Unless you have completely isolated your kids from the outside world, they absorb a lot of your culture from it, even if your family is not quite mainstream for that culture. So your experiment doesn't really tell us much.

I mean, seriously, do you think that boys have some innate gene that makes them make engine noises?..

Comment Re:What's wrong with Europe nowdays? (Score 1) 174

Europe was never cool when it came to freedom of speech. First it was Holocaust denial laws, then it was generic hate speech laws, these days they have laws against "infringing upon human dignity of another" in some countries. And their constitutions, for those countries which have them, while usually containing an explicit clause protecting free speech, also contain numerous blanket exceptions to it that basically boil down to "speech is free so long as it's not inconvenient, and what's inconvenient can change as we go".

Slashdot Top Deals

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...