/bpg/ - beginner programming general

mainly for bored NEETs and hobbyists to learn programming. get in here and share whatever you are doing.
NO SCHOOLFAGS/WORKFAGS ALLOWED. this is a comfy thread

Other urls found in this thread:

discord.gg/8EmTDae
calormen.com/jsbasic/
worrydream.com/LearnableProgramming/
reddit.com/r/learnprogramming/comments/2qznse/i_need_serious_help_learn_to_program_was_my_new/cnb1luk
worrydream.com/LadderOfAbstraction/
opensource.com/life/16/7/linux-theoretical-physics
www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html
sanctum.geek.nz/arabesque/series/unix-as-ide/
greenteapress.com/thinkcpp/index.html
cprogramming.com/tutorial/c-tutorial.html
matt.sh/howto-c
nethack4.org/blog/
c.learncodethehardway.org/book/
cs.yale.edu/homes/aspnes/classes/223/notes.html
learn-c.org/
bottomupcs.com/
opensecuritytraining.info/IntroX86.html
insecure.org/stf/smashstack.html
ganssle.com/startinges.htm
Sup
twitter.com/SFWRedditImages

what do i do

...

i want to fug akari

...

>c++
user, this is evil.

kay N arr
then join c fanclub at /dpt/ and make fun of rustlets

I've maid a discord chat for /bpg/ OP, do you like ? discord.gg/8EmTDae

which one are you

>java
>it's a very slow language
wrong

Java question. If all subclasses of a class have the same static field, is there a way to call them from an array of the superclass?

Nothing past 2a or maybe cursory 2b is needed. Don't let yourselves be deceived, newbs.

Hey guys, I work as a programmer full time

Programming != Computer science

But why would you not want to?

Because this is set-up as an ultra-beginner thread and OP specifically wanted a thread without tryhards. It might be discouraging.

who is akari?

>python
>great
>java
>slow
kek

I have Java installed and working on a linux mint install, so I can make programs.

I have a project mapped out and working in Excel (just concatenating strings of text, making a word generator thing)

I just procrastinate; maybe it's not for me, lol.

Last language I used was BASIC on the C64 ;_;

share your programs anons

Python is a great first language to start people off on because it's so easy to read and people quickly latch on to what code does. Fite me m8

So is going through K&R enough to get me started? Or is there supplementary materials I should be using as well?

Anime is shit and so are you. This is all wrong.

do i need to memorize the c standard library or STL for c++ in order to get a job? i have a good grasp of both languages but fuck trying to remember all of that shit, i can just google.

For getting started K&R is fine.

got nothing to share user - I've not done anything with Java since getting it running, although I just remembered BASIC and wrote this out of nostalgia:

10 print "you are a...?"
20 print "A) dickhead"
30 print "B) dickhead"
40 input ""; a$
50 if a$ = "A" then goto 80
60 if a$ = "B" then goto 80
70 print "WRONG"
75 print "G A M E O V E R"
77 print "Press Enter to try again"
78 input ""; a$
79 goto 10
80 print "You are a dickhead! :)"
85 PRINT "Press Enter"
90 input""; a$
100 print " H E A D D I C K";
110 goto 100

Everyone should try it in calormen.com/jsbasic/
before I sell the rights to it

Though Sup Forums removed the extra spaces in line 100 that really gave it the cinematic edge

I don't think it deserves being called a program. Still would like an answer to my question, although it doesn't seem to be possible (stackoverflow.com/questions/4898736/java-static-field-in-abstract-class).

finally the real thread

>java
>slow

this is what retarded first year CS students say to try to sound like they know things

how do i learn python

I've been programming in Java for about four years now, but I started teaching myself C yesterday. Am I allowed ITT?

automate the boring stuff or think python
both are free i'm pretty sure

How do you stay motivated, /bpg/?

Including Fortran, Perl, and Lisp in any "guide" to beginner languages...

Personally, I went C -> Python -> C++ -> Erlang, among other things, but it wasn't until I used Python that I actually enjoyed programming. Automation, web-crawling, computer vision, etc.

Got a job in two years.

I tried to learn coding through codeacademy. what else can I do without paying thier program? should I buy a rasbery pi?

