« first day (1586 days earlier)      last day (3363 days later) » 

5:00 PM
You're the best!
 
What does it take to get a RO around here?
 
I don't know.
 
You can't hate Java
 
Ask @Michael, they're the head.
 
;P
 
5:00 PM
@Gemtastic Good point.
To be fair, and I've said it a couple times, it's not Java that I inherently hate.
 
Actually, people who own PHP hates PHP. :p
 
Feel free to make your own "Java sucks" room ;P
 
there's already one
 
I have my problems with the language, just like any other language
 
/closed as duplicate
 
5:01 PM
:P
 
What I seriously dislike about Java is the whole architecture.
 
I can't argue with that.
 
Everything feels heavy and outdated. Everything feels too enterprisy and huge. Programming with XML is for some reason something everyone like
It feels that way, doesn't necessarily mean it is like that.
Entire project documentations are written as comments on just the methods
With crappy generation programs to generate semi-readable HTML pages with design from the '80s
All of these give Java a really heavy and slow feel
 
Well, we know that
 
That is why I rage on Java.
Not the language itself. Java is a solid predictable language, with use cases of its own
 
5:04 PM
Well, raging on it here isn't gonna change anything but our moods
 
@Gemtastic RUMBLE RUMBLE CHANGE THE LANGUAGE!!
 
:P
 
You're right. Allow me to curl up into a ball and cry into a corner. Then I'll use C#. Is that what you want? :p
 
@Gemtastic vOv, if I got even one of you to open up to the idea of adopting a different ecosystem, that's a win for me.
 
5:05 PM

Java Sucks!

JavaScript Sucks!
 
I wish someone could move all the java hate there XD
 
one-boxed for (short-lived) prosterity
 
@Unihedro Yes.
 
@Unihedro But they write JavaScript O.o
 
There are two kinds of programming languages: Those that are wrong, and C#.
@Gemtastic JavaScript SucksScript :p
 
5:06 PM
vOv
 
People who are bad at programming are bad because they don't C#? ;P
 
yes :l
 
CScript
 
I've long since reached the conclusion that confidence in your code doesn't come from features like type safety or checked exceptions
 
@DonLarynx NO Please don't go there
 
5:08 PM
@Unihedro that was a brilliant explanation! i just wrote that down to read it off to my friend.. well explained!
 
If you develop sanely, you can achieve great confidence in your code regardless of the language you write.
@somefolk Better yet, bring him here next time :D
I'm surprised @fge hadn't engaged me yet.
 
@somefolk cheers
I do code golf and trash code research, which is why I explain that stuff well
Oh, and if you liked understanding code, check out [shameless promotion] this area51 proposal in commitment!
 
@SecondRikudo I've deduced that confidence in your code comes from self inflation and lack of self criticism
 
@Gemtastic False.
Confidence in your code comes from a solid test coverage, with non-crappy tests.
 
5:11 PM
Well, why do I see tons of overly-confident guys saying things like "I gotta learn Ruby in 3 hours because I said I knew it"
;P
 
@Gemtastic That's not confidence, that's idiocy.
 
the golden wannabe programmers
 
Well, I mean; I'm actually amazed that my "teachers" actually have a job. One of them was supposed to hold a code testing class. He showed a slideshow and then he said "I don't know anything about it so go self study" and started playing games on his phone...
 
and the "I'm a real developer!..." kind
 
@SecondRikudo I know, that's why I said it with a smiley
 
5:13 PM
The TDD way:

1. If approaching new problem, write it on the side, mess with it, understand it a little better.
2. Figure out problem
3. Write tests that describe the solution to the problem.
4. Write code that passes those tests.
5. Make sure tests pass.
6. Refactor your code to be better (as opposed to "let's just get the tests passing")
7. Run tests again.
8. Manual test the feature you're working on to make sure you solved the problem
9. Next unit of work please
 
@SecondRikudo That's kinda what I've been doing on my own while learning :P
I do it in my webdesign too
 
