Programming Advice

Sort:
Christopher_Parsons

Hello everyone, I am new here. 

 

I was hoping that some of you could offer your insight. I am interested in learning to code, for a few reasons. One is to seriously change careers and the other is for personal fulfillment in my hobbies. I have even considered the idea of doing free lance work someday, but first things first. 

 

To let all of you understand what I know and better what I want to know, I will start off by stating that I fiddled around with a Texas Instruments computer as a kid. I learned some of it's basic functions like, go to, run, print, etc. I have also learned some things on CodeAcademy's website, using Python. I have never worked much with an IDE, interpreter or compiler. I am aware of concepts like source code and machine code, but don't know how to make use of them. 

 

I became frustrated on CodeAcademy when I realized I was going through the steps to program to create a tip calculator. One of my frustrations with learning that way is that it begins to feel like brute force memorization, without any practical application. I find necessity a better teacher than memorizing "useless" facts. 

 

All I took away from these experiences was that there is a set of words and symbols that have definitions and that they need to be put into a proper order, with the right punctuation, metaphorically speaking. I believe they call that syntax. 

 

I started learning the concept of things like variables or arrays. Where I struggled with this was understanding how these parts of the program would apply to what I ultimately would like to achieve. I find it difficult to picture where these parts would go into the lines of code or how all of the lines would be put into order. I get the impression, unlike writing a story, the order of the code isn't necessarily strictly relegated to one order. It is like in math, where 4x6 or 6x4 is basically the same thing. It ends up having the same value or function. 

 

I started doing some more research and I discovered that there are two types of languages, one imperative and the other declarative. I reached a state of confusion when realizing I had interest in a program both being able to describe what computation should be performed and how to compute it. 

 

I am really confused now as to what language or languages I should even try to learn or how I should try to learn them. 

 

I am not interested in sitting through classes or reading books that explain to me what I already know. I am looking to move forward, but I am not interested in trying to learn by brute force memorization. 

 

If it is helpful, I am interested in data analysis of chess related and mathematical nature and data storage and retrieval. 

 

Thanks for your time and sharing your thoughts

Christopher_Parsons
BallCrusher28 wrote:

There's a lot of text there,

welcome?
I can't see exactly what you want to code,
what is your simply put goal?
I took basic coding classes, A+, C++, basic Java, basic windows programming,
you really have to be a language whiz if you want to get gritty.
but now days, a lot of web design has been streamlined,
you can blunder your way through some decent embedding.


 

I considered trying to do that for some of my hobby projects, just tearing apart open source code and trying to build what I want, but that is only good enough for hobbies. 

 

I am interested in writing programs for machines in factories to communicate with each other, that are made by different manufacturers. That would be one way I could utilize my current job skills to a relevant programming job. I am an electrician. I would be willing to try other things though. I was hoping to either find something that is in demand that pays at least what I get and hopefully then some, just starting out. Anything to do with data analysis or data bases sounds not only interesting but it is related to my hobby interests as well.

 

As for my hobbies, I have some elaborate ideas, but I thought I would start off small. I thought maybe I could start off with a file parsing GUI and then work my way up to a GUI that can use chess engines for analysis and then do various things with the data. Who knows, maybe someday my own chess engine, but that would be completely an experiment and not even really a goal.

BronsteinPawn

My serious two cents:

 

When I was 12 or 13 I just played around in Netbeans (IDE) and googled stuff that I did not know how to do. I then applied that into my code. Basically I learned most of what I know with practical examples and giving it a use. I must add that I learned the real basics like object types, classes and fors, ifs, whiles, does etc... by reading books, but after that everything was learned on the internet.

 

Pick a language. I love Java and it is used everywhere. Then grab a book and learn the basics by reading it. Once you pickup the basics throw the book to the trash can and start coding. You will find bumps and problems, research them and find solutions for them, you have the whole internet to help you. Just don´t copy and paste code. Read the documentation and understand it. This way you learn what you need and keep moving forward. 

 

Since then I have coded on and off. If we add all my "I want to code spurs" I have probably been coding for a year or so. Now that I am getting closer to university, moving out, reproducing and working for the government for the rest of my life I have been coding more seriously. Right now I am working on a program that manages embedded databases and joined this group as I am getting into scraping and will scrape the heck out of chess.com LOL.

Christopher_Parsons
BronsteinPawn wrote:

My serious two cents:

 

