[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Python programming
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 59
Thread images: 4
File: python[1].png (80 KB, 1000x1000) Image search: [Google]
python[1].png
80 KB, 1000x1000
I just recently learned C and have an urge to learn Python, so how difficult is it to learn compared to C?
>>
>recently learned C
did you start in the 80s?
>>
Its a joke
>>
>>53655529
I'm in college. The introductory programming class teaches in C.
>>
>>53655519
Hello world is literally just
print "Hello, world"


That's how fucking easy it is. Watch how you do input.

name = input("Type your name: ")
print "Hello %s" % name
>>
>>53655541
It's so comfy. :3
>>
>>53655519
extremely straightforward by comparison. if you have some OO experience then it will be all the more easier.
>>
You basically already know python. The indentation-based blocks can be a little weird, but you get used to it.
>>
>>53655519
Learn about OOP and it's principles.

Once you did that, Python is literal kiddy shit compared to C. There's a module for every dumb shit possible, and you have cleaner syntax and support of a wide array of online material.

Performance will be lesser than C, though this is negligible for most use cases, especially to a student.
>>
>>53655649
>Python
>OO

Pick one
>>
>>53655519
If you know C, Python will seem like someone's playing a joke on you. It's much easier.
>>
>>53655541
Python2 fag detected
>>
File: 792373.jpg (310 KB, 1181x929) Image search: [Google]
792373.jpg
310 KB, 1181x929
I'm using visual Studio, can you please tell me what other program can I use for coding?
thanks!
>>
>>53655957
Literally bloc note.
>>
>>53655957
There are tons of stuff you can use. I wouldn't worry about it until you have a reason to use some thing else.
>>
>>53655998
But I do, the _init_ function is not working for me on visual
>>
I expect it will be fairly difficult since you don't know any object oriented programming.
Anyway prepare to be infuriated by pythons failed attempt to remove data types and simplify braces / indentation.
Despite not being able to declare a variable type you have to keep in mind what type it is under the hood so you can cast it every single time you use it.
Also make sure that all of your dev environments use the same indentation. You can't mix tabs with spaces and some IDEs insert 3 or 4 spaces when you press tab instead of using a tab character.
There's also the really shitty __init__ type methods, loops iterating over lists, triple quotes, lack of baseball metaphors (try except), references to self everywhere for no reason, None instead of null, etc.

Perl is a much better scripting language. Small instruction set, lots of logic control options, and all around does everything it can to be easier to write and easier to translate thoughts into code.
>>
>>53656136
>infuriated by pythons failed attempt to remove data types

>have to use python for class
>used to programming in Rust, C, and Swift
O I AM disappoint in python
>>
Actually I'm learning python, but I want to learn something useful for working , I want to try java and html too
what do you think ?
>>
>>53656173
you don't so much "learn" HTML, as you just use it. it requires about one braincell to use.
>>
>>53656173
You don't learn html. You know that there are a set of <words in brackets/>, most of which you should never use (according to the xhtml standard), and you look them up every time.
>>
Seems that I'm learning html right now haha.
I just started into programming, I'm studying software development, first semester, but I want to start with some language that can really be useful in the future.
>>
>>53655519
easy if you learned C first
>>
>>53656240
haha. good luck :^)
>>
Just, please don't write full fucking desktop applications in python

or perl

or ruby
>>
>>53656316
Why not? Python is cross platform and very valuable.
>>
>>53656322
noob
>>
File: u-mad.png (248 KB, 552x522) Image search: [Google]
u-mad.png
248 KB, 552x522
>>53656348
>>
>>53655540
>The introductory programming class teaches in C

