Programming (explanations for the non-programmers, mostly)

Discussion in 'General Chatter' started by seebs, May 3, 2015.

  1. Starcrossedsky

    Starcrossedsky Burn and Refine

    That is what I assumed (underline); it was the a = b part that fucked me up, because you already defined a and b as things that are Obviously Not Equal, and so ERRRRRRRT: LOGIC FAIL: DOES NOT COMPREHEND. There was no indication that it was supposed to function as a Process, rather than Static Numbers.

    So rather than functioning like a Programmer I guess I functioned Like a Computer.

    #beep boop #I am the robot it's me #please imagine the errt as a sound effect #like an alarm that tries to sound but instead grinds to a halt because the system shuts down #that's me
     
  2. ADigitalMagician

    ADigitalMagician The Ranty Tranny

    Hey, I started learning with Python in which EVERY variable is a pointer by reference (And a lot of other things besides) and it took me a week or two to figure out the concepts of * and & in go, but once you grok what they each mean, it made me better at my preferred language (Python). I think explicit pointers when learning the basics of programming is actually a stumbling block. Once you know how to put a program together, you can stumble through referencing and pointers without worrying about the rest of the things you need to know.
     
  3. Codeless

    Codeless Cheshire Cat

    ^I guess so do I? i didn´t go into it blind, but i would guesstimate it would generate the error message "WTF is int?" or UNDEFINED TERM* and then also Logic Fail.

    *Like seriously, is int an action, a category or what?

    Edit: Anectdata: After reading seebs explanation, said explanation makes perfect sense to me, but I´d never have guessed it by myself.
     
    Last edited: May 4, 2015
  4. seebs

    seebs Benevolent Dictator

    Yeah, that's sorta the first sticking point; programs are (at least in most languages) a series of instructions to follow.
     
  5. ADigitalMagician

    ADigitalMagician The Ranty Tranny

    So, I actually did a paper on electronic discovery in school. (MIS, so I had to know about business law.) While, yes, you're right, you'd make a hell of a lot if you were an expert, intelligent discovery is actually REALLY COMPLICATED AI problem. How do you know what is, and isn't relevant? My report more or less pointed out that the number of documents that get missed in a traditional e-discovery is staggering, and I think the sources I used cited at least half a dozen high profile cases that information came out AFTER a case that was simply missed by the e-discovery.

    (This may be outside the point of this thread. Pixels, we really need to swap emails or something.)
     
    • Like x 1
  6. seebs

    seebs Benevolent Dictator

    Google (or at least G+) did finally drop the real name thing basically-completely, or at least, assert that it is no longer a thing. Still been a source of some difficulty, but I understand they've mostly turned off the dumbass enforcement of a policy that was never really sanely enforced to begin with.

    And honestly, I think the "real name" thing was why G+ never took off or got taken seriously; while lots of people have no objections to using their "legal name" or whatever, enough do that almost everyone knows someone who is affected. And that means that they probably won't use the service, and that means that their friends won't either, and so on.
     
    • Like x 1
  7. Morven

    Morven In darkness be the sound and light

    But you were making logical interpretations of what it meant, which is a good sign. And there are languages in which your ruleset would have been right; in Haskell, for instance, there are no writeable values in ordinary statements like that, and attempting to assign a value twice would be indeed an error.
     
  8. ADigitalMagician

    ADigitalMagician The Ranty Tranny

    Here I go again plugging my chosen language:

    I'm a server dev with a preference for Python. I put people through Learn Python the Hard Way (learncodethehardway.org), then inventing games with python and pygame if they like gaming, else I point them at doing projects.

    Fastest way to learn Python.

    (LCTHW also has Ruby.)
     
  9. Morven

    Morven In darkness be the sound and light

    Yeah. I personally know of at least 2 or 3 Google employees who quit over it. Granted they were probably pissed off already, but definitely.
     
  10. Starcrossedsky

    Starcrossedsky Burn and Refine

    This is the shorthand of why I set almost all such name fields to the realistic-sounding-enough-to-fool-bots "Nai Starsky."

    This makes me feel better.
     
  11. Mala

    Mala Well-Known Member

    The problem's seeing if you understand assignment. In Java "=" is used for assigning values. "==" would check for "is equal to" and return true or false.

    @littlemissCodeless int (integer) is what's called a primitive data type (or primitive for short). Some other primitives are char (character) such as "a" "b" "." " " ect, and boolean which is the true/false I mentioned above. To translate this bit of code

    int a = 10; There's an integer we are calling "a". It equals 10.
    int b = 20; There's an integer we are calling "b". It equals 20.
    a = b; The value of a is now equal to the value of b. The value of b is 20 so a is now equal to b

    Note that since we told the computer that a is an integer, you can't tell it that a = true or b = 3.5 because true and 3.5 are not integers.
     
  12. Starcrossedsky

    Starcrossedsky Burn and Refine

    Which is something that requires that you know that in at least a basic sense. Standard usage is one = is equals.

    Anyone who isn't familiar with the programmer usage would just stare at the logic error and cry inside, and that's not a fair judgement of their ability to logic out the problem when they don't have all the information required to solve it.
     
    • Like x 4
  13. Lissiel

    Lissiel Dreaming dead

    Would you have to, previous to this bit of code, have to have told the computer there was an integer called 'a'? Or can you just start by assigning it?

    Edit so as not to spam the thread: and in that article, what did they mean that programming statements are meaningless? Defining 'a' as 20 sounds like a meaningful statement to me...?
     
    Last edited: May 4, 2015
  14. Codeless

    Codeless Cheshire Cat

    Ok for the first one, I just have to nitpick that everywhere else, = means equals, so if nobody tells us otherwise, how should we know?

    As for the rest, so I understand precisely nothing of what you just said, and in the interest for furthering science shall list my questions here. You are not required to answer if you don´t feel like it.

    1) What is a primitive data type? Are there refined data types? Civilized data types? I get a basic idea of why a, b, or char, might be defined like that, (But why not just call those data?) but:

    2) Boolean? Err what? Whazzat? Aside from named after the scientist Boole.

    3) true and false are in my mind categories. Why in the world are they primitive data types?

    return to 1) Dafuq is a primtive data type? I cannot form any coherent category for this term.
     
    Last edited: May 4, 2015
  15. Morven

    Morven In darkness be the sound and light

    @Lissiel: No, because this is a declaration plus initial assignment in one step. However, there are languages out there that require two steps.

    I do think that test would be easier on non-programmers if it didn't use overloading a new meaning on '='; a fairer test would use another symbol without such a well-known existing meaning.
     
  16. ADigitalMagician

    ADigitalMagician The Ranty Tranny

    It depends on the language!

    In Python (And other dynamically typed languages), you can usually assign immediately at declaration.

    In Go, though, there are two ways to declare a variable:

    Anywhere you can:
    Code:
    var name type
    This created a variable called name of type type.

    Or, inside a function:
    Code:
    name := function_that_returns_a_type()
    The colon-equals basically tells the program to make variable name the type of whatever you passed it. You can use struct literals here.
     
  17. Codeless

    Codeless Cheshire Cat

    Addition: Oh ok, All the terms @Mentarnes used are variables*. Why in the world are they not just called that?

    *except maybe boolena, still not idea what that is.
     
  18. Morven

    Morven In darkness be the sound and light

    "Primitive" means "simple" in this context. A primitive is a data type that contains just one value and is not composed of simpler data types (at the language level; at the physical computer level, it's all numbers and voltages).

    True and false are not data types. They are values. A data type that can contain values of 'True' or 'False' is a Boolean, named after Boole and his invention of Boolean algebra (basically, the math of logic statements).
     
  19. ADigitalMagician

    ADigitalMagician The Ranty Tranny

    1) Primitive datatypes are usually low level data types and can usually be counted on one hand in any given language.

    The built in Int, built in Float, some languages strings, most languages arrays/lists, and a few languages maps/disctionaries are considered primitives.

    In my game programing, drawing shapes directly to the screen is considered a "primitive".

    2) Boolean == True or False. (And in a lot of implementations are also equivalent to 1 or 0.)

    3) Because the idea of a boolean is a switch with two states.
     
  20. Mala

    Mala Well-Known Member

    Yeah that's a question I would've expected on my first Java test not as a prequisite to the class.

    @Lissiel That's what you did with the "int a". "int a;" by itself would be a complete line of code that just says "there is an integer called a that exists" without assigning a value (by default, Java would assign 0)

    @littlemissCodeless Data types are essentially categories of things. To borrow an example from seebs female is a gender but pizza is not. The rules for interacting with female are different than the ones for pizza. There's types other than primitive and more technical explanations but this is about as far as I understand.

    Boolean is a data type aka category that includes only "true" and "false"
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice