Author Topic: Programming Megathread  (Read 143080 times)

what is "index.num" supposed to be, in the first place? you never define that

Not sure about the rest of your code, but you'll probably want to change

Code: [Select]
for index.num in range(len(numbers)):
    total = sum(numbers)
into
Code: [Select]
total = 0
for item in numbers:
    total += item

And you'll probably want to return total somewhere.

b-u-m-p
anybody who places their semicolons on the next line should BE GASSED AND KILLED, EFFECTIVE IMMEDIATELY
SAME GOES FOR ANYBODY WHO PLACES THEIR BRACES ON THE
SAME.
loving.
LINE.
REEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEE

anybody who places their semicolons on the next line should BE GASSED AND KILLED, EFFECTIVE IMMEDIATELY
SAME GOES FOR ANYBODY WHO PLACES THEIR BRACES ON THE SAME. loving. LINE.
REEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEE
do you think you're funny, I wonder

b-u-m-p
anybody who places their semicolons on the next line should BE GASSED AND KILLED, EFFECTIVE IMMEDIATELY
SAME GOES FOR ANYBODY WHO PLACES THEIR BRACES ON THE
SAME.
loving.
LINE.
REEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEE
wat

b-u-m-p
anybody who places their semicolons on the next line should BE GASSED AND KILLED, EFFECTIVE IMMEDIATELY





is codeacademy good at all or is there better alternatives because i seem to struggle to learn practical skills with it

is codeacademy good at all or is there better alternatives because i seem to struggle to learn practical skills with it

codeacademy used to be good until they began putting paywalls everywhere and tried to make every lesson "hip" by putting justin beiber as topics to write programs about

the best way to learn how to program is usually textbooks, as a lot of these "learn to code sites" are incredibly stupid, usually pandering to certain audiences or making you pay out a stuffton of money for lackluster lessons

if you want some textbook recommendations, i recommend anything by Tony Gaddis, he makes some good "intro to" language books



b-u-m-p
anybody who places their semicolons on the next line should BE GASSED AND KILLED, EFFECTIVE IMMEDIATELY
SAME GOES FOR ANYBODY WHO PLACES THEIR BRACES ON THE
SAME.
loving.
LINE.
REEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEE

see the thing about this is that everyone is taught differently, and some indentation styles look better for different situations

like .NET's allman style:

Code: [Select]
static void Main(string[] args)
{
    Console.WriteLine("Hello, world!");
    Console.Read();
}

looks great for functions and loops, as you see the conditions of the loop seperate from the body of the loop really quickly. however, it looks stupid when you do something like this:

Code: [Select]
try
{
...
}

where you have a scope floating below a keyword, where it looks like that keyword is out of nowhere, making it hard to read.

i like K&R styles better, in my opinion, but I'll admit when you have triple nested loops, it looks handicapped as hell. and convoluted. and hard to read.

edit: judging people's indentation styles for how you see fit usually ends up with you either looking stupid or stubborn when you refuse to listen to why some styles work better than others

the semicolon on the next line thing is from Haskell, and if you read the language it'd make much more sense why they do it
« Last Edit: December 20, 2016, 02:22:17 PM by SetGaming »

What I mean:
Quote
return true
;

Code: [Select]
if(blah){
Stuff
}

OT:  I never knew it was possible for my many c++ tests to crash when they access a struct ;-;

So at work, we have a costumer doing crazy stuff with our software.
We have software that installs on handheld windows CE Barcode scanners, which talks to our server, and we also have a public rest API.
Instead of using the API, this guy installed the CE software into a desktop computer, and has another app hooking into it, feeding values into, and extracting return values out of, the forms.

I mean it's kind of clever, but I'm trying to work with him to figure out why the api doesn't fulfill his needs

is codeacademy good at all or is there better alternatives because i seem to struggle to learn practical skills with it

it's a decent site, i only learned python there though. as setgaming said, it's a lot better to read a textbook online, but the problem is that you're not really interacting or doing anything with python itself, all you're doing is reading the book. of course, optionally, you can do what the book tells you to do, but there are people that don't.

it really depends on where, what, and how you're learning though, you can do anything as long as it teaches you the syntax of the language.

i try to learn languages via their documents as they contain tutorials and some tips on the language you are learning, like python.

tried to make every lesson "hip" by putting justin beiber as topics to write programs about

i didn't encounter this when finishing the python course, the only references i noticed were monty python references. it depends on what course you take, i guess.
« Last Edit: December 20, 2016, 03:34:45 PM by Timestamp »