[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 55 KB, 840x500, 44FD30B9-980E-4481-8868-00D55DB3B8C8.jpg [View same] [iqdb] [saucenao] [google]
12479412 No.12479412 [Reply] [Original]

Taking a class on Python at college in the spring. I’m new to programming. What can I expect and how should I prepare?

>> No.12479420

Just do some intro python tutorials. Maybe try some easy LeetCode problems in python. But I wouldn't be too worried about prepping for an intro cs class.

>> No.12479425

>>12479420
Is python a viable language compared to the other top ones?

>> No.12479444

>>12479425
just learn one and you can learn other ones easily. python is good for beginners unless you're smart, in which case you should start with something like C to build foundations.

>> No.12479482

>>12479425
Python's definitely the best for ML and any other science data science applications. If you're more pure CS / mathematics you should learn java, rust, etc. I wouldn't try and learn C unless you care about memory management and internal workings of the computer

>> No.12479496

>>12479425
>to the other top ones?
Python is THE top one. It BTFOs every single other language and I am saying this as someone who really dislikes the language. Thank God I am not in a situation where I have to use it anymore.

>> No.12479506
File: 113 KB, 990x990, 1607686979616.jpg [View same] [iqdb] [saucenao] [google]
12479506

>Taking a class on programming
>chooses the most useless language to do so

>> No.12479507
File: 1.28 MB, 850x939, 1602176234171.png [View same] [iqdb] [saucenao] [google]
12479507

>>12479412
You need a PC with Linux installed, and gcc, learn to program in Python, then C, then some assembly. Perl and Lisp dialects are also good, as are some side languages like Haskell or OCaml.
Once you know programming, the rest is easy. None of this is hard, and the class just isn't gonna teach this stuff well, so you need to get started now if you want to have fun.

>> No.12479511

>>12479496
Cringe.

>> No.12479522

>>12479412
programming\scripting is basically algebra with computing functions.
also go away
>>>/g/

>> No.12479523

>>12479511
no u

>> No.12479579

The official tutorial is a decent place to start, you need an interpreter and it helps to start as early as possible
https://docs.python.org/3/tutorial/

>> No.12479584

>>12479507
>yOu NeEd A pC wItH lInUx InStAlLeD

>> No.12479587

Im getting into haskell. My brain is swelling and I feel 3 times as smart. Is this normal?

>> No.12479601

>>12479584
Best IDE?

>> No.12479609

>>12479587
Yes, delusion of grandeur is a side effect of learning Haskell.

>> No.12479611

>>12479412
your most likely not gonna make it. people actually into programming/comp sci already started tinkering around when they were teens and created their own little projects.

>> No.12479615

>>12479601
Emacs.

>> No.12479622

>>12479496
unless you have a real job, then you probably need to learn C++ for any real modelling and simulation

>> No.12479668

>>12479601
>>12479615
samefag

>> No.12479669

>>12479507
the rest is not easy, what about the math/calculus side of it all. combined with creating more complex algorithms, it's hell

>> No.12479683

>>12479611
I hope you die in your sleep.

>> No.12479684

I'd reccomend getting a heavyweight IDE like spyder that comes with all the packages installed. Makes things much easier when you are starting out.

>>12479425
Depends what you want to do.

Write short automation scripts?
Python
Data science?
Python
Windows desktop applications?
C#
Android apps?
Java
ios apps?
Swift
Performance software?
C++ (possibly rust, havn't tried it yet)
Embedded?
C

I don't know much about web stuff, that's a different game, but very useful.

>>12479507
Based sicp poster

>> No.12479691

>>12479683
me too

>> No.12479710

What's the name of the class? Because depending on it, it can be algorithms and data structures (although I don't think that you'll see it with python) or just intro to programming, in which case you shouldn't need to prepare

>> No.12479715

>>12479412
Expect to be fucking bored. No way you can stretch learning python over a whole college class unless you autistically go over every builtin module and function, or the class is actually a bunch of projects that aren't really about learning the language. DESU just start learning it now. Google some tutorials and go at your own pace. Proficiency doesn't come from classes anyway, it comes from projects.

>> No.12479731

>>12479412
>how should I prepare?
by learning C first

>> No.12479737

>>12479412
It's a good choice.

>What can I expect and how should I prepare?
Getting into the habit of using it.
E.g. something you can try to do right away is write a script that you pass a directory path and two words and it then scans through all its subdirectories and, in. all .txt files, replaces all instances of the first word with the second word.

python C:\myHome\myDirectory wine beer

>> No.12479742

>taking a class in python
>my "class on python" in university consisted of a professor linking to python documentation on a ML assignment

American colleges are a joke

>> No.12479837

>>12479601
stack ghci

>> No.12479926
File: 239 KB, 511x428, cec.png [View same] [iqdb] [saucenao] [google]
12479926

>>12479412
lesson 1 vars:
a = 1
b = 2
a = b
a > b
a < b
a % b
lesson 2 arithmetic:
a = 1
b = 2
c = 4
a + b + c
a*(b/c)
a**c
....
lesson 3 methods and types:
a = 1
type(a)
s = 'string'
type(s)
t = True
type(t)
s.upper()
s.lower()
print(s)
lesson 4 if\else:
if 1 == 1:
True
else:
False
lesson 5 for loops:
print([i for i in range(0,100) if i % 2 ==0])
lesson 6 while loops:
a = 0
while True:
print('times: ' + str(a))
a = a + 1
lesson 7 functions:
a = 1
b = 2
lm = lambda x,y: x+y
print(lm(a,b))

ignore OOP and other useless shit no class needed

>> No.12479957

>>12479622
i have a real job. python is by far my most productive language for modling and simulation. I only write C for embedded performance and fortran for desktop performance, rarely, when performance matters over coding productivity.

C++ is pretty much useless in R&D.

>> No.12480035

>>12479425
Yes it is. It offers a lot of possibilities without much knowledge.
However, if you want to do more sophisticated things I would recommend other languages.
For someone that may want to write some small scripts for processing some Data, it's fine.

>> No.12480039

>>12479412
Prepare to be bored shitless. Honestly the best tip you can receive.

>> No.12481276

>>12479507
>You need a PC with Linux installed
and stickers
You need the right stickers to put on your laptop. Go to /g/ for advice on that bit.

>> No.12481281

>>12481276
linux have a better development environment and better performance in general

>> No.12481289

>>12481281
It's also not completely pozzed with telemetry trackers and backdoors

>> No.12481298

>>12481289
depend on the distro.
to say the truth its impossible to function in this world with the absolute fsf philosophy

>> No.12481312

>>12481298
Which is the most pozzed? Ubuntu?

>> No.12481323

>>12479496
That's cringe as fuck.
Python is just super easy to use and because of that quite nice for scientist and ml.
Also even if you are shit programmer your code will look quite readable in it.
It's definitely not amazing by any different metric(speed, memory management, abstraction, expression power).

>> No.12481334

>>12481312
i know for sure ubuntu have amazon telemetry active on all recent distros, but i guess fedora centos clear linux etc... are on the same boat as ubuntu.
debian gentoo and probably arch are clean by default

>> No.12481338

>>12479587
Haskell was the easiest part of my class lmao

>> No.12481363

>>12479957
most physicists/nuclear engineers who do any sort of radiation transport modeling or detector modeling use GEANT (C++) or MCNP (fortran) or some other tool like SCALE. another widely popular molecular dynamics tools is LAMMPS (C++)
obviously python is hugely popular and simple to use, but when i think of modeling and simulation I think C++ not python

>> No.12482603

A whole class on python? Hahaha what a waste of time.

>> No.12482631

>>12481363
But the codes you mentioned are maintained by dedicated development teams. If you actually want to interface with those programs or process an output you will be using a scripting language. Most of the people who use that kind of software drive it with python and let the optimized compiled codes do the heavy lifting.

>> No.12483819

>>12479506
no

>> No.12483829

>>12479669
>the rest is not easy, what about the math/calculus side of it all. combined with creating more complex algorithms, it's hell
All unimportant. :^)

>> No.12483838

Also looking to learn programming to broaden my abilities professionally.
Want to add the ability to do advanced physics modelling and simulation (plasma physics, radiation transport, materials science/molecular dynamics, heat/fluid transfer, etc.)
Took one entry level C course in uni but it was shit, literally the first 6-8 weeks involved no if statements, looping constructs or anything, just writing algorithms using operators and sperging about using %
>what language should I learn that will be most beneficial to me professionally (difficulty unimportant)
>what resources should I pursue to complete this training

>> No.12483911

>>12483838
https://b-ok.cc/book/5653471/abb00c

>> No.12483916

https://www.tutorialspoint.com/python/index.htm

Do this and you are golden.

>> No.12484112

>>12483916
Tutorialspoint are OK but it's better to use a broad range of resources.
personally I used hhtps://www.codewars.com as a gamified way to learn coding concepts, though I'm stuck at 3 kyu because I'm hitting a knoledge gapl on the more complex tasks.
but generally I complete the kata until I hit a stumbling block and have to learn new concepts
I will say that one should probably ignore the popularity votes for solutions. Generally I've found the community friendly.