When I was 12 or 13 I just played around in Netbeans (IDE) and googled stuff that I did not know how to do. I then applied that into my code. Basically I learned most of what I know with practical examples and giving it a use. I must add that I learned the real basics like object types, classes and fors, ifs, whiles, does etc... by reading books, but after that everything was learned on the internet.

 

Pick a language. I love Java and it is used everywhere. Then grab a book and learn the basics by reading it. Once you pickup the basics throw the book to the trash can and start coding. You will find bumps and problems, research them and find solutions for them, you have the whole internet to help you. Just don´t copy and paste code. Read the documentation and understand it. This way you learn what you need and keep moving forward. 

 

Since then I have coded on and off. If we add all my "I want to code spurs" I have probably been coding for a year or so. Now that I am getting closer to university, moving out, reproducing and working for the government for the rest of my life I have been coding more seriously. Right now I am working on a program that manages embedded databases and joined this group as I am getting into scraping and will scrape the heck out of chess.com LOL.

Thanks for your reply. I too am very interested in Java, SQL and I also considered PHP and HTML for embedding and making my creations accessible from the web, for I what I might try later. I was also considering data mining with R, as it works with Sequel and Java too. Thanks for the tip about NetBeans. I had read it was really good. For now, I was considering just using Microsoft Sudio 2017 (free version). I have a cousin who is in school for IT management and is taking ( completed some already too ) some programming courses. He is telling me he can get me set up on Access for free and has some programming books that are from his university. I am always on the look out for good ideas from programmers who are into chess and mathematics too.

BronsteinPawn

All IDEs are good and kind of the same. My dad uses Netbeans so naturally I also used Netbeans when I first learned. Just learn the basics of what you want to use and start coding. It will be horrible at the beginning but very rewarding. I still remember the confusion on my first day of learning Java lol.

gkilmain

Python is a fine language and is very approachable. My suggestion would be to go back to code academy and finish the class. You've mentioned a lot of languages in your post. Focus. Focus on Python. You can do your data analysis in Python, build your web apps in Python, you can build anything with it. Lesson #13 in that Python class is the final project. Finish the class and build your final project.   

 

I taught myself how to program while working full time and believe me I had a lot of frustrating nights. 

skelos

Second the motion for Python. There will be things you'll need to add in other programming languages, but it's a sensible, well known, free and cross-platorm (Windows, OS X, Linux/Unix) language.

I saw mention of Access in there, and presume MS Access. To be avoided. MySQL or PostreSQL (both free, and I think MySQL runs on Windows now) are both free and "proper" relational database management systems. I know which one I prefer, but MySQL has mindshare especially for web projects.

Second to last, IDEs (Integrated Development Environments): you love 'em or you hate 'em.

Last, even if your goal is (not that you said it was) to learn C++, you would do so more efficiently by learning something else first. It is the worst possible "first language" I can think of due to its size and complexity. (Those aren't its advantages ever. It does have some, but that's not relevant here.)

 

For the work I'm doing accessing api.chess.com I am using Perl. I've not tried to use Python but it should also be perfectly workable. Indeed, as the speed limitation on fetching data from api.chess.com appears to be network latency (my ISP has got very flakey) a scripting language such as Perl or Python would be my first choice, and my absolute first choice if my goal was to put data from api.chess.com into a database for later manipulation and reporting.

Christopher_Parsons

I kicked around the idea of Python and was told it can be slow when it comes to working with chess engines ?

skelos

A chess engine implemented in Python would be slow, yes. There is a reason asmfish exists. For anything interacting with a chess engine, the engine computation time will outweigh everything else, for any reasonable definition of "anything" I can think of offhand.

Python has at least one module available that claims to speak the UCI protocol:

https://github.com/niklasf/python-chess/blob/master/docs/uci.rst

Again, not tested by me, but I have read the UCI "specification".

skelos
skelos wrote:

A chess engine implemented in Python would be slow, yes. There is a reason asmfish exists. For anything interacting with a chess engine, the engine computation time will outweigh everything else, for any reasonable definition of "everything" I can think of offhand.

Python has at least one module available that claims to speak the UCI protocol:

https://github.com/niklasf/python-chess/blob/master/docs/uci.rst

Again, not tested by me, but I have read the UCI "specification".

 

gkilmain
Christopher_Parsons wrote:

I kicked around the idea of Python and was told it can be slow when it comes to working with chess engines ?

 

Who told you that?

Christopher_Parsons
gkilmain wrote:
Christopher_Parsons wrote:

I kicked around the idea of Python and was told it can be slow when it comes to working with chess engines ?

 