compiled> interpreted language

There's no reason to buy a raspberry pi unless you want to get into embedded systems, and even then it's a stretch. What language were you learning on codeacademy? Where do you want to go from here?

goodnight /bpg/ please be alive when i wake up

>calculus
Hah what

no fuck off

Dumping stuff
INTRODUCTION
How to read code: worrydream.com/LearnableProgramming/
How to think programming: reddit.com/r/learnprogramming/comments/2qznse/i_need_serious_help_learn_to_program_was_my_new/cnb1luk
Understand abstraction: worrydream.com/LadderOfAbstraction/
The importance of the environment: opensource.com/life/16/7/linux-theoretical-physics

TOOLS
GCC and Make - A Tutorial on how to compile, link and build C/C++ applications: www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html
Unix as IDE: sanctum.geek.nz/arabesque/series/unix-as-ide/

C GUIDES
How to Think Like a Computer Scientist: greenteapress.com/thinkcpp/index.html
C Tutorial - Learn C: cprogramming.com/tutorial/c-tutorial.html
How to C (as of 2016): matt.sh/howto-c
NetHack 4 blog: nethack4.org/blog/
Learn C The Hard Way A Clear & Direct Introduction To Modern C Programming: c.learncodethehardway.org/book/
Notes on Data Structures and Programming Techniques: cs.yale.edu/homes/aspnes/classes/223/notes.html

INTERACTIVE
Learn C - Free Interactive C Tutorial: learn-c.org/

ADVANCED GUIDES
Computer Science from the Bottom Up: bottomupcs.com/
IntroX86: opensecuritytraining.info/IntroX86.html
Smashing the Stack for Fun and Profit by Aleph One: insecure.org/stf/smashstack.html

Daily reminder to not waste your time with gay tutorials and instead read actual books

t. bookseller

how do I into embedded systems?

all books are free on genesis library

OP's anime girl

thankfully java isn't interpreted.

Asobi Ni Iku Yo is shit and your image is a shill.

>Start with Python because it's babby-tier but still useful
>Decide what you like and dislike about it, research other languages, and move on from there
>Alternatively, make le website with le JavaScript

There you go; /thread.

I've just gotten into doing tests, both manual and automated, to see how they work but I'm not sure I fully understand the concept. Often times writing the tests seems like a waste of time and running them also seems redundant.

I want to add a new feature to my program so I write a few more functions. I write tests to ensure these functions return the proper results to inputs. I run the tests and they come back passing. I push the code changes to github and now the tests run again. Of course they pass. I make a pull request to merge the changes into master. The tests run again. Of course they pass. I merge the code into master. The tests run again. Surprise, they pass.

Is it because I'm working as just one person in a small project? I just don't see why tests need to be run repeatedly on the exact same code. If the tests pass locally then why would they break when I push them to github? And if the pull request build passes test then why after merging would you test again?

Get interested in something
if it sucks, you'll never do it

I've been getting into IDA pro and Cheat Engine for reverse engineering games, the catch is that I don't know assembly
I'm a Java/JavaScript/C/Python programmer, and reverse engineering is really kicking my ass

What assembler does cheat engine use?

Do you mean like, x86 or x64?
it's disassembler/assembler doesn't exactly look normal. It's called Auto Assembler
again, I'm really lost in the assembly ocean here

So since MHW came out I wanted to make a searchable list of all of the armor in the game so that I could easily find armor that had the skills that I wanted. I don't know a lot about programming, but was thinking about how you could make this in Python. I came up completely blank.
My friend who knows more about programming whipped up a website using JavaScript that has a search bar at the top, and while you type in key phrases, it removes armors from the list if they lack what you are typing in either the armor name or in the name of the armor skills. Was this something that was just much easier to do in JavaScript from the beginning or am I just an idiot for not knowing how to do this in Python?

It is though..
Well, kind of.
Java is compiled to bytecode which is interpreted by the jvm when you start the program.
C# on the other hand is interpreted to IL which is JIT'd by the CLR when run.

That is trivial in any programming langauge. It's just searching through text.

You could just use grep lol

Can you explain how I would do this in python? I literally cant figure out how to get this to work in python.