ouch. Most universities, like MIT, are teaching Python as the introductory language now. Feel bad for you man.
>>
>>53655928
python3 cuck detected
>>
Learning python is easy, I'd try learning python along with sql and tkinter, then you can make (terribly looking) but complex programs
>>
>>53655519
python is definitively more hard to learn than c but once you know it, it's way less tedious to program.
>>
Python is an easier C++, I use it because it's good and simple.
>>
>>53657558
>TK
confirmed for troll
>>
>>53655957
Nano
Notepad++
Geany
Gedit
I unintenionally typed those in alphabetical order.
>>
>>53657630
What would you suggest instead of tkinter?
>>
>>53655957
Pycharm
>>
>>53655957

Professional Python developer here, been using Python for 9 years now. It varies, but my coworkers use PyCharm, SublimeText3, and vim. I personally use SublimeText3. Try things out and see what you like. There is no wrong answer, anyone who tells you that there is only one single editor to use over all others is a retarded memeing cunt.
>>
>>53657659
You obviously don't even know what "alphabetical order" is.
>>
>>53657730
Qt
>>
>>53655519
Easier. I've never actually learned how to program in Python, but I am still able to do all the scripting I want with it anyways.
>>
>>53655928
It's python 3 because python 2 uses
raw_input
>>
>>53655529
> i spout memes because i don't know what i'm talking about
>>
File: 1305139527817.jpg (21 KB, 202x204) Image search: [Google]
1305139527817.jpg
21 KB, 202x204
>>53658361
>>> x = input()
2
>>> type(x)
<type 'int'>
>>>
>>> y = input()
{'a': 1, 'b': 2}
>>> type(y)
<type 'dict'>
>>>
>>>
>>> z = input()
__import__('os').system('echo rm rf abloobloobloo')
rm rf abloobloobloo
>>>
>>
>>53658465
no but seriously who the fuck thought this was a good idea
>>
>>53658184
Why?
>>
>>53656517
A good understanding to C gives a great foundation in how computers run programs, nothing wrong with that
>>
>>53657630
>not liking Tk
It's the comfiest Toolkit.
>>
>>53655519
It's easy, but one thing that often gets neglected is that to program somewhat efficiently in Python you need to have a different kind of thinking. With more low-level languages it's beneficial to think about how the machine is actually operating and program as close to that as possible. With Python you'll end up with the slowest programs imaginable like that. Example:

import numpy
import math
import time

t0 = time.time()
for i in range(10000):
x = numpy.linspace(0, 9.99, 1000)
f = 1/numpy.sqrt(2 * numpy.pi) * numpy.exp(-(x - 10)**2 / 18)
print time.time() - t0

t1 = time.time()
for i in range(10000):
f = [0] * 1000
for j in range(1000):
f[j] = 1/math.sqrt(2 * numpy.pi) * math.exp(-(j / 100 - 10)**2 / 18)
print time.time() - t1


So this program calculates 10 000 times a list/array of 1000 function values of some random function. The first time it uses the numpy library, the second time it's implemented like you would in C/C++, probably. First way is 24 times faster than the second time. If you know that, programming in Python is much easier, but also much less fun imo.
>>
>>53655540
>introdutory
>learned C
sure, son. you've got it
>>
>>53656517
Why? C is still an excellent language, it gives you a decent amount of low level knowledge and transitioning to other popular languages (C++ and Java esp.) is incredibly easy.
>>
>>53658465
>rm rf
ebin
>>
>>53655519
Anon, it's the other way around.. Python is a introductory language since well, it's incredibly simple and easy to learn. You were better off learning Python first THEN going onto C.

Oh well.
>>
>>53660341
nigga I am terrified of rm I am not going to risk fate
>>
>>53655540
same here, we started off with C and switched to java after one semester. Teacher said C punishes mistakes and makes you code more cleanly.
>>
>>53661370
opposite here, introductory programming is in java and after that we use C or python for everything
>>
>>53661370
You're learning Java the semester after C?
My university does the same thing.
>>
>>53661370
>makes you code more cleanly
[citation needed]

http://blog.regehr.org/archives/721
http://blog.regehr.org/archives/1307
>>
>>53659837
underrated post
Thread replies: 59
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.