Who told you that?

If I remember right, I read that several interested chess engine developers held that opinion of Python. I had a few others state that it was a real art to stream line the code for an engine written in Python. For that reason, I was thinking that Python may not be the best choice for trying to make a GUI either. Considering someday I wouldn't mind having something elaborate that does many calculations, aside from the engine analysis itself, it seemed like the right choice.

skelos

Many projects use multiple languages. Python would not be my first choice to implement an engine. It might well be for a GUI.

You, however, have two challenges:

1. Learning to program

2. Developing whatever it is you are wanting.

 

#1 will be easier if it is progress on #2, but you probably want to consider your first effort to be a prototype anyway. Like a first draft of a piece of writing.

Using a language where a lot of the details of memory management and the like are looked after for you is going to be a lot easier and thus a lot more efficient for you to begin. That doesn't mean you won't learn other languages later, but it is why many large scale commercial projects use more than one language; some things are performance critical, others are not and so cost of development influences the decision.

Python and perl do some of the things they do so well that they are hard to beat in "lower level" languages like C or C++. A lot of text processing in Perl I'd struggle to make much faster in C. Usually, too, desktop/notebook PCs are idle, so absolute efficiency is not required. Javascript in browsers isn't a fast language as such things go, but it's good enough for Stockfish.js (what chess.com's V3 in-browser computer analysis uses) to exist.

Kimgss
Christopher_Parsons wrote:

I started doing some more research and I discovered that there are two types of languages, one imperative and the other declarative. I reached a state of confusion when realizing I had interest in a program both being able to describe what computation should be performed and how to compute it. 

 

I am really confused now as to what language or languages I should even try to learn or how I should try to learn them. 

 

Dear Christopher,

First things first. Don't sweat the small stuff like what language should I learn. Though I would highly recommend for you to start with a structured (imperative) programming language. Declarative languages require a far greater deal of abstract thinking by your part as you're writing more in the way a machine would like to understand, while structured programming is a lot more like writing a set of instructions for a human, you then let the compiler worry about making your computer understand what you meant. Those compilers are pretty good at that, LOL.

 