@Gemtastic Not seeing tests on your webapp though
 
Gonna put this CSS menu in? Nope. Gotta make it separately first.
 
While we're at it, the "learning a new technology" steps for me:
- "Hello world"
- "Hello world" printed to file
- "Hello world" in GUI
 
@SecondRikudo I do my own version. With the Gemtastic framework
 
5:14 PM
@Unihedro That doesn't necessarily work
@Unihedro For me it's just "With every new project you take, adopt a new technology"
 
You can't see my tests in the actual code, because I write them separately before I implement them :P
 
lol :D adapting is a good solution
 
@Gemtastic Your tests should be checked in to source control.
 
you guys looking strong together, making me want to join this chat on daily basis, definitely looks like good resource to learn attractive topics that you guys talk about
 
@somefolk Best way to learn is immerse yourself in conversation higher than your current level.
That and code code code
 
I don't know more about TDD than fge taught me so far. I've just kinda done my own version because implementing things straight into the code just seems bad.
 
@Gemtastic The best example I've seen explains it in steps.
 
@SecondRikudo you bought me, im in
 
@SecondRikudo Where can I see that example?
 
5:17 PM
Firstly, that ^
But I'm talking about something a little smaller :P
@Gemtastic Consider the following function.
int getAnswer() {
   return 42;
}
You want to make sure that the answer is actually 42. How would a "normal" developer do it?
"normal" isn't the right word here
 
I have no idea what a normal developer do, I just know what I do;
System.out.println(getAnswer());
 
A developer who isn't aware of the ability to write test code.
@Gemtastic Great
But that approach has a problem
 
Of course it does
 
You have to manually inspect the result
 
There's a term for it, "scaffolding debugging"
also known as dummy inspection
 
5:19 PM
So let's go a little smarter
If you were to do something like
 
I wish my teachers were even half as knowledgeable as you :/
 
System.out.println(getAnswer() == 42 ? "PASS" : "FAIL");
This would be better than the above, right?
 
Well, the first teacher I had was great! The other ones... >_> Trash
 
Now you don't need to remember that the correct answer is 42
You just get a pass or a fail.
 
However, you get another problem.
"42" is a magic number here.
 
5:21 PM
And even better! If the function got changed, you get a fail!
 
@Unihedro My thought exactly :')
 
Meaning that if you accidentally break it, you'll get a fail
@Unihedro That's not the problem.
The problem you now have is that this is still a manual test!
 
But, when you hardcode it like that... It just feels bad :/
 
You have to run it yourself
What you have 500 methods you need to check?
You'd run a REPL and start testing them all one by one?
 
And that's where the frameworks comes in?
 
5:22 PM
That's where automatic tests come in
 
I thought that was what the frameworks did :P
 
Wait, there's also a term for the method, it's a "non-functional static test"
 
<-- I know nothing
 
public class TestAnswer {
    public static void main(String... args) {
        if (OtherClass.getAnswer() != 42) {
           throw new Exception("FAILED ASSERTION!");
        }
    }
}
 
Do you now understand why I don't feel confident about working right now? XD
 
5:23 PM
functional tests are that you replicate the expected behaviour and test it as a pure function, where non-functional test like yours (== 42) is a simple assertion with a magic value
 
i just learnt about Singleton pattern, but i don't have any idea when and where it can come in use , can you think of any?
 
Semi pseudo-code ^
Now, you have a main you can just run, and if you get an exception the test failed.
 
Where dynamic testing involves running the software, static testing includes verifying requirements (which is what was done), syntax of code and any activities that do not include running the entire program.
 
But writing it like this with mains is really cumbersome
that's where a framework comes into play.
It handles running the tests for you, detecting which classes are tests, etc, so you can focus on writing actual test code.
 
... and in addition it enforces dynamic testing and functional testing
 
5:25 PM
test code = code to be tested || code for testing?
 
@somefolk Singleton is generally evil.
Use it with extreme care.
@Gemtastic Code that's doing the testing.
 
@SecondRikudo ty, just wanted to be sure.
 
The basic premise of a unit test is to instantiate a tiny portion of the application, feed it with predictable data, and assert that a predictable result came out.
If the assertion fails, something broke.
 
I could easily misunderstand atm because I can only take in information, I can't actually use my brain atm XD
 
@somefolk Don't use the singleton pattern. Ever. I'll show you:
 
5:27 PM
@Gemtastic one of the reasons a Singleton is super evil, is because it's 100% impossible to test a method that relies on a singleton.
 
If your function isn't handing you predictable data, the function is broken to begin with. Stinky code
 
class SomeKindOfManager {
  SomeKindOfManager instance;
}
 
> "Given the same input, a function should always give you the same output."
 
There's the classical example of the test engineer who wanted to test the payment gateway
@Gemtastic Unless randomness is involved
 
@SecondRikudo The data is still predictable; as random! ;P
 
5:29 PM
I like the following phrase "Using a Singleton encourages APIs that lie"
public void queryDatabase(String query) { ... }
 
If you expect random data and only get 42 handed from it, the function is broken
 
@Unihedro there is more? cause i didn't understand from that what you are trying to say
 
At first look, you'd think that this method needs a query string and that's it.
 
While 42 may be a randomly picked number... it's not randomly generated every time you call the function :P
 
But in fact, when you look at the code for the function, you see this:
 
5:30 PM
There are as many ways to screw up in initialization and documentation and calling methods and threading as to how you design a singleton class.
However, consider:
 
public void queryDatabase(String query) {
    DBConn conn = DBConn.getInstance();
    conn.query(query);
}
 
I've heard enums are better for singletons
 
enum Descriptor {
  INSTANCE;
}
 
Oops
So your method relies, implicitly, on DBConn
Now let me ask you this, how would you test this?
You don't want to actually invoke the database
That's 1. slow, and 2. dangerous
 
The first thing that strikes me is that the whole shebang can blow if there's no connection
 
5:32 PM
@Gemtastic Yes! And it would happen runtime
At the latest point possible
 
Yup, because the code will work lovley, as long as the connection exists
 
Only when you run conn.query() and conn would be null.
 
nods
 
While if you had done this
public void queryDatabase(DBConn conn, String query) {
 
Do you think I'm a good student? (I know some of this stuff already, it's just never been presented to me as TDD)
 
5:33 PM
The program would not have been able to compile without a connection
 
@SecondRikudo Dependency injection \0/
 
And it's super clear what the method needs
 
!!ping
!!> "hi"
whoops I killed her
 
@rlemon ^
 
5:34 PM
Inb4 "what wrong?" - "Nothing"
 
I thought it would remove the bot from a room
oh no I'm so sorry
 
Why the hell does it even expose !!die though?
 
in Teenage Programmers Chatroom, 2 mins ago, by Caprica Six
@Unihedro Registered; need 1 more to execute
 
I wonder that too
 
@Gemtastic, now how would you test this method in the first case and in the second case?
@Unihedro can you submit an issue?
 
ok
 
@SecondRikudo I'm sorry but I can't think right now. You can only ask me things I already know X_X
 
@Gemtastic database interaction is expensive. We're hosting our database elsewhere and each invocation costs us actual money.
 
@SecondRikudo if nothing else, connecting to it takes time, and time is money
And developers are expensive ;P
 
5:37 PM
In the case of dependency injection, you can pass a mock
An object the function think's is a database connection
But it actually only behaves as one
 
Fake objects ftw!
 
(i.e. it has the query method that returns a predictable outcome)
In the first example however, there's absolutely nothing you can do.
You can't inject anything.
You can't mock anything.
 
it's practically a stubbed instance of a mocked class
not a fake object
@SecondRikudo You can, with PowerMockito
 
The first method is just pure bad
 
It's the same as doing DBConn conn = new DBConn(realDatabaseCredentials); in the method body.
There's literally nothing you can do at that point.
 
