I made a hello world (while getting a bit lost) to the approximation of 5 hours. I consulted my vague and terrible programming skills that have barely been used for 5+ years. And started trying to add in extra magical-powers to my app. I started reading further into the reference (estimate 5 hours)
Eventually figuring I would work up the trees to the top; gain an understanding of what was up there and then route downwards to the specifics. I got to the top of the trees and realised I still did not have what I needed. (estimate 2 hours) So I went higher to here:
And discovered things; branching to the major links in the first paragraph. Now things are starting to make sense. (estimate 30minutes)
I am gradually getting faster at working out when to go upwards or sideways or ask for help. At 30 minutes on my current step I realised all I am doing is building myself a map of the map&territory kind. (class → object → process containing things)
Question: Does there exist a map of the what on earth am I looking at variety; so I have any idea what I am trying to understand? Searches for map yield objects of geographical mapping abilities. I want a meta:map of the language or its structure… Does one exist? Where?
Don’t read documentation. It is for people who already know the general outlines, not for people who want to know what programming is, or what object-oriented programming is. You need a textbook. There’s probably one specific to Android Apps, but it’s more important to get a good textbook than one that is precisely tailored to your goals.
I am powering through https://docs.oracle.com/javase/tutorial/java/TOC.html for now, then I should head back to documentation. I think this is about as good as a reasonably-good textbook in the area. I will consider a textbook if I don’t feel confident by the end of it.
As with most of my projects; time and focus is limited by my interest. So finding a textbook and then retrieving it will be difficult and probably take longer than my interest in the project allows.
I would recommend you don’t. You’ll give up soon enough and be left with a bad taste in your mouth about programming for a long time. That is not a good outcome.
You actually don’t need a textbook—you need a good intro to programming. Java documentation (shudder) is quite the opposite of that.
I should have clarified more—I am not a beginner programmer; I am (debatably) capable of procedural programming. Been spending the past few days wondering how I managed to go as far as understanding procedural programming and never go any further into OOP. Starting to question both my brain and the sanity of anyone who ever tried to teach me anything relevant to programming; and how we all missed that I was unclear about what OOP is.
I will spend no more than 3 more hours on this reading before trying an alternative like the other textbook suggested by Douglas_Knight; or restart with an intro to programming guide.
I am confused about your goals, then. So you have some experience programming in an imperative (procedural) language. You want to figure out the OOP paradigm? That’s a good idea, but what in the world are you doing in Java, then?
For figuring out how OOP works I’d actually recommend a more-or-less pure OOP language. Ruby is a good choice. If you have a very twisted mind (it’s LW, after all), there is an… unconventional but interesting guide to Ruby written by a person who goes by the name of Why The Lucky Stiff X-)
If you don’t want to do Ruby, Python is also fine. Smalltalk is cute, but… is of mostly academic interest by now. In any case I’d avoid Java if you’re trying to understand the OOP paradigm and how it’s different from imperative.
Original goal: make an android app that does something (specific and not particularly important right now).
My path: try to use android studio via developer.android training (as linked in the first comment). Get lost. Try to work out what was going on. Discover what OOP actually is. Read more and more. Roughly get to where I am now.
Important question: Is there are better/smarter/faster/easier way to be making an app? I figured android studio would be the most easy to use (where I was previously not sure how to get an app onto the phone) because its built to go with android devices.
Just make sure you don’t try going too meta too soon, otherwise you may lose touch with reality.
1) The “hello world” app you made—did you have anyone review your code? Maybe it contains obvious errors you didn’t notice. Maybe learning about them could be very beneficial in long term. Having an improvement shown in a program you already spent a lot of time thinking about could be better (more motivating, easier to remember) than reading about a similar technique in a book illustrated with a fictional example.
2) Every time you learn something new—do you also make another “hello world” app to test this new knowledge? Otherwise you may get a fake understanding. Also, if you learn about cool new techniques, but never use them, you may not understand the trade-offs. By making sample applications you test your new models against the reality.
I figured android studio would be the most easy to use (where I was previously not sure how to get an app onto the phone) because its built to go with android devices.
I agree.
Unless you want to make a game, in which case Unity is probably a better option. It is not Android-specific, but it can compile to Android platform.
EDIT: Feel free to ask me specific things about Java or Android.
it took hours to figure out how to correctly install Android Studio and get it to compile. Including completely starting again; installing extra packages and accepting that some errors will exist.
eventually most of the hello world app was a sample program; so I didn’t really write it; just worked out how each part went together and how the files were stored in the weird app-code-files folders.
I will be making test programs along the way hopefully. Thanks
Sorry, I haven’t played in the Android world so I’m useless there.
As a general piece of advice about an easier way of making an app—find an open-source app that does something in the same ballpark as what you want your app to do, understand how the relevant parts of it work, then modify them to make the app do your stuff.
I tried looking at a bit of github; but found I lacked fundamentals of OOP to make any sense of what I was looking at. I will see if my final construction is within my reach (after some more reading); if not—I will head back to the gits and fork someone else’s code.
If by “reasonably good” you mean at the 50th percentile of textbooks, sure, it’s fine. But textbooks that are actually good are rare. And they are valuable. It is worth your time to work through the book that I linked. It would be more valuable to do it before reading about java.
According to the table of contents I already understand up to around chapter 40 of 52 of that book. And I was aiming to learn Java because of its relevance to android studio.
which is coincidentally where I am reading through on the java trail right now
You want to learn about programming paradigms, and maybe also design patterns.
Programming paradigms are usually described as traits of programming languages, and sometimes lead to flame wars about which programming language is best. I recommend seeing programming paradigms as obligations you accept, and get some benefits in return. Some languages make those obligations mandatory, but sometimes you can decide to voluntary accept the obligation of some programming paradigm even in a language that doesn’t require it naturally. For example, even if you want to program in Java, I would recommend learning some functional languages just to see what advantages those languages offer and how do they achieve it, so that when you return to writing Java code, you will have an option to write it in a way that provides you some of those advantages.
For example: Even in Java you can decide to write functions that don’t use global variables. I mean functions that only use the values of their explicit input parameters, and only call other functions which follow the same rule. At first sight, this may seem like an pointless obligation, inconvenient in some situations. However, if you carefully write a part of program like this, you will not have to worry about multithreading: because those functions only use their explicit inputs, you can run them in multiple parallel threads, and there will be no bugs. (Which is not a small thing, because multithreading bugs are sometimes really annoying to find.) People who are not familiar with functional languages and frequently use global variables usually produce multithreaded code full of bugs, which in turn makes them afraid of multithreading. By understanding the trade-offs, you will be able to write code that works well in multithreaded applications, and you will not even have to think too much about it. You will just follow the rules.
The big picture in my opinion is this: You have an idea of a program you want to make. Let’s suppose your specification is unambiguous—if you would tell me, a human, what you want to do, I would be able to do exactly that program without giving you further question. Why can’t a sufficiently smart compiler do this? I mean, this would be the ultimate form of programming. It would still be a programmer’s duty to give an unambiguous description, but beyond that, anything you do, is merely compensating for imperfections of today’s programming languages. (Also, if your description is not unambiguous, a good compiler should tell you that.)
Think about it. Not just like “yeah, I also wish programming was easier”, but instead as someone who decided to create such perfect programming language; someone who is ready to do that hard job in the following decades. What problems would you have to solve? Let’s ignore parsing natural language; suppose there is a formal syntax and the programmers have to follow it. What you want to avoid is forcing programmers to write unnecessary code; the code that does not contribute to their goals, but is required to solve some technical problem imposed by your language.
For example, let’s suppose that you have a list of numbers, and you want to get a list of squares of these numbers. From {10, 20, 30} you want {100, 400, 900}. Compare the following solutions in pseudocode:
1)
a list of (X * X) for X in {10, 20, 30}
2)
a new empty list of integers called L
for each X in {10, 20, 30}:
... append X * X to L
3)
for brevity, {10, 20, 30} will be called Z
an integer called N, initially zero
a new list of integers called L, with the same size as Z
while N is smaller than size of Z:
... X is the N-th element of Z
... put X * X into N-th position of L
... increase N by one
The first approach is Python or Perl, the second one is Java, and the third one is C or Basic. All of the pseudocodes were written to accomplish the same goal, but what a difference there is in legibility! (JavaScript would be somewhere between the first and second one; it supports both styles.)
The first one says what needs to be done. The second one must first create an empty list, and then process the values in the existing list, because it lacks brief idioms for converting lists to lists. It’s actually worse than it seems: for example, in the second example, the items in the list must be processed sequentially. Imagine that instead of “X X” you would have a difficult function that takes a whole minute to compute. Luckily, you also have three processors available. The first program, hypothetically, could let each processor compute the function for one item (the calculations for individual items are independent), and then put the results together, so the whole computation would only take one minute. But the second program must process the items sequentially, otherwise the “append” commands could be executed in a wrong order. The third program specifies so much it is difficult to see what exactly was the intention* of the programmer—imagine reading thousands of lines like this.
So, if you want to make a perfect programming language, you should have good idioms for list processing (how about other data structures? which ones? could you devise a fully general approach?), and it would be nice if it could recognize where to use multithreading, so you don’t have to write it specifically. This is already rather difficult and we have only touched the surface.
Learning to program is easier if there is someone you can discuss things with in person. Is there a person or a group near where you are located that you could spend time with?
If not, there are places on the internet, such as Stack Overflow, to ask for programming help.
That would be my recommendation. Find a community. Or, a person.
Thanks for this suggestions; I have a number of brilliant programming friends. Its about time I upskilled my programming ability.
I am trying to very delicately ask help at the right times to various people without asking for too much from any one person.
One of the problems I am having is that a task that might take me 5 hours could be done by someone with the skills in under 30 minutes. If I were to achieve the creation (of the app) at the cost of all else; It would be fastest to ask one of my skilled friends to do it for me. But then I don’t gain any skills, and pretty soon my friends get sick of me asking favours.
I am not really sure what you are asking here, maybe a rewording could help. But let me add something else. I remember the huge holy wars on Reddit 10 years ago about various programming paradigms, object-oriented being one and functional the other and so on. While today OOP is incredibly popular and widespread, it has its own drawbacks. Detractors say it was mainly made for simulation and it is very easy to get lost in simulational, “what is what” type of problems like X is an subclass of Y or Z, what is the proper type for something or things like that, so these structural issue, instead of doing what programming is arguably about: writing algorithms to process data. Of course I don’t want to start those debates over, I just want to say OOP is generally as simulational paradigm. Or you could say OOP is a map. And sometimes simulational approaches are an overkill, and sometimes not the best idea. This was for example one anti-OOP article: http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
My programs are not very complicated, but it is suprising how far I can get with plain simple basic structural programming paradigm. This means basic types, basic data structures like arrays or hashes, and functions that process them. Adding a bit of a functional programming paradigm i.e. instead of looping over arrays, mapping a function or lambda function to them takes it even further.
My point is that one decision is to be done really early: am I more or less simulating something? Then OOP. Am I trying to massage some input data into a different form of output data? Probably structural with a bit of functional does it. If the language itself is OOP like Java, structural programming largely means using public static classes as functional libraries, not instantiating them, just calling their methods as functions. int four = Math.add(2,2) type of approach, that is what is generally called structural here, where the class is just a function library.
Short story followed by question.
I started looking at making an app. So I went to here:
http://developer.android.com/training/index.html
I made a hello world (while getting a bit lost) to the approximation of 5 hours. I consulted my vague and terrible programming skills that have barely been used for 5+ years. And started trying to add in extra magical-powers to my app. I started reading further into the reference (estimate 5 hours)
Eventually figuring I would work up the trees to the top; gain an understanding of what was up there and then route downwards to the specifics. I got to the top of the trees and realised I still did not have what I needed. (estimate 2 hours) So I went higher to here:
https://en.wikipedia.org/wiki/Object-oriented_programming
And discovered things; branching to the major links in the first paragraph. Now things are starting to make sense. (estimate 30minutes)
I am gradually getting faster at working out when to go upwards or sideways or ask for help. At 30 minutes on my current step I realised all I am doing is building myself a map of the map&territory kind. (class → object → process containing things)
Question: Does there exist a map of the what on earth am I looking at variety; so I have any idea what I am trying to understand? Searches for map yield objects of geographical mapping abilities. I want a meta:map of the language or its structure… Does one exist? Where?
Don’t read documentation. It is for people who already know the general outlines, not for people who want to know what programming is, or what object-oriented programming is. You need a textbook. There’s probably one specific to Android Apps, but it’s more important to get a good textbook than one that is precisely tailored to your goals.
I am powering through https://docs.oracle.com/javase/tutorial/java/TOC.html for now, then I should head back to documentation. I think this is about as good as a reasonably-good textbook in the area. I will consider a textbook if I don’t feel confident by the end of it.
As with most of my projects; time and focus is limited by my interest. So finding a textbook and then retrieving it will be difficult and probably take longer than my interest in the project allows.
I would recommend you don’t. You’ll give up soon enough and be left with a bad taste in your mouth about programming for a long time. That is not a good outcome.
You actually don’t need a textbook—you need a good intro to programming. Java documentation (shudder) is quite the opposite of that.
I should have clarified more—I am not a beginner programmer; I am (debatably) capable of procedural programming. Been spending the past few days wondering how I managed to go as far as understanding procedural programming and never go any further into OOP. Starting to question both my brain and the sanity of anyone who ever tried to teach me anything relevant to programming; and how we all missed that I was unclear about what OOP is.
I will spend no more than 3 more hours on this reading before trying an alternative like the other textbook suggested by Douglas_Knight; or restart with an intro to programming guide.
I am confused about your goals, then. So you have some experience programming in an imperative (procedural) language. You want to figure out the OOP paradigm? That’s a good idea, but what in the world are you doing in Java, then?
For figuring out how OOP works I’d actually recommend a more-or-less pure OOP language. Ruby is a good choice. If you have a very twisted mind (it’s LW, after all), there is an… unconventional but interesting guide to Ruby written by a person who goes by the name of Why The Lucky Stiff X-)
If you don’t want to do Ruby, Python is also fine. Smalltalk is cute, but… is of mostly academic interest by now. In any case I’d avoid Java if you’re trying to understand the OOP paradigm and how it’s different from imperative.
I too am confused about my goal.
Original goal: make an android app that does something (specific and not particularly important right now).
My path: try to use android studio via developer.android training (as linked in the first comment). Get lost. Try to work out what was going on. Discover what OOP actually is. Read more and more. Roughly get to where I am now.
Important question: Is there are better/smarter/faster/easier way to be making an app? I figured android studio would be the most easy to use (where I was previously not sure how to get an app onto the phone) because its built to go with android devices.
Just make sure you don’t try going too meta too soon, otherwise you may lose touch with reality.
1) The “hello world” app you made—did you have anyone review your code? Maybe it contains obvious errors you didn’t notice. Maybe learning about them could be very beneficial in long term. Having an improvement shown in a program you already spent a lot of time thinking about could be better (more motivating, easier to remember) than reading about a similar technique in a book illustrated with a fictional example.
2) Every time you learn something new—do you also make another “hello world” app to test this new knowledge? Otherwise you may get a fake understanding. Also, if you learn about cool new techniques, but never use them, you may not understand the trade-offs. By making sample applications you test your new models against the reality.
I agree.
Unless you want to make a game, in which case Unity is probably a better option. It is not Android-specific, but it can compile to Android platform.
EDIT: Feel free to ask me specific things about Java or Android.
Thanks!
it took hours to figure out how to correctly install Android Studio and get it to compile. Including completely starting again; installing extra packages and accepting that some errors will exist.
eventually most of the hello world app was a sample program; so I didn’t really write it; just worked out how each part went together and how the files were stored in the weird app-code-files folders.
I will be making test programs along the way hopefully. Thanks
Not a game; shouldn’t have to worry about it.
Will ask if I need. Thanks!
Sorry, I haven’t played in the Android world so I’m useless there.
As a general piece of advice about an easier way of making an app—find an open-source app that does something in the same ballpark as what you want your app to do, understand how the relevant parts of it work, then modify them to make the app do your stuff.
I tried looking at a bit of github; but found I lacked fundamentals of OOP to make any sense of what I was looking at. I will see if my final construction is within my reach (after some more reading); if not—I will head back to the gits and fork someone else’s code.
Also thanks for the help!
If by “reasonably good” you mean at the 50th percentile of textbooks, sure, it’s fine. But textbooks that are actually good are rare. And they are valuable. It is worth your time to work through the book that I linked. It would be more valuable to do it before reading about java.
By reasonably good I mean—good enough for now.
According to the table of contents I already understand up to around chapter 40 of 52 of that book. And I was aiming to learn Java because of its relevance to android studio.
which is coincidentally where I am reading through on the java trail right now
You want to learn about programming paradigms, and maybe also design patterns.
Programming paradigms are usually described as traits of programming languages, and sometimes lead to flame wars about which programming language is best. I recommend seeing programming paradigms as obligations you accept, and get some benefits in return. Some languages make those obligations mandatory, but sometimes you can decide to voluntary accept the obligation of some programming paradigm even in a language that doesn’t require it naturally. For example, even if you want to program in Java, I would recommend learning some functional languages just to see what advantages those languages offer and how do they achieve it, so that when you return to writing Java code, you will have an option to write it in a way that provides you some of those advantages.
For example: Even in Java you can decide to write functions that don’t use global variables. I mean functions that only use the values of their explicit input parameters, and only call other functions which follow the same rule. At first sight, this may seem like an pointless obligation, inconvenient in some situations. However, if you carefully write a part of program like this, you will not have to worry about multithreading: because those functions only use their explicit inputs, you can run them in multiple parallel threads, and there will be no bugs. (Which is not a small thing, because multithreading bugs are sometimes really annoying to find.) People who are not familiar with functional languages and frequently use global variables usually produce multithreaded code full of bugs, which in turn makes them afraid of multithreading. By understanding the trade-offs, you will be able to write code that works well in multithreaded applications, and you will not even have to think too much about it. You will just follow the rules.
The big picture in my opinion is this: You have an idea of a program you want to make. Let’s suppose your specification is unambiguous—if you would tell me, a human, what you want to do, I would be able to do exactly that program without giving you further question. Why can’t a sufficiently smart compiler do this? I mean, this would be the ultimate form of programming. It would still be a programmer’s duty to give an unambiguous description, but beyond that, anything you do, is merely compensating for imperfections of today’s programming languages. (Also, if your description is not unambiguous, a good compiler should tell you that.)
Think about it. Not just like “yeah, I also wish programming was easier”, but instead as someone who decided to create such perfect programming language; someone who is ready to do that hard job in the following decades. What problems would you have to solve? Let’s ignore parsing natural language; suppose there is a formal syntax and the programmers have to follow it. What you want to avoid is forcing programmers to write unnecessary code; the code that does not contribute to their goals, but is required to solve some technical problem imposed by your language.
For example, let’s suppose that you have a list of numbers, and you want to get a list of squares of these numbers. From {10, 20, 30} you want {100, 400, 900}. Compare the following solutions in pseudocode:
1)
2)
3)
The first approach is Python or Perl, the second one is Java, and the third one is C or Basic. All of the pseudocodes were written to accomplish the same goal, but what a difference there is in legibility! (JavaScript would be somewhere between the first and second one; it supports both styles.)
The first one says what needs to be done. The second one must first create an empty list, and then process the values in the existing list, because it lacks brief idioms for converting lists to lists. It’s actually worse than it seems: for example, in the second example, the items in the list must be processed sequentially. Imagine that instead of “X X” you would have a difficult function that takes a whole minute to compute. Luckily, you also have three processors available. The first program, hypothetically, could let each processor compute the function for one item (the calculations for individual items are independent), and then put the results together, so the whole computation would only take one minute. But the second program must process the items sequentially, otherwise the “append” commands could be executed in a wrong order. The third program specifies so much it is difficult to see what exactly was the intention* of the programmer—imagine reading thousands of lines like this.
So, if you want to make a perfect programming language, you should have good idioms for list processing (how about other data structures? which ones? could you devise a fully general approach?), and it would be nice if it could recognize where to use multithreading, so you don’t have to write it specifically. This is already rather difficult and we have only touched the surface.
Learning to program is easier if there is someone you can discuss things with in person. Is there a person or a group near where you are located that you could spend time with?
If not, there are places on the internet, such as Stack Overflow, to ask for programming help.
That would be my recommendation. Find a community. Or, a person.
Thanks for this suggestions; I have a number of brilliant programming friends. Its about time I upskilled my programming ability.
I am trying to very delicately ask help at the right times to various people without asking for too much from any one person.
One of the problems I am having is that a task that might take me 5 hours could be done by someone with the skills in under 30 minutes. If I were to achieve the creation (of the app) at the cost of all else; It would be fastest to ask one of my skilled friends to do it for me. But then I don’t gain any skills, and pretty soon my friends get sick of me asking favours.
I am not really sure what you are asking here, maybe a rewording could help. But let me add something else. I remember the huge holy wars on Reddit 10 years ago about various programming paradigms, object-oriented being one and functional the other and so on. While today OOP is incredibly popular and widespread, it has its own drawbacks. Detractors say it was mainly made for simulation and it is very easy to get lost in simulational, “what is what” type of problems like X is an subclass of Y or Z, what is the proper type for something or things like that, so these structural issue, instead of doing what programming is arguably about: writing algorithms to process data. Of course I don’t want to start those debates over, I just want to say OOP is generally as simulational paradigm. Or you could say OOP is a map. And sometimes simulational approaches are an overkill, and sometimes not the best idea. This was for example one anti-OOP article: http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html
My programs are not very complicated, but it is suprising how far I can get with plain simple basic structural programming paradigm. This means basic types, basic data structures like arrays or hashes, and functions that process them. Adding a bit of a functional programming paradigm i.e. instead of looping over arrays, mapping a function or lambda function to them takes it even further.
My point is that one decision is to be done really early: am I more or less simulating something? Then OOP. Am I trying to massage some input data into a different form of output data? Probably structural with a bit of functional does it. If the language itself is OOP like Java, structural programming largely means using public static classes as functional libraries, not instantiating them, just calling their methods as functions. int four = Math.add(2,2) type of approach, that is what is generally called structural here, where the class is just a function library.