As for not liking the way websites like CodeAcademy function, there is only one solution to the problem I can think of. Think up a small (SMALL) project for you to create, something like I wanna make a program that performs all the basic functions of a calculator or I wanna write a program that randomly generates a number and makes me guess it (telling the user if it's lower or higher as an example).

Do not go for something far too large as it's your first project. Too small and you feel like it's under your abilities, too big and you'll most definitely get frustrated and give up before it's finished.

Python is indeed a fine starter language. If you're worried about performance, I would recommend you learn a similar language, C#, which is a Microsoft-created language very similar in performance and syntax to Python and after you know C#, it's really extremely simple to jump to a lower-level language like C or C++ where you have a greater deal of control over the machine the code is running under, so you can make it faster (i.e. C# handles all your memory for you whereas in C you have to handle that part on your own, which would make it faster).

skelos

I spoke up in favour of Python, but I've heard of very good things (and seen a few) produced in C#. It's Windows only, which isn't my cup of tea, but if that doesn't bother you definitely consider it. Closer to Java probably than anything else mentioned, but if Windows is your platform the environment and tools will be similar for C# and other MS language products.

Me, I'm still a Perl and C fan, with SQL when it's useful, but I have 30 years of experience with Perl and C which helps a bit with their oddities. (Not that Python doesn't have a couple of oddities, but I adjusted a Python script today and came away undamaged. happy.png)

Christopher_Parsons
Kimgss wrote:
Christopher_Parsons wrote:

I started doing some more research and I discovered that there are two types of languages, one imperative and the other declarative. I reached a state of confusion when realizing I had interest in a program both being able to describe what computation should be performed and how to compute it. 

 

I am really confused now as to what language or languages I should even try to learn or how I should try to learn them. 

 

Dear Christopher,

First things first. Don't sweat the small stuff like what language should I learn. Though I would highly recommend for you to start with a structured (imperative) programming language. Declarative languages require a far greater deal of abstract thinking by your part as you're writing more in the way a machine would like to understand, while structured programming is a lot more like writing a set of instructions for a human, you then let the compiler worry about making your computer understand what you meant. Those compilers are pretty good at that, LOL.

 

As for not liking the way websites like CodeAcademy function, there is only one solution to the problem I can think of. Think up a small (SMALL) project for you to create, something like I wanna make a program that performs all the basic functions of a calculator or I wanna write a program that randomly generates a number and makes me guess it (telling the user if it's lower or higher as an example).

Do not go for something far too large as it's your first project. Too small and you feel like it's under your abilities, too big and you'll most definitely get frustrated and give up before it's finished.

Python is indeed a fine starter language. If you're worried about performance, I would recommend you learn a similar language, C#, which is a Microsoft-created language very similar in performance and syntax to Python and after you know C#, it's really extremely simple to jump to a lower-level language like C or C++ where you have a greater deal of control over the machine the code is running under, so you can make it faster (i.e. C# handles all your memory for you whereas in C you have to handle that part on your own, which would make it faster).

Thanks for your post. I find it rather informative. While on one hand I am aware of the fact that some languages are similar and that some programs utilize multiple languages, I also find not knowing for sure where to start, a major road block. This is part of the reason I was trying to cut to the chase in figuring out what language was most universal, or the best one to learn to start, so that the others are more easily understood.

 

 

There is also an idea in my mind that I could possibly find resources that tell me the definitions of the words and symbols and that I could possibly use them like reference materials and let the IDE help me with syntax. Having said that, it still leaves me with needing to understand the way that arrays, variables, etcetera, are structured. I would just rather have the reference materials in place before I start and not start regretting my choice of language, because I didn't research it ahead of time. 

 

The information regarding the imperative and declarative languages, was exactly what I want to know. I can use the imperative language to learn with at first, tackling the more simple tasks. I am rather certain that I am going to need the declarative language for what I would eventually like to accomplish. I am thinking I will also need to learn how to write algorithms. Do you have any advice for that in particular? 

Kimgss

To learn to program, one must program.

This is very much a learn by doing task. You can't possibly study all the theory and never put it to practice thinking that will be enough.

Program every day, look up interesting problems (https://projecteuler.net/). This website has a variety of mathematical-related problems for you to solve. The further down you go, however, it becomes ever more about understanding increasingly more complex mathematical problems than having a strong programmatic understanding. All of them are about creating algorithms to solve the problems at hand.

Universal languages: C, C++, C# (windows-only), Java, Python, JavaScript (web-oriented)

If you want something that runs on both Linux and Windows, I'd recommend Python or Java as they're extremely beginner-friendly. Otherwise if running only on Windows is fine I'd say go for C# mainly because it's so similar to C and C++, which are a little harder for beginners, in my opinion, but with a basis on C# will feel like you hardly have to learn anything at all.

Either of those languages will allow you to master the principles of object-oriented programming (by far the most used type of programming all around) and give you a nice footing to learn all other languages (it's a lot easier to learn other programming languages once you already have a couple under your belt).

skelos

Look for introductory algorithm texts as required for computer science at your local university. Pick one that matches the language you choose.

Expect all of them except Donald Knuth's books (which are too advanced, and for which he uses his own made-up very low level language) to be full of bugs.

Before the dot.com crash and simultaneous crash in technical book publishing, there was much more money to be made programming than writing about it. Post the crash, there's still no money in publishing.

One reason for recommending Python is that the materials that are available freely via python.org are of decently high standard.

For perl, most anything by O'Reilly and Associates.

For C, the time has passed.

For C++, nothing written by anyone but Bjarne Stroustrup but while he's a genius his language is both amazing and a commercial disaster that set the industry back a couple of decades, and without substantial background (like a good CS degree, if they still exist) you'll struggle with anything he's written. It's all well written, but I had to read everything he wrote three times to understand it, as I'm not a genius.

Other languages ... you're on your own.

Nobody has yet mentioned Ruby, so I might as well. Don't see the point when Perl and Python exist, but some people like it.

Learning a declarative language is hard work after learning an imperative one. Other than SQL (and it's only sorta-kinda-not-really declarative) I'm not aware of any in widespread use. I learned Prolog at university, but commercial implementations then numbered one (1) and as best I know now zero (0).

Interesting, but not very practical.

Kimgss
skelos wrote:

Learning a declarative language is hard work after learning an imperative one. Other than SQL (and it's only sorta-kinda-not-really declarative) I'm not aware of any in widespread use. I learned Prolog at university, but commercial implementations then numbered one (1) and as best I know now zero (0).

Interesting, but not very practical.

I would say learning a declarative language is hard work either way.
I do struggle a lot with them, I hate having to write/read complex SQL queries.
There is ABAP for SAP happy.png

skelos

In case you haven't yet guessed, the language wars are the only things people fight more vigorously than the editor wars: emacs or vi?

Emacs, of course!