Tabs > Spaces, and other fundamental truths :-D


  • Notification Spam Recipient

    @asdf said:

    @RaceProUK said:
    Also brace style

    Try to argue for the GNU brace style to offend everyone equally!

    Also, tell every VIM user that they should use a proper IDE instead.


    People who have never used vim need to try it for a week. God awful learning curve but I hate to admit it but it's the best text editor on linux. Granted I only used ssh but that is how Linus intended. :belt_onion:



  • @RaceProUK said:

    Braces or no braces for code like this

    Syntax error


  • FoxDev

    No love for Emacs? I r sad.

    And yes, I know the old adage "Emacs: it's a great OS; shame about the text editor"




  • Notification Spam Recipient

    @RaceProUK said:

    No love for Emacs? I r sad.

    And yes, I know the old adage "Emacs: it's a great OS; shame about the text editor"

    I honestly haven't used it for an amount of time to get a good feel for it. By the time it was recommended to me I was already proficient enough with vim and there was only one other person in the office using it and I don't think it was installed on any of the servers so that had to be dismissed =(

    @xaade enough of that from you. Off to asylum!



  • @DogsB said:

    enough of that from you. Off to asylum!

    I couldn't pass it ump



  • "Should you use regions?"

    We have a guy here who's adamant that you should, because real code has lots of local variables and can't be broken up into sane methods, and sooner or later you'd have to make classes which would just complicate everything.


  • FoxDev

    If you have regions inside a method, that method is too long. Regions however are useful in grouping related methods together.

    It also sounds like that guy doesn't know what he's doing.



  • @RaceProUK said:

    related methods

    Are called a class, in my book. And by my book, I mean not my book but Robert Martin's book.


  • FoxDev

    True, but some classes can have hundreds of methods; regions come in handy then.

    Of course, then the question is whether that's good class design, but that's another matter entirely.



  • @RaceProUK said:

    some classes can have hundreds of methods

    Right, bu-

    @RaceProUK said:

    Of course, then the question is whether that's good class design

    Hmm, now I know how Blakey sometimes feels...



  • @RaceProUK said:

    whether that's good class design

    Do you have a data object that records state for a unit of data, and a series of actions that can occur on that unit?

    Are the remaining non-actions private?

    This is the ideal of course. But if you can map nearly every public method to a legitimate action, then the next step is looking to see if you can normalize the data more.

    If you can't normalize the data more, then those hundreds of methods are legit.



  • @FrostCat said:

    my 1080 monitor just spit in your eye.

    1080? You disgust me. 16:10 is the superior aspect ratio.

    Also, at 80 columns per line you can open two files side by side. 100 column limit is fine too.


  • FoxDev

    The number of methods is ultimately dependent on how much the class does, and how much you break up its functionality into smaller methods. Then there's also interface implementations, properties, dependency properties, private members, and all sorts of other fun. So you could have a region for your IEnumerable, one for your IComparable, one for your dependency properties, one for the public API, one for the private helpers, one for internal state, etc, etc.


  • Discourse touched me in a no-no place

    @Kian said:

    1080? You disgust me. 16:10 is the superior aspect ratio.

    I AM WELL AWARE OF THIS BUT the last time the office got new monitors nobody asked for my input.



  • @Choonster said:

    I've actually used that pattern once or twice in Lua code.

    Lua doesn't have any kind of conditional expression, if x then y else z end is always a statement. Reason #1,204 why Lua sucks.

    local luaSucks;
    if maybeLuaDoesntSuck then
        luaSucks = 'urgh';
    else
       luaSucks = 'godthisLanguageIsAwful';
    end
    


  • @DogsB said:

    @Mikael_Svahnberg said:
    Casually drop the statement that I always store my program settings in %USERPROFILE%"My Documents" -- it is the only reliable way to decide where files should be located in Windows.
    If I could stab you over the internet. 🔪

    (And the discussion on ternary that followed here)

    q.e.d.

    That's all you really need to flamebait your cow-orkers.



  • @accalia said:

    E_PARSE_ERROR return is not valid outside of function scope.

    It is valid in PHP.


  • FoxDev

    @Arantor said:

    It is valid in PHP.

    E_PHP_IS_THE_REAL_WTF



  • @asdf said:

    Also, tell every VIM user that they should use a proper IDE instead.

    Feh, Vim is a proper IDE!



  • I've used it intentionally before now. Very specialised use case.


  • FoxDev

    @tar said:

    Vim is aTHE proper IDE!

    FTFY


  • Winner of the 2016 Presidential Election

    @tar said:

    Feh, Vim is a proper IDE!

    q.e.d.

    Works every time.



  • Although some of those don't seem that controversial.


  • Winner of the 2016 Presidential Election

    I am now waiting for the news report of a murder in some kind of IT firm because one guy just HAD to pull out the emacs or vim-question


    Btw. about the title of this topic:
    Since you can set how many spaces a tab is in most editors, you can't say that Tabs are always greater than spaces
    Plus, since you said "spaces" (plural) this could mean there are a 5 spaces against a 4space-tab indent.

    Filed Under: important!



  • local luaSucks = maybeLuaDoesntSuck and "urgh" or "It's not really that bad"
    


  • @Bort said:

    Although some of those don't seem that controversial.

    Anything deemed controversial by Almighty Jon Skeet is so. The guy has his own Chuck Norris jokes section...



  • 1) The Business Apps farce:

    I think that the whole "Enterprise" frameworks thing is smoke and mirrors. J2EE, .NET, the majority of the Apache frameworks and most abstractions to manage such things create far more complexity than they solve.

    Take any regular Java or .NET ORM, or any supposedly modern MVC framework for either which does "magic" to solve tedious, simple tasks. You end up writing huge amounts of ugly XML boilerplate that is difficult to validate and write quickly. You have massive APIs where half of those are just to integrate the work of the other APIs, interfaces that are impossible to recycle, and abstract classes that are needed only to overcome the inflexibility of Java and C#. We simply don't need most of that.

    How about all the different application servers with their own darned descriptor syntax, the overly complex database and groupware products?

    The point of this is not that complexity==bad, it's that unnecessary complexity==bad. I've worked in massive enterprise installations where some of it was necessary, but even in most cases a few home-grown scripts and a simple web frontend is all that's needed to solve most use cases.

    I'd try to replace all of these enterprisey apps with simple web frameworks, open source DBs, and trivial programming constructs.

    1. The n-years-of-experience-required:

    Unless you need a consultant or a technician to handle a specific issue related to an application, API or framework, then you don't really need someone with 5 years of experience in that application. What you need is a developer/admin who can read documentation, who has domain knowledge in whatever it is you're doing, and who can learn quickly. If you need to develop in some kind of language, a decent developer will pick it up in less than 2 months. If you need an administrator for X web server, in two days he should have read the man pages and newsgroups and be up to speed. Anything less and that person is not worth what he is paid.

    1. The common "computer science" degree curriculum:

    The majority of computer science and software engineering degrees are bull. If your first programming language is Java or C#, then you're doing something wrong. If you don't get several courses full of algebra and math, it's wrong. If you don't delve into functional programming, it's incomplete. If you can't apply loop invariants to a trivial for loop, you're not worth your salt as a supposed computer scientist. If you come out with experience in x and y languages and object orientation, it's full of s***. A real computer scientist sees a language in terms of the concepts and syntaxes it uses, and sees programming methodologies as one among many, and has such a good understanding of the underlying philosophies of both that picking new languages, design methods, or specification languages should be trivial.

    This one was funny. Apparently not understanding what things are for is fine, and you don't need to know anything to write all the code you'll ever need (a small amount of very simple code).

    Yeah, these people are idiots.


  • FoxDev

    StackOverflow. The only place where genuine pleas for help are ignored or locked, yet what is essentially a blog article is preserved for 'historical significance'.



  • @Choonster said:

    local luaSucks = maybeLuaDoesntSuck and "urgh" or "It's not really that bad"

    local luaSucks = maybeLuaDoestSuck and false or 'ihateit';
    

    I forget exactly, but there's a set of conditions where the and ... or hack will fuck you over. Of course, in this case, maybeLuaDoestSuck is a fancy way of spelling nil so you're already fucked. God I hate Lua so much...


  • FoxDev

    @RaceProUK said:

    StackOverflow. The only place where genuine pleas for help are ignored or locked, yet what is essentially a blog article is preserved for 'historical significance'.

    Reminds you of somewhere *cough*meta.d*cough* doesn't it?

    I can't rightly *cough*meta.d*cough* remember where though

    *cough*meta.d*cough*

    oh dear, i seem to have caught a bit of a *cough*meta.d*cough* cough.

    does anyone have a throat *cough*meta.d*cough* lozenge?


  • FoxDev

    Have a whole packet ;)

    Ooh, I see the word 'alcohol' on there!



  • To be fair, people love this stuff, and they'd delete it if they weren't worried people would leave if they did. Plus, considering the guy's contributions to... everything ever, they probably just want to be nice to him.

    Honestly, he seems like a nice guy, and his blog is far better than :doing_it_wrong:'s, since it actually has real programming things on it. If he didn't answer questions, SO would really be worth abandoning entirely.

    I'm not one for hero worship, but his answers really did teach me a lot and solve problems for me.


  • FoxDev

    Don't get me wrong, I have nothing but respect for Jon Skeet; that guy seriously knows his shit. It's just I find SO's hypocrisy amusing 😄


  • area_can

    It's not trollbait if anyone with half a brain agrees with you...



  • @RaceProUK said:

    Emacs

    That's Stallman, though.



  • Wow, that was rambling. Sorry haven't had my coffee yet.

    That blakeyrat was quite different from today's blakeyrat, it seems.



  • The First Shahada:

    There is no Blakeyrat but Blakeyrat


  • Trolleybus Mechanic

    I'm not gonna read through the thread, because I enjoy my bloodpressure where it is. But how about:

    • Declaring variables as needed, or at top of function
    • vb.net or c#
    • css or tables?
    • wasd or arrows?

  • BINNED

    @Lorne_Kates said:

    Declaring variables as needed, or at top of function

    Unless you live in the 80s or use shitty and old (i.e. before 2013!) MS compiler



  • @Kuro said:

    How many times did you have to program fizzbuzz after you have been employed, huh?

    On a side note, I have not been asked to program fizzbuzz even once. Also, Of the hundreds of people whom I've talked to(Entry level programmers and experienced ones), only a handful of them knew about it.



  • Which is why its a good test.


  • BINNED

    @Lorne_Kates said:

    wasd or arrows?

    I'd argue WASD unless it's an FPS and you're left-handed, arrows might work better then. Can't verify though, can't use a mouse with my left hand for shit.


  • FoxDev

    I'd still favour WASD, simply because of the larger number of keys right next to them; a lot of FPS games make use of E for Use, R for Reload, stuff like that.


  • Notification Spam Recipient

    @Lorne_Kates said:

    css or tables?
    My html usually ends up as nested tables. I give CSS a try but I never have the time to invest into doing it well.


  • FoxDev

    Just do what all sensible webdevs do, and use Bootstrap or similar ;)


  • FoxDev

    @RaceProUK said:

    Just do what all sensible webdevs do, and use Bootstrap or similar 😉

    Bootstrap+Select2 FTW


  • Notification Spam Recipient

    @RaceProUK said:

    Just do what all sensible webdevs do, and use Bootstrap or similar 😉

    @accalia said:

    Bootstrap+Select2 FTW

    Madness! That's where that road leads! All I have to do is document user changes in the most arcane wiki I've ever seen that only became tolerable after learning I could use html.

    The kicker is we have an atlassian subscription but we can't use the wiki bit for some reason...


  • FoxDev

    Ah, you're editing a wiki? Yeah, getting styles to work in a wiki is a ballache. Then again, it's not actually that bad if you're using MediaWiki; it's awkward, but doable.



  • @Lorne_Kates said:

    wasd or arrows?

    Xbox controller, obvs.


Log in to reply