Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sentenryu

@Sentenryu
About
Posts
544
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Interesting / strange code picked up from pluralsight training (functional programming)
    S Sentenryu

    I just ask that, if you've no state, make the damn method static. The amount of times I had to rewrite stuff because people fumbled around with instances of a stateless object and later added state to that object, breaking half the code depending on execution order is uncanny. It's fine to be an instance method if you class has an immutable state. At least nobody would come and remove a const or readonly from a field without the knowledge that it would break everything... I hope...

    The Weird and The Wonderful csharp com functional tutorial

  • Why use the correct exception type?
    S Sentenryu

    I mean, not really? COM files have a size limit because they behave different from EXE files (or rather, EXE files behave different, since COM is the original). When you try to load a COM file that exceeds this limit you're really running out of memory, before the code can even start to be executed. Could they read the file size and predict that? they couldn't (or just didn't, hard to say with stuff this old) when COM files where actually being used, so the current included loaders also don't. You don't really want to mess with those kinds of legacy systems, specially when they are useless for current developments and the alternative doesn't share the concerns. [COM file - Wikipedia](https://en.wikipedia.org/wiki/COM\_file#MS-DOS\_binary\_format)

    The Weird and The Wonderful winforms graphics question

  • Why use the correct exception type?
    S Sentenryu

    Extensions aren't trustworthy, nothing guarantees the file is in the format it says it's on. The developer himself might have changed the extension to better suit his application, as evidenced by the shitload of formats that are just XML files, compressed or not, with a different extension (like SVG). As for the first few bytes, many formats have common prefixes (there's 2 or 3 exemples on the list you linked, but there's more), some of them don't even require the prefix to be present and others (like SVG) are encoded as text that can have yet another prefix (BOM). It's sad, but we can't trust the format markers when dealing with multiple formats.

    The Weird and The Wonderful winforms graphics question

  • Game Making
    S Sentenryu

    Now that you mention it, RPG Maker is paid, I never knew that. I got it in a game making magazine ages ago and had a blast. there's no actual programing required (you can use the scripting language, but it isn't necessary) you just draw maps by selecting squares with pieces from the toolbox, create npc and dialogs via a mini editor, etc...

    The Lounge game-dev csharp com tutorial question

  • Game Making
    S Sentenryu

    Spoon Of Doom wrote:

    I have fond memories of messing around with it when I was younger. Back then, there was a pretty big community, which also provided free spritesheets, music and other assets - don't know how it is these days.

    Man, I think that was what got me into programing at all. I remember spending hours at a time on the brazilian/portuguese forums discussing and learning map making and some light events/scripting. The lengths I would go to make the real time battle system (not ABS, the one that was based on events on a map) do what I wanted...

    The Lounge game-dev csharp com tutorial question

  • Game Making
    S Sentenryu

    For that age, isn't [RPG Maker](http://www.rpgmakerweb.com/) ([wikipedia](https://en.wikipedia.org/wiki/RPG\_Maker)) better suited than an actual game engine? I guess Kodu fills the same role?

    The Lounge game-dev csharp com tutorial question

  • Small startup shows us the wrong way to incentivize programmers
    S Sentenryu

    Marc Clifton wrote:

    putting images into a sortable, filterable, paginated grid as the most efficient way of handling viewing all photos.

    They didn't even ask for that. They asked only for images, so a simple page could do the job just fine. This is not the revolting part, this is:

    Quote:

    Please do not apply if you know you don't have the skill necessary to build something extraordinary

    Specially when followed by this:

    Quote:

    We are just four college kids with no money

    :doh:

    The Insider News com

  • Google Chrome now has a built-in anti-virus for Windows
    S Sentenryu

    Dan Neely wrote:

    just a new version of Chrome's built in defenses against crapware being injected into it?

    Now this I would be fine with. I'm tired of having to protect my browser from crapware injection. Why does every installer for Open Source software want to install a browser extension? and why does java still try to do that too?

    The Insider News com

  • Google Chrome now has a built-in anti-virus for Windows
    S Sentenryu

    Well, it can start by removing that chrome virus right away. Seriously, I installed chrome because I wanted a web browser. If I wanted an anti-virus software I would have downloaded and installed one. Google should really stop overstepping it's boundaries like that.

    The Insider News com

  • Programmer Competency Matrix
    S Sentenryu

    jschell wrote:

    And it has resolved into an absolute commandment from god, that must never be questioned, even when evidence suggests otherwise.

    I deal with this way too much. What happened to "use the right tool for the right job"? I'm tired of seeing people trying to drive nails with the pointy end of a screwdriver.

    The Lounge com

  • Programmer Competency Matrix
    S Sentenryu

    The jump from the second cell to the third is way too big and includes skills that are way too niche to be expected from a general developer. Heck, even the second column includes some things that are useless in the day to day. Maybe if it was presented as limited to a specific niche.

    The Lounge com

  • Programmer Competency Matrix
    S Sentenryu

    The same goes for all that's written on the article. If you don't work directly with that stuff, it's irrelevant and sometimes even detrimental* that you know it. \* I have some applications here that one such "genius" wrote where he uses an array of threads to "parallelize" some simple calculations. The kick? the calculations are sequential, take less time to execute than the threads take to warm up and are done once a month with no time constraint. But he just had to pass threads around through the whole app...

    The Lounge com

  • Using IEnumerable nonsense for everything
    S Sentenryu

    It was hard for me too, but once you understand how the context shifts it becomes way easier. LINQ queries have a different flow from the rest of the imperative code and are best left a little separated from stuff like for loops and complex conditionals, they require you to use the same way of thinking you use when writing SQL. It's not that you are telling the machine what to do, you're telling it what you want done, so you read this:

    someList.Where(condition).Select(field)

    As "Give me field for all objects where condition is true" instead of "For each object, if condition is true, stuff field on another list". Truth is, those kind of LINQ queries are just convenience. The real power of LINQ comes when you start using joins and groups, like this example from LINQPad (still on the simple side):

    var query =
    from o in Orders
    group o by o.ShipCountry into countryGroups
    select new
    {
    Country = countryGroups.Key,
    Cities =
    from cg in countryGroups
    group cg.ShipPostalCode by cg.ShipCity into cityGroups
    select new
    {
    City = cityGroups.Key,
    PostCodes = cityGroups.Distinct()
    }
    };

    that produces this output:

    // Brazil
    // Campinas
    // 04876-786
    // Resende
    // 08737-363
    // Rio de Janeiro
    // 02389-673
    // 02389-890
    // 05454-876

    As much as I can write that using for loops and conditionas, i don't want to write it that way. Also, join's and group's are the only thing I'll ever use query syntax for, they are somewhat easier to understand that way.

    The Lounge question csharp

  • Using IEnumerable nonsense for everything
    S Sentenryu

    this thread only shows that you're hellbent on your "One true way" of coding, so there's not much to discuss here. but do keep in mind that calling a style "cancer" just because you don't want to learn how to read and use it is exactly what causes so many flamewars on the IT world (tabs vs spaces anyone?). Sure, you tell me it's just an if but you know what? I much prefer to read

    someList.Where(condition).Select(fields).Distinct().OrderBy(field)

    than the alternative

    HashSet distinctSet = new HashSet();

    foreach(var item in someList){
    if(condition){
    distinctSet.Add(item);
    }
    }

    specially if you want to roll your own sorting method at the end. As a last note, i sometimes work with code where the order of operations (where, distinct, etc) sometimes yields different results and is important (due to crazy business rules, what can you do), so it's way easier to get the intent from the link way, but I recognize that you mileage may vary on that last one.

    The Lounge question csharp

  • Using IEnumerable nonsense for everything
    S Sentenryu

    irneb wrote:

    your sample is quite litterally performing 3 loops where one for loop would have sufficed.

    you should really take a look on what the compiler does when it enconters the yield keyword, you might be surprised to find out it's not as inefficient as you think.

    The Lounge question csharp

  • Using IEnumerable nonsense for everything
    S Sentenryu

    Instead having loads of repeated code everywhere for no real benefit? are you trolling?

    The Lounge question csharp

  • Microsoft Urged to Open Source Classic Visual Basic
    S Sentenryu

    This "open source everything" campain should really stop. Open sourcing the language will NOT fix anything and is likely to introduce even more problems :doh: Those people should really bite the bullet and learn VB.Net at the very least.

    The Insider News announcement html

  • QA blooper
    S Sentenryu

    there's one in the setter too.

    The Weird and The Wonderful beta-testing

  • What. The. Elephant?
    S Sentenryu

    You should really stop looking, it gets even worse.

    The Weird and The Wonderful question javascript com adobe security

  • Applebee's Website Fail
    S Sentenryu

    You have no idea how I would love to have something even close to resembling what you have. Either you are really fortunate or I'm really unfortunate. Or both.

    The Weird and The Wonderful csharp asp-net dotnet linq com
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups