Open Side Menu Go to the Top

08-07-2012 , 02:26 AM
and fwiw i generally try to have only one return but to return early when i'm not doing that. i also always use else, always write tests, and always refactor into functions if it's more than a few lines and/or more than slightly complicated.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
08-07-2012 , 02:29 AM
also also at work the main codebase is indented with tabs but when they started splitting stuff off into services the people rebelled and started indenting with spaces. so now my editor needs to know where it is before it decides to :set expandtab or :set noexpandtab.

Last edited by tyler_cracker; 08-07-2012 at 02:29 AM. Reason: :set list also helps in this situation
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 02:39 AM
ok serial posting but one more thing: the above lead to one of these fun python moments where i had some code like this:

Code:
#!/usr/bin/env python

class Parent(object):
    def method1(self):
        print "Parent.method1"
    def method2(self):
        print "Parent.method2"
    def method3(self):
        print "Parent.method3"

class Child(Parent):
    pass

c = Child()
c.method1() # prints Parent.method1
c.method3() # prints Parent.method3
c.method2() # raises AttributeError. wtf?!?
it turns out that the definition of method2 was indented with tabs while everything else was spaces, which python helpfully interprets as me starting a new block and hence not defining the class anymore. fun!

Last edited by tyler_cracker; 08-07-2012 at 02:40 AM. Reason: luckily :set list rescued me! and now it's on all the time.$
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 02:43 AM
Quote:
Originally Posted by Neil S
I once forgot C++ templates are the compile time abomination that they are, and tried to move the implementation from the header into its own source file.
It is offensive, yes? I do this:

// this is blah.h
#include "blah.cpp"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 02:50 AM
Yeah.. you have to convert tabs to spaces when programming in Python or else you go insane.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 03:49 AM
Quote:
Originally Posted by greg nice
yea yea yea ill learn vim one day
vim is great but also any IDE will solve the problem you're describing. Pretty much all you need is a jump to definition hotkey, or an outline view pane of your code.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 03:58 AM
If anyone knows how to get java working in a browser on OSX (I know, a huge request), please take a look at this SE link:

http://apple.stackexchange.com/quest...es-in-terminal

Some **** about OSX is ****ing infuriating.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 05:39 AM
So apparently I'd let kyleb reformat my code any day.

Different kinds of whitespace have different purposes. Programmers should understand this. Newlines, tabs, and spaces are NOT interchangeable.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 05:41 AM
Quote:
Originally Posted by kyleb
If anyone knows how to get java working in a browser on OSX (I know, a huge request), please take a look at this SE link:

http://apple.stackexchange.com/quest...es-in-terminal

Some **** about OSX is ****ing infuriating.
I just click the box, say yes I want to enable Java, and it just works. Mac OS finds Java for me, downloads it, installs it, and we're good to go.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 05:58 AM
What box? Did you read the ticket?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 06:31 AM
Quote:
Originally Posted by greg nice
which do you use/prefer and why?

Code:
func()
{
   if (condition)
   {
      code1
   }
   else
   {
      code2
   }
}
or

Code:
func()
{
   if (!condition)
   {
      code2
      return
   }

   code1
}
ive always done the first, but ive switched to second and code seems cleaner and easier to read
Depends but in a vacuum I prefer the first version. Main reason is probably that negation is harder to handle mentally because it's one extra step of callng our logic unit in the brain.

Quote:
Originally Posted by Neko
spaces ftw.
This. I try to be open minded and all but I'm pretty sure that if you lined up all programmers who prefer spaces and all who prefer tabs the spaces camp will have the better average and the better top percentile. Pretty much the only "style choice" I have such a strong opinion on.
[I count people that use the tab key or some other key to create multiple spaces via their editor setup in the spaces camp ldo]

Quote:
vim is great but also any IDE will solve the problem you're describing. Pretty much all you need is a jump to definition hotkey, or an outline view pane of your code.
Here's why you should know vim/some light standardish unixoid editor...one day everything will fail miserably and you'll have to ssh into some box to fix large chunks of code and configuration and do it as fast as possible. Good luck if you've been using Eclipse or smth all your life.

Last edited by clowntable; 08-07-2012 at 06:43 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 07:16 AM
Quote:
Originally Posted by kyleb
What box? Did you read the ticket?
Ah I see. Oracle broke it it sounds like. I didn't see that because your comment was blaming Apple, heh.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 07:39 AM
That Hickey keynote is really good. Highly recommended, thanks for posting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 07:43 AM
Quote:
Originally Posted by Neil S
Ah I see. Oracle broke it it sounds like. I didn't see that because your comment was blaming Apple, heh.
Nope. Didn't work with SE 6 checked (or pre-Oracle install), either. Same behavior. Still blaming Apple here.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:05 AM
If it only broke after Oracle's stuff updated, I think it's clear who's to blame?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:10 AM
Because yup, I just checked. I can run Cyberduck all I want, which is essential for my work as my predecessor didn't bother to get shell access for some of the sites I manage, and my prefs window looks like this:



I know I've run web applets before, too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:11 AM
Quote:
Originally Posted by Neil S
If it only broke after Oracle's stuff updated, I think it's clear who's to blame?
Sure, I'll grant you that assumption.

It was broken before I installed Oracle's SE 7. Now what?

Last edited by anononon; 08-07-2012 at 08:12 AM. Reason: that's the whole reason i installed SE 7
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:12 AM
Extra thought: The lack of a 32 bit version sounds like it could be problematic.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:13 AM
I said in #4914 that it didn't work pre-Oracle install. This was a problem before the beta install. I only installed SE 7 because SE 6 (the default installs that you show installed) did not work. No Java apps came up in any browser despite any number of restarts, checked boxes, or attempts to run Software Update.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:13 AM
Quote:
Originally Posted by kyleb
Sure, I'll grant you that assumption.

It was broken before I installed Oracle's SE 7. Now what?
Now we have a configuration control issue. You tried something, it doesn't work, and it needs reverted before proper diagnosis can continue.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:14 AM
Because seriously, the process I've always used to install Java is idiot proof. The dialog pops up, it offers too install, I say yes, it installs, it works.

I have no clue how you borked it.

Just wipe it all and try again. Seriously. Maybe the install got corrupted somehow. Cosmic rays flipping a bit.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:14 AM
Neil, it did not work using the exact same settings you show. Do you honestly think I didn't Google for the most basic of configuration questions before attempting to install the SE 7 beta and then posting on apple.SE?

The fact that "it just works" is the whole problem here. That is my point. This would be trivially easy to revert and/or diagnose in Windows/Linux. In OSX, it's just supposed to work, and it doesn't, so where do I go for more information?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:17 AM
Clearing out the versions in /System/Library/Frameworks/JavaVM.framework apparently is the way to go. But this isn't something I've tested.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:17 AM
Quote:
Originally Posted by kyleb
Neil, it did not work using the exact same settings you show. Do you honestly think I didn't Google for the most basic of configuration questions before attempting to install the SE 7 beta and then posting on apple.SE?

The fact that "it just works" is the whole problem here. That is my point. This would be trivially easy to revert and/or diagnose in Windows/Linux. In OSX, it's just supposed to work, and it doesn't, so where do I go for more information?
OK so you just want to bitch. Fair enough. Never mind.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-07-2012 , 08:20 AM
Ugh, apologies. I just realized I'm in a pretty grumpy mood, more than I realized. Jackhammers going outside as they repave the parking lot. Sorry.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m