5:39 PM
@Unihedro I call it a fakr object because I don't know what it's actually called. I'm still learning the lingo
 
@Unihedro Let's not fight evil with even greater evil.
I don't even want to imagine how it can fake static methods on a hardcoded class...
@Unihedro this is one of the points I love about JS btw
I can easily mock everything, including stdlib functions.
 
@SecondRikudo well it's a very heavy mock, involving hacking reflection with reflection
 
let oldMap = [].map;
[].map = function(callback) { myAssertions(); }
....
[].map = oldMap;
This is bad practice, and there are libraries that do it much better ^
But this is very possible with JS.
And pretty trivially too.
 
Yes, JS doesn't impose visibility restrictions.
 
Alright
That's the basic of why automatic testing is a good thing
I need to get to my apartment now
@Gemtastic if you have questions and such ping me, I'll catch them as I reach home.
 
5:43 PM
@SecondRikudo I will have questions along the way. What I should be doing now is writing DB designs
 
@Gemtastic What sort of DBs are you looking at?
Relational? NoSQL?
 
I need to start working on this course's project so that I won't end up like in the last course; just throwing something together in a week and hope it'll pass
Relational
 
Do yourself a big favor
 
It has to be a SQL DB
 
And skip MySQL altogether
Go straight to PostgreSQL.
And never look back.
 
5:45 PM
^^^^^^^^^^
 
I'm gonna try as many as I can. I have to learn MySQL because the market here atm requires you to know it
 
All of your classmates will use MySQL
Do not follow them.
@Gemtastic If you know Postgres, learning MySQL is trivial.
 
I like what I've seen of PostgreSQL so far. It looks more like a language
 
The opposite is not true.
 
@Gemtastic Postgres is more than MySQL.
And it's one of the proper implementations of a database, too, whereas something like MongoDB completely does differently.
 
5:46 PM
Well, if you guys are willing to help me learn Postgre then sure ;)
 
@Gemtastic Let's learn it together :)
I'm starting with it too soon on my next project.
Alright, now I'm really AFK
 
@SecondRikudo Well, that sounds interesting :P
 
6:07 PM
@Gemtastic I like feeling like I'm not the smartest person in the room
It tells me I can learn a lot from the others.
 
hey guys, how can i use threads without extends it or implement runnable? maybe import it somehow?
 
@SecondRikudo I agree with that
If nothing else, when I'm not the smartest person in the room, I feel that it's easier to be understood despite my difficulties expressing myself
 
@Gemtastic When you're out of the "newbs" league, the only real way to get better is to discuss and argue with people smarter than you.
You learn their insights, the way they think and solve problems
And it affects you.
 
@SecondRikudo TRUTH!
Though I believe I can still learn from them just by listening to what they have to say
even as a n00b
 
Definitely.
But by discussion a certain topic, you get a more focus attention on that topic.
For instance, that little session we just had about what automatic testing is.
By the way, you mentioned us guys being more knowledgeable than your teachers.
That's likely true, because most people choose to be developers, but few choose to become teachers.
Most teachers are people who were "forced" into it by circumstances
For example, that idiot that teaches my brother, I'll bet half my paycheck that she never wrote a single real line of code in her entire life.
 
6:12 PM
hehe
 
And half my paycheck is likely more than she gets.
So that means something.
 
The thing is, the people we got as "teachers" (they are actually just software developers) seem to know even less about programming than we do.
 
@somefolk wat?
 
Like that thing I've been nagging about with that he didn't even know that index starts at 0, an even number >_>
 
You're tired, I know
And yes, I can really read your mind.
 
6:14 PM
Wut?
If you know what's going on in my mind feel free to tell me because I don't have a clue at this point XD
 
Teachers, like doctors, should adopt a "First do no harm" policy.
 
At least read a book on the subject you're covering and don't play on your phone during working hours >_>
 
nope
too much to ask for
 
I really don't give a dang about pedagogy. All I want is that my teachers know the one subject they're teaching
And the guys from that company... they look like this:
I'm gonna go have a little shuteye for 5 min or so
 
