5 ms·
> "what does `public static void main` mean?" The problem with this question is that there is a ton of stuff you need to understand before you can really answe
by fryguy 10y ago
> "what does `public static void main` mean?"
The problem with this question is that there is a ton of stuff you need to understand before you can really answer that question fully. To know what public means, you need to understand classes, and visibility rules for classes. To understand static fully, you kind of need to know how c++ works, since it's equivalent to a bare function in a namespace. Void is the type of the return, which means it doesn't have so that's pretty straight-forward. Main is the name of the function that gets run when you run the program, which kind of requires knowledge of program entry points (assembly) either that or the understanding of what a library is. The simplest thing you can say is that it's boilerplate to signify what function gets run when the program starts, but that doesn't really explain any of the pieces.
- Longhanks 10y agoThen why start teaching programming with Java in the first place when understanding those concepts involves an at least mediocre understanding of object orientation? There are many more languages that implement a "Hello, world!" with one line of code. If explaining "public static void main" is too hard, maybe one is using the wrong tool.
- ticviking 10y agoThis is an idea that many people resist. I think they mistakenly believe that programming languages are genuinely difficult to learn, and students must start on one that is marketable.
- ____nope 10y agoIt's hard to teach an introduction to programming without teaching a particular language. If you have to pick a particular language, it makes sense to choose something the student is likely to use in the future. This is not hard to understand.
- bakadana 10y agoI always assumed that's why Python was so popular in universities. It's OOP & it's low on syntax.
- tormeh 10y agoI don't really approve of this view. CS students are going to be programming in current-gen languages like Java, Python, C/C++ and JS in industry anyway (C is perhaps last-gen...). I think academia should lie a couple steps ahead and introduce students to stuff that will help them advance the industry. Next-gen and maybe experimental/academic languages and tools. Teaching students current industry languages/tools is good for the individual student but bad for the industry as a whole because it causes stagnation. Universities are big enough that they ought to be able to rise above this tragedy of the commons and do something for the greater good rather than think narrowly of the individual student.
- sn9 10y agoThat's silly. If you can reasonably claim to know how to program, the choice of language largely doesn't matter. Someone who knows how to program in [first language] should be able to pick up how to program in any language one is likely to encounter in an industry position. So the first language should be one that gives the student a firm foundation from which one can become that competent. I've personally seen excellent introductions to programming using C (CS50x), Python (Think Python, MIT 6.001), and Scheme (SICP).
- komali2 10y agoThat's a big part of many bootcamps' marketing model. Start in web dev, move on to other things.
- ____nope 10y agoMy point is that you likely learned programming by learning the basics of file I/O in C or Python or something similar. You didn't sit down and learn all about automata theory etc. first. You need the context of what C.S. is used for before these things make sense to you, so you start by learning a bit of programming. Since you must be definition have A first language, why not pick one that is most likely to be used?
- flukus 10y agoBecause it's stuff the will teach eventually and don't want to force students to learn a different syntax a few weeks in. I'm not sure if students can handle the syntax switch or not though. For me and probably many others having it go unexplained was like dangling carrot in front of me. I went home and read more about it.
- kLeeIsDead 10y agoBecause, College Board. I'm so glad I learned Lua before taking APCS, otherwise that class probably would have set me back 6 years.
- taneq 10y agoJava is a terrible first language. Python is even worse. They both require a good understanding of a ton of different topics to understand them as anything but magic incantations.
- jimbokun 10y ago"The problem with this question is that there is a ton of stuff you need to understand before you can really answer that question fully." Which is why Java is a terrible language for an introductory programming class.
- khedoros1 10y agoIt was the first object-oriented language that I learned, and some of my classmates' first language. It wasn't too bad to be told "Just type it for now; we'll get into object orientation next week and explain it then." From my own experience, I don't think it's a big issue if it's introduced correctly.
- ticviking 10y agoI suspect you are far more willing to learn by rote than some other students. For a particular kind of curious student, "just do it because you have to" is a very fast way to them checking out and doing nothing at all.
- khedoros1 10y agoI held onto the promise of a forthcoming explanation (and read ahead in the book, anyhow). Honestly, someone who can't deal with a little ambiguity when starting out on a new technology isn't going to last long in the field anyhow, especially with the amount of self-learning that you end up doing.
- mioelnir 10y agoAgreed, for a number of students the promise to explain it later will suffice. Others - when given magic boilerplate that does strange, intended things - will recognize it for the black magic it is and will want to wield it as well. They will dissect, examine and research it on their own and their learning will be much deeper.
- komali2 10y agoWell, that's me in a nutshell though. If I don't get the answers I need soon, I get frustrated and it becomes nearly impossible to stay focused or motivated. With web development, I was lucky in that I had teachers that were willing to humor my curiosity, and I could also hop on the internet and IRC channels. Self learning is the opposite of the classroom issues I had. I can start a webpack tutorial, it'll mention Make, and I can click links and chase down information, and just keep my stupidly ADHD brain entertained with more and more new new new things. This is how I have to learn things, apparently.