And you are a faggot. Basically all imperative languages are the same. I don't get where your problem is. For the learner, the only important things are loops, variables and control structures. This can be learned in as good as every programming language. C++ can be used as well as C in this case. C++ is only getting hard when you start to use classes and object orientation, aswell as parallelization. Start with C to understand how the shit actually works, not with this bloated high level voodoo shit. Learn how memory works, try to understand how the computer works. Syntax is not important, your way of thinking logically is.

>C++
It's a specialized language. If you're not expecting to care intimately about performance you should probably not use it. Either you don't have these problems or you will always use libraries that deal with this for you, consider anaconda and ai frameworks. It's broadly understood that you don't use C++ if you don't care about performance to the point that the shills at Cppcon frequently say this.
>OOP
Too much to cover. But I'll say that this perspective comes from an antithetical position from NEET programming. OOP is an enterprise software preference.
Also none of the programming languages written about here are pure OOP. Java is the most OOP leaning but it's absolutely a multiparadigm language just like C++.
Anyway. I suspect NEETs will want to program in a functional or procedural environment. Proper OOP is very heavy handed.
>Java similar to C++
Misleading. They're both multiparadigm languages. They're both imperative languages. They're both C-like languages (applies to silly many languages).
I see the virtual machine aspect to be appealing for NEETs. It makes portability and learning resources simpler.
>Java is slow
>python is fast
Not the case at all. Inverse in fact. I'm starting to think this is intentionally misleading.
>python is fine but you should move
Not true at all. Depends on your requirements. For hobby programming especially python is quite good. Many libraries available. Relatively simple import model. Aimed for scripting.
>C
This is fairly accurate. But for a newbie they won't understand the ideas of C and C++ being similar. It's not helpful to say that.
>Fortran, perl, lisp
I won't comment on it. I don't know it.
I know some lisp but I couldn't meaningfully correct you.

java is jit'd though, it just interprets code that isn't executed that many times (a compromise between startup times and speed).

Well yeah.. The bytecode is either compiled or interpreted later.. Guh.. Java JIT is aot + interpretation. It is compiled but in a dynamic interpreted kind of way.
For C# you can use both the words compiled and interpreted to IL but in the end it is just JIT compiled in the end and not interpreted (or is it)

If Java byte code is interpreted in your opinion, you have to explain why other executed code isn't interpreted, using the OS as the interpreter

>aot
>dynamic interpreted
what
java interprets bytecode, then compiles code that is frequently executed, at execution time. how is that not jit?
compiling everything isn't always a good idea, if a codepath is executed only once in the entire execution compiling it might be slower than just interpreting and running it once.

it is interpreted (sometimes), as in it's not converted to machine code (or assembly, or whatever you wan't to call it) before execution. however that's not enough to say that "java isn't jit".

Non interpreted languages are basically those that are loaded on the RAM as instruction sets and called when needed whereas interpreted languages need another program to be of any use. This middle-lang shit makes the language dynamic somewhat like python but the compilation(or interpretation+compilation) ensures a faster program.
If python was to implement a JIT compiler, it would be on par with C# (though it would be slower if they still interpret full text instead of ASM like syntax ~java bytecodes and IL)

Embedded systems run on hardware with relatively limited resources compared to most laptops and desktops, so you should focus your learning on writing code that doesn't use as many system resources. C is always good for that, provided you know what you're doing, and I know Ada is used in military embedded systems. There's a list of books here that give more instruction: ganssle.com/startinges.htm

t. fizzbuzz aficionado

for small projects tests might be a waste of time, but when you are working in a moderately sized project with several people commiting code, it's a must. You need to learn it not for using right now, but for using when you start working with a large codebase.

When in a big group, between your original git pull and your git push there might have been huge changes added to the code, that's why you need the tests to run.

This image is fucking horrible advice.

what are some newb-friendly sources on OOP, whether in general or more related to Python? Yes, I've googled it, but can only come up with tutorials that are about a page long, I want a bit more depth. Pls help?

been a programmer for 3 years
never read a programming book in my life, neither have my peers

Go to school instead

