What did you learn today in programming?

Discussion in 'Programming' started by KingTux, Feb 9, 2018.

  1. What did you learn today in the world of programming?
    From commonly found libraries and practices to things you made up to get the job done.
     
    #1 KingTux, Feb 9, 2018
    Last edited: Feb 9, 2018
  2. I learned that you can get a value from a HashMap with a nonexistent specified key and it won't throw an NPE.
     
    • Informative Informative x 1
  3. Well, I started learning C++ today. Not sure if that counts.
     
  4. '5' - 3 = 2
    '5' + 3 = 53
    Yeah, that's some quick mafs from JS :rolleyes:
     
    • Funny Funny x 1
  5. I learned that I shouldn't have put off learning Spring. Like WTF I thought Node Express made it easy but Spring is on a whole new level!

    EDIT: What I actually learned today was the Elvis operator for Kotlin. Kotlin > Java. Don't wait. learn it ASAP
     
    • Agree Agree x 1
  6. I try learn Python xD
     
    • Like Like x 1
  7. I learned nothing. Studying dependency injection though :p
     
  8. I started coding in C++ for GTA V, I have made an injected mod menu and also made a callout plugin for LSPDFR for GTA V
     
  9. Cramming for an alpha-beta pruning quiz.
     
  10. Tried to figure out Kali Linux but failed miserably, dunno if that counts as programming though xD
     
  11. I had to spend some time debugging an old shell script to make sure everything was the way we wanted the parsing to be. One issue was the type not always being correct, when input was empty .. so did some debugging.
    Code (Text):
    # is_number <input>
    is_number() {
       [ "$#" -eq 1 ]    || return 1  # is blank?
       [ x"$1" == 'x0' ] && return 0  # is zero?
       local -i tst
       let tst=$1 2>/dev/null         # else is numeric!
       return $?
    }
     
  12. ur kinda late noob
    but welcome to the klub (kotlin club xdzdDXZxzdd)
     
    • Funny Funny x 1
  13. I started learning machine code :rolleyes:
     
  14. scoping in python is ugly...
     
  15. let it sink in for a while
    Code (Text):

    def my_function(a):
       b = a - 2
       return b

    c = 3

    if c > 2:
       d = my_function(5)
       print(d)
    "let's make c=1"
     
    • Funny Funny x 1
  16. i learnt how powerful macros in crystal are:
    Code (crystal):
    # The macro expands into a save and raise of the instance type.
    # If the item is nil on the instance, it will raise an error.
    macro ensure_items(*names)
       {% for name in names %}
         {{name}} = @{{name}}
         raise {% name + " has not been set with data" %} if {{name}}.nil?
       {% end %}
    end
    # Now usable:
    ensure_items one, two, three
    # generating the following on compile-time:
    one = @one
    raise "one has not been set with data" if one.nil?
    two = @two
    raise "two has not been set with data" if two.nil?
    three = @three
    raise "three has not been set with data" if three.nil?
     
  17. started on Codeacedemy,
    HTML: 100%
    CSS: 33%
    JAVA: 75%
    would that count? :p
     
  18. <h1>Yes</h1>
    h1{
    color: blue;
    }
     
    • Like Like x 2
    • Optimistic Optimistic x 1
  19. object identiy in python is ugly...

    Code (Text):

    a = "abde44545ce238ab9d797cebfd85c7e5"
    b = "abde44545ce238ab9d797cebfd85c7e5"
    a is b
     

    Code (Text):

    a = "abde4454-5ce2-38ab-9d79-7cebfd85c7e5"
    b = "abde4454-5ce2-38ab-9d79-7cebfd85c7e5"
    a is b
     
     

Share This Page