feel free to sleep through.. you seem to need it
 
6:20 PM
@Vogel612 stupid question , ignore it i overcome this quickly enough
 
fge
6:34 PM
yawn
 
@Unihedro you mentioned in the Teenage Programmers room that JCE alpha is `"finished"?
 
I'm using it.
 
~stalking
 
It breaks in very many ways, but at least you can use a simple layer of it.
 
then why are there no new commits on the repo?
last change in the src folder: 3 months ago ....
 
6:47 PM
@SecondRikudo no
@Unihedro if you kids can't play nice I'll take my cap and leave
(exits cap from room)
 
@rlemon How do you remove Cap from a room?
 
you ask me :P
unsummon works as well
 
well it wasn't !!die
 
lol nope
 
And the help manual doesn't say.
 
6:49 PM
!!unsummon 139
 
!!help
 
yup
she just left
 
aaaand back
 
I should do a PR increasing the number of users needed to kill her
two votes is not much
 
Make it five.
I have four accounts.
So.
 
6:52 PM
@Unihedro got one more question up my sleeve
if you may
 
Don't ask to ask, just ask. I don't have all day. :p
 
@Unihedro lol
 
Also, as a recommendation, give a detailed message during confirmation so everyone voting knows what they're doing.
For example, will be summoned to (room id) after 1 vote
 
put it in the issue
 
instead of Registered; need 1 more to execute
k
will have to do it later
 
6:55 PM
does everyone in this room know about the <ruby> element in HTML?
it is awesome
 
@Unihedro i have a thread which i have put to sleep, time has come and i threadObject.interrupt(); it.
when i catch that exception, what should i do there in order to keep the thread running?
 
are you sure you want to keep the thread running? It's a programmatically bad idea. Like very bad.
Like it breaks conventions.
Eh, never mind. Just use a catch clause.
    try {
        object.wait();
    } catch (InterruptedException e) {
        // do it here
    }
 
well, im pretty sure. full story short its a game thread, and i put it to sleep when the game is paused,,, and want to wake it up when the user click on resume. i have got pause() which put to sleep the thread, and a resume() which interupt the thread
 
Forget what I said lol, I messed it up with thread.stop
 
HAMMERTIME!
 
@Unihedro pretty much my question is when i call resume() and interrupt the thread, what do i catch there and how i keep the thread running
 
The thread won't stop just because it got interrupted, so you have to catch InterruptedException, and continue in the catch block; alternatively, have an empty catch block and continue after it.
For example, this is the implementation of a method in java.util.Queue:
 
the last line chinese to me
prettymuch you're saying
try{ gameThread.sleep(999999999); }
catch( InterruptedException e ){}
should do the job
 
... are you sure there's a sleep() method?
Oh, no wonder my IDE's messed up, I'm on Java 6.
sigh
 
;/
happens to the best dont worry
 
7:07 PM
Yes, that will work.
 
http://www.commitstrip.com/en/2015/02/25/and-the-misclick-happens/
CommitStrip - Blog relating the daily life of web agencies developers
And the misclick happens
CommitStrip
1424891152
 
how about replacing that 9999999 number with some more aesthetic way like "true" is possible?
 
0?
 
lemme live check that
not working
 
Integer.MAX_VALUE
 
7:11 PM
in Lounge<C++>, 3 hours ago, by Don Larynx
Class GamePlay extended HelperFunctions extended Player extended TicTacToe (Main-Class)
 
@Unihedro beast
 
@somefolk -1>>>1
 
But the largest is only 0x7fffffff.
Never mind, that's what -1>>>1 is.
Ugh, two's complement.
Actually, -2>>>1 is the same as well.
 
vOv, Bit operations are fun to know
But they're pretty useless in general development.
(Unless you're doing something very specialized, like encryption)
 
The popular encryption methods doesn't even play with bits.
Practically, it's two really large prime numbers and nothing more.
 

« first day (1586 days earlier)      last day (3363 days later) »