geekhack

geekhack Community => Other Geeky Stuff => Topic started by: mizzoperator on Thu, 03 October 2019, 09:18:17

Title: The best way to get into scripting/programming?
Post by: mizzoperator on Thu, 03 October 2019, 09:18:17
Greetings, denizens of GeekHack!
I've had an interest in getting into scripting/programming for a while now, particularly in the interest of game development/just making dumb stuff for fun.
Unfortunately, I'm also an ADHD-riddled mess of a human being and not very bright to boot
What would be the best way to ease myself into this kind of thing? I'm currently researching Python due to its absurdly simple syntax, but I've been really stupid about the whole thing. Nothing can catch my attention and information doesn't stay in for long.  :mad:
So, yeah, uhm. That.
Additionally, this can also just be an amateur programming thread, if you want.

(move/delete this thread if it doesn't belong here idk)
Title: Re: The best way to get into scripting/programming?
Post by: Findecanor on Thu, 03 October 2019, 10:05:13
Do start with a book, or find one of the many tutorials on the web for learning Python.
When you have done the tutorial, then decide on a small project that you'd want to realise —  to force yourself to do something new that is not within the confines of the tutorial. If you get stuck, use the language/library reference or google for answers: because surely someone could have asked about the same thing on Stackoverflow or elsewhere.

Python is nice in the way that it has an interactive interpreter, in which you can test things out easily without having to go through the write file-compile-test cycle.
Title: Re: The best way to get into scripting/programming?
Post by: Steezus on Thu, 03 October 2019, 11:26:12
I've always found the hardest part about self-learning programming from a beginner level was just thinking of apps to create. The language to use really depends on the problem you are trying to solve. My university shares the belief that it is best for a beginner to start out learning C++ as it can be a bit more challenging. However, once you can understand C++ it makes it very easy to pick up any other mainstream language. As an example, when I was learning C#, I opted to do a personal project of creating a password storage application. I incorporated the use of Google 2FA for login authentication, worked on AES256 encryption for my saved data, and used a SQL DB to store my data. It was a fun little project for me to become acquainted with an unfamiliar language and brushed off the rust of working with encryption and databases. Now, something like that will be too big of a bite for a beginner to chew. The most iconic starting project is the typical "Hello World", after that, small projects like printing out Fibonacci numbers and string manipulation will help you get familiarized with the language. If you opt for self-learning then I find it very helpful to purchase yourself a book in the language you desire. Every programming book can be a bit dull as it is packed with information but it will always be a good resource to look at.
Title: Re: The best way to get into scripting/programming?
Post by: Sintpinty on Thu, 03 October 2019, 11:32:59
Greetings, denizens of GeekHack!
I've had an interest in getting into scripting/programming for a while now, particularly in the interest of game development/just making dumb stuff for fun.
Unfortunately, I'm also an ADHD-riddled mess of a human being and not very bright to boot
What would be the best way to ease myself into this kind of thing? I'm currently researching Python due to its absurdly simple syntax, but I've been really stupid about the whole thing. Nothing can catch my attention and information doesn't stay in for long.  :mad:
So, yeah, uhm. That.
Additionally, this can also just be an amateur programming thread, if you want.

(move/delete this thread if it doesn't belong here idk)

Allitebooks provided me a ton of resources .. literally dozens of free pdfs about programming. Basically everything you need!
Title: Re: The best way to get into scripting/programming?
Post by: rowdy on Sun, 06 October 2019, 21:30:12
It's always difficult to find something to write a program for when learning a new language, however things like coding problems, preparing for job interviews, daily challenges, things like that can help as they give you sometimes abstract problems to solve, but get you to practice basic programming techniques.

Some are aimed at a particular language (e.g. write a bubble sort in Java), but you can apply yourself in any language, just that the suggested answer will not be applicable if you are not using the programming language they expect.

Something like this to get started: https://dev.to/javinpaul/101-coding-problems-and-few-tips-to-crack-your-next-programming-interviews-402a
Title: Re: The best way to get into scripting/programming?
Post by: romevi on Sun, 06 October 2019, 21:46:27
Install Gentoo.
Title: Re: The best way to get into scripting/programming?
Post by: Findecanor on Mon, 07 October 2019, 05:11:50
To add: The best way to learn programming is by doing.
You could learn a programming language through and through, ... after a lot of work. but don't expect to ever learn everything in a language's standard library. Programming is always learning and doing new things, and very often about looking things up and applying them.
What you should learn relatively early however, once you have gone past the beginning steps: is how to write code that is readable. A professional programmers spends most of his time reading code, not writing it, and you don't want to make things hard for your future self.

Install Gentoo.
I agree. Gentoo (https://en.wikipedia.org/wiki/Gentoo_(file_manager)) is a pretty good two-pane file manager.
But I don't see how it would help you learn Python. It is written in C and has no Python scripting. ;)

I had contributed code and artwork to the first few versions ... twenty years ago. It is in Ubuntu's main distro, but not installed by default.
Title: Re: The best way to get into scripting/programming?
Post by: quadcube on Mon, 07 October 2019, 09:46:24
maybe you could start by automating mundane stuffs. for example, I learned how to use Wireshark to reverse engineer winkeyless USB communication to change RGB colours without the need of boot mapper. Wrote a python script to link the win keyless KB to HomeKit so that I don't have to turn off the RGB every night
Title: Re: The best way to get into scripting/programming?
Post by: Signature on Mon, 07 October 2019, 09:54:58
Personally I feel like im the most motivated to do something if I find a use for it in my life. Codeacademy, although great entry-site, feels like just doing pointless tasks not leading to anything.

My recommendation to start is with this course at Udemy: https://www.udemy.com/course/automate/ . Here you learn how to automate everyday tasks like web-scraping, automated emails etc. Everything is in Python (which you seemed to have started looking at) and Al (the course host) is really good at teaching!

If you aren't looking to spend money, codeacademy is a good alternative, also look into entry level coding languages as scratch just to get the feel :)
Title: Re: The best way to get into scripting/programming?
Post by: rowdy on Sat, 19 October 2019, 02:29:33
maybe you could start by automating mundane stuffs. for example, I learned how to use Wireshark to reverse engineer winkeyless USB communication to change RGB colours without the need of boot mapper. Wrote a python script to link the win keyless KB to HomeKit so that I don't have to turn off the RGB every night

This is a good idea.

I work in DevOps, a large part of that is automating stuff, and I've been doing that for years so it was a sort of natural move.

I use Python mostly for that - a very good built-in library, cross-platform, for automating most things you don't need super-fast performance.  Even if you just use Python to run a series of operating system commands - at least it is a start.
Title: Re: The best way to get into scripting/programming?
Post by: Deadboy on Wed, 23 October 2019, 14:48:06
If you have an Ipad, there is an app from Apple called Playgrounds.
You can learn SWIFT there really easilly, which could help if you wanna make phone apps one day.
BUT i'm pretty sure there are other courses as well for other languages.
Title: Re: The best way to get into scripting/programming?
Post by: yuppie on Wed, 23 October 2019, 15:42:38
Stick with Python for a while, it's a great first language to learn. Codecademy has so many free online courses that are really helpful: https://www.codecademy.com/learn/learn-python-3

Learn by doing, read books/articles/stack overflow to assist in what you're doing.

Learn about data types in Python: Dictionaries, Lists, Strings, Floats, Ints, etc.

Do some things you're interested in. Parse output of real APIs. If you're not interested, you'll ... well, lose interest! I have some amount of ADD/ADHD as well, and I find that focusing on things I'm interested in works well for me.

Any page on reddit.com can be seen in JSON format by appending .json to the end of the URL: reddit.com/r/mechmarket.json -- https://www.reddit.com/r/CustomKeyboards/comments/dg4hx6/rebuilt_my_mech27v2_with_a_pom_plate_today.json

Use the requests library (https://requests.kennethreitz.org/en/master/) to fetch these pages and then sort the output to get the Title and Author of the post.

Have fun!
Title: Re: The best way to get into scripting/programming?
Post by: Sintpinty on Wed, 23 October 2019, 19:01:12
I just read the C++ Programming Language book and it's way too complicated for my tiny brain/
Title: Re: The best way to get into scripting/programming?
Post by: Sintpinty on Fri, 06 December 2019, 11:13:47
The C Programming language is a great book, however it takes a while to understand. I have been reading a chapter every night and slowly beginning, but i'll stick to IT and solving problems for now.
Title: Re: The best way to get into scripting/programming?
Post by: Findecanor on Sat, 07 December 2019, 01:40:23
I just read the C++ Programming Language book and it's way too complicated for my tiny brain/
C++ is ridiculously complex. It has evolved from C over decades, and the idioms for how to write in the language has evolved over time as well, changing quite radically a couple of times.
Never expect to be able to learn everything there is about it. Everyone who uses it struggles.

If you want to learn it, you should first have a full grasp of C and then preferably know object-oriented programming in some other language.
Title: Re: The best way to get into scripting/programming?
Post by: yui on Sat, 07 December 2019, 02:00:23
I just read the C++ Programming Language book and it's way too complicated for my tiny brain/
C++ is ridiculously complex. It has evolved from C over decades, and the idioms for how to write in the language has evolved over time as well, changing quite radically a couple of times.
Never expect to be able to learn everything there is about it. Everyone who uses it struggles.

If you want to learn it, you should first have a full grasp of C and then preferably know object-oriented programming in some other language.

personally i went to a school were for the 1st month we only had a goal very vague directions, we had to code in C on linux (C being the daddy of most modern languages) and only had man(manual pages on linux), google, 1 video per day and each other for help we started by making a program that could write a char on the console and finished with one that replicated BC(Posix (unix-like aka linux, bsd, ect) terminal calculator that can use "infinite" numbers) and sokoban (japanese dos era game)
so what i am saying is if you want to start in C, C++, python, php (most C-like that are not visual-C C# or Objective-C) get yourself a linux box or vm as you will have all documentation and compiler free and ready to go and start with something incredibly basic, like displaying a char, then a string, then read one, modify it and display it back... until you are good enough to code very simple games and you will be on your way(and at the start try to replicate stuff that exist do not worry about being original).

there is also plenty of video tutorial on the web but a loads of them gives you a roasted chiken when you wanted to learn how to cook it (and that does not help to learn at all)
Title: Re: The best way to get into scripting/programming?
Post by: tp4tissue on Sat, 07 December 2019, 10:20:12

there is also plenty of video tutorial on the web but a loads of them gives you a roasted chiken when you wanted to learn how to cook it (and that does not help to learn at all)

Sigh... gone 100% Veggie, Tp4 really misses Costco Rotisserie Chicken, despite them mutant bird rumors and Super Bird Flu w/ 90% Kill rate.
Title: Re: The best way to get into scripting/programming?
Post by: yui on Sat, 07 December 2019, 16:34:46
well sorry for making you hungry
Title: Re: The best way to get into scripting/programming?
Post by: trashpanda on Sun, 16 February 2020, 19:27:44
Treehouse is a great, cheap resource for learning to code. $25 US a month, tons of languages (javascript, python, ruby, C#), and well-organized small courses in bit-sized video modules with coding challenges and projects. it's great for someone with ADHD, and I found they hit the perfect balance of interesting but beginner-friendly. Some of the teachers are a bit dorky but I definitely didn't feel left behind by anything, plus they have a robust community message board if you get stuck. 10/10 would recommend.
Title: Re: The best way to get into scripting/programming?
Post by: esko997 on Thu, 20 February 2020, 14:11:48
I cut my teeth in the programming world with Perl, which is an awesome and I think pretty accessible language that will let you do most things pretty well. With that said, it does kind of disadvantage you as a first language (along with other high level interpreted langs) because it abstracts a lot of important concepts and manages them behind the scenes, so if later on you want to do something lower level, you still end up learning all that stuff.

I'd recommend C as a good starting point, but for me it was really hard to get my head around without a Computer Science background.

Enter Rust, which is usually what I recommend now, as basically C, but it tells you what you're doing wrong at compile time.

In regards to how to /actually/ get started, I'll echo the sentiments of others: write programs. Put another way, just start doing it.

Start small by writing something like a command line calculator or even smaller, like a program that takes two numbers a user inputs and adds them, and build from there. I'd also say that (for me) one of the most important things that helped me learn and stick with programming as to solve actual problems.

Just doing theoretical work is great for learning but got boring quickly for me. I wrote a program to help me manage my finances and over the years it's grown into an insanely large thing that's super messy, but I use it all the time and writing and maintaining it has taught me a lot. (Currently working on porting it into Rust and open sourcing it).

Good luck, hope this helps! Programming is some of the most fun you can have on a computer these days (IMHO), and you get to flex your keyboards!
Title: Re: The best way to get into scripting/programming?
Post by: equalunique on Thu, 20 February 2020, 14:39:30
Get a keyboard with QMK firmware support, clone the QMK GitHub repository to a Linux or WSL machine, build the default keymap, and then flash your keyboard with it. Once that's done, create a copy of the keyboard's default keymap and tweak it with your own customizations. Build & flash. Upon completion of that, you will have officially programmed in C.
Title: Re: The best way to get into scripting/programming?
Post by: 1391401 on Sat, 28 March 2020, 22:15:06
I'm late to the show but I will try and answer OP's two questions:

(1) I'm interested in making games - check out Brackeys on youtube he literally has a series that walks you through the absolute basics of building games (https://www.youtube.com/user/Brackeys).  The academics in here will wholeheatedly disagree with this approach because it does not start you out writing sorting algorithms or whatever we did in college but in reality it's probably more relevant to anything you're going to want to do.

(2) I have ADHD and can't focus - I have the same problem and what helps me is only working on things I am truly passionate about.  I've worked on projects with people where it's very hard to focus because it's their idea and not really my passion.  Sometimes the problems that CS course work might have you do (like writing a sorting algorithm) may not be that interesting and may cause you to lose focus.  However if I am working on something I am very passionate about I don't lose focus.  It also helps to have a goal.  If you build a game try and 'chunk' it into small pieces and accomplish many small things over a short amount of time rather than viewing it all as one thing.
Title: Re: The best way to get into scripting/programming?
Post by: Sintpinty on Sun, 09 August 2020, 21:27:53
Now how to learn RBLXlua...
Title: Re: The best way to get into scripting/programming?
Post by: hvontres on Wed, 02 September 2020, 13:17:26
Probably the best way to get into programming/scripting is to find an itch you need to scratch and try to write something to help with that. That way you are more motivated than trying to follow made up examples in a course. And the nice thing about programing as compared to other pursuits like woodworking or machining is that if you mess up, just go back to the last working save. So don't be afraid to just mess around, the worst thing that can happen is you loose a few hours (or days....) and in the end you will have learned something.

And Stackoverflow is your friend :)
Title: Re: The best way to get into scripting/programming?
Post by: secretrudite on Mon, 07 September 2020, 07:52:28
I would say think of a problem you have, some use case for your code or script, that's how I got into it  :thumb:
Title: Re: The best way to get into scripting/programming?
Post by: Rerun on Wed, 14 October 2020, 11:14:13
Honestly just start. No point in just sitting around saying "I want to get into programming". Find a language that would be useful to your uses and find a decent tutorial. Normally the better ones are the interactive ones. I recommend any of Cole Stelle's courses on Udemy if you can afford it (they go on huge sales a lot so you can get it for 10 bucks) and just don't get too pissed off at the god damn syntax errors.
Title: Re: The best way to get into scripting/programming?
Post by: Learis on Mon, 19 October 2020, 18:51:36
You can learn web design with

https://www.freecodecamp.org/
Title: Re: The best way to get into scripting/programming?
Post by: Crabby on Wed, 21 October 2020, 20:32:33
If you want simple syntax then Pascal is a pretty cool option. I picked it up originally because it was a scripting language in a program I used years ago and never knew it was a full language until I wanted to actually pick up "real" programming.

It's a very type safe programming language and it's hard to get yourself into hours long debug sessions that'll make you want to tear your hair out like C can do to you. It's also incredibly powerful like C or C++ is allowing for low level programming.

But you do you, I realize Python is the flavor of the month beginner language at this point in time.