Books is how you do school well though?
I was by far the top of the class, miles ahead everyone else, simply because I learned things on my own with books I found on the internet. It's faster and more efficient.
School is just to bug professors when you need a quick explanation or pointer

Programming = Trade
Computer Science = Professional

they are not the same

Thoughts on learning Ruby? I know a bit of Java and C++, along with standard/basic OOP concepts, does Ruby do anything special that these don't? What are the advantages of using it?

I literally just started out and I managed to confuse myself. I wrote this for the cs50 EDX (non-credit) so I can eventually use it to draw a right aligned pyramid of size 0-23. It compiled successfully but for some reason it doesn't do anything after the do-while loop. Is my for loop wrong?

#include
#include

int main(void)
{
int n;
do
{
printf("Please give an integer between 1 and 23\n");
n = get_int();
}
while (n < 1 || n > 23) ;

for (int h = n; h < 0; h--)
{
printf("#");
}
}

>h < 0
are any of the numbers between 1..23 lesser than 0

it's supposed to be n > 1 || n < 23

Oh, it's backwards, now I feel dumb. Thanks!

I don't know what this cs50 thing is but I'm pretty sure that part is about repeating the input if it's wrong.

scala

You're welcome but what the fuck is this cs50.h thing?
Is it a weird educational library?
Drop it really
Instead of get_int you woulda done scanf("%d", &n); wooow so hard

Yeah, get_int rejects non integers and repeats on it's own. The do loop repeats the request if it receives and integer outside the desired range. That was working as expected except I need to make it accept 0 instead of 1 after looking at the requirements again.

this is dumb

good info if you want to become a computer scientist not a code monkey though

>Is it a weird educational library?
Yes, it is what the online course uses. Basically they said they use C to teach basics and we probably wouldn't use it outside of the course. Later in the course they switch to python, SQL, and java.

>scanf("%d",&n);
I'll make a note of that.

That's retarded because C teaches you how things work but not if you hide things with an educational library and not if you only do 2 things with the language before dropping it for soy-abstraction monstrosity python

Is C# worth learning as a beginner? I used Python before a bit and wrote a few useless console-tier programs. Looking at C# with its countless libraries with complex docs makes my head twirl.

Sup Forums won't tell you this but C# is a great language, especially .NET Core for cross platform support. The syntax is a lot better than Java and LINQ is really something neat. It is my goto language for desktop applications.

I have the “ Programming in C 4th edition” on my shelf. Should I read it or just throw it away and use K&R?

If I've learned from this bad boy It can be done with anything.

I see people espousing this kind of learning all the time here, new to programmings so worried about how much of it is true in the real world.

People are trying to evaluate everything they were forced to learn in the uni.

If you are not going to do science then it's not that important.

Is Java really that bad?
I got to learn some very rough basics back in school and I think I could pick it up again faster than C

Trying to learn how to write a crypto trading bot in Python, so it's only fitting that I wear my programming socks.

Also my miner in the background, hashing 73MH/s on ETH

Sup Forums-science.wikia.com/wiki/Computer_Science_and_Engineering#Basic_Programming_.26_Data_Structures

quick question guys, Im using the MIT/GNU scheme alongside SICP and I'm doing excercise 1.3 where I'm asked to define a procedure so I was going typed (define (square x) (* x x)) but when typing square 7 it returns 7, not 49, what's going on?

try "(square 7)" instead of "square 7"

thanks user, but why does this happen?, I also noticed defining the square doesnt work when you don't put the brackets surrounding define but didn't give it much thought

I found a library on github (binance API wrapper) that I want to import as a module into my Python project.

How are you """supposed""" to do this? I'm using Pycharm if it helps, do I have to put the binance project folder as a subfolder of my main project's root folder? That's mainly what I'm wondering, so I can then
from binance.client import Client
In my project, or whatever.

/o/ user here, I'm interested in learning to code so I can make control modules for automotive systems.

what do? Learn Python and then C++?

Define "memorize" - if you can't explain what each Data Structure in the STL is suited for and what it is/how it works, you're shit out of luck.
The preferred area of knowledge would be knowing about shit like setting the std::vector allocation size, and what happens when you exceed it and the penalty for doing so.