Page 2 of 2 FirstFirst 12
Results 41 to 43 of 43

Thread: [RESOLVED] I need the shortest code that writes to a text file

  1. #41

    Thread Starter
    PowerPoster
    Join Date
    Feb 2016
    Location
    Tennessee
    Posts
    2,437

    Re: [RESOLVED] I need the shortest code that writes to a text file

    Hi tg, haven't heard from you in a while. it's so good to talk again...

    Code:
      _FileFields.ForEach(Sub(x) _FileDataTable.Columns.Add(x.GetColumnDefinition))
    As I said about Ddays code. This is beautiful and for the life of me, I can't understand why people don't get it. I mean, there are programmers out there that just do it for a living and have no real passion for it at all. But for people like us, we can stand back and look at something and think... that's really good.

    While I only did VB for around 6 months on my last job, the other programmers there used your "normal" way of doing it. I never said anything, but to me, well.. I just didn't like the way the code looked, or something. It just didn't seem right for some reason and I will probably never know why <smile>

    Every time I see a "for each" call I want to scream. Guess that makes me weird, huh?
    Better go now... this is long enough. Really happy to talk to you again. If you would like to come, we have a thread about Interfaces going on. You're certainly welcome to stop by and join in.

    have a great one!

  2. #42
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: [RESOLVED] I need the shortest code that writes to a text file

    It's done the traditional way because up until about 2008/2010 that was the ONLY way... and for some cases that's still the only way... not everything supports the .ForEach construct, but does the For Each ... there's nothing wrong with that, it's the nature of the language. Honestly at the end of the day, I don't really care one bit whether I think it's elegant or not... most of the time the code is crappy looking... but it works... and it works within the confines of the paradigm I have to work in. I see, write and use a lot of code that makes my skin crawl... because I have to... I can't afford to spend 8 hours making something that no one will see "look nice" My employer charges way too much for me to go around messing with code like that. And I don't code for "just because" either... I'm either working on code, or I'm not working at all... I used to code for fun... but I don't any more.... aaaaaaany ways... coding is like an art form sometimes... and like all things art, beauty is in the eye of the beholder... some people like Picasso ... other don't ... And based on what I've seen around here at times, there are some people that code like Picasso....

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #43

    Thread Starter
    PowerPoster
    Join Date
    Feb 2016
    Location
    Tennessee
    Posts
    2,437

    Re: [RESOLVED] I need the shortest code that writes to a text file

    Honestly at the end of the day, I don't really care one bit whether I think it's elegant or not... most of the time the code is crappy looking... but it works... and it works within the confines of the paradigm I have to work in.
    Well, guess I can't say much about that. The shop I worked at the longest was more interested in time to market than anything else. That translated into a lot of ugly code from ALL of the developers. Self included.

    I see, write and use a lot of code that makes my skin crawl... because I have to... I can't afford to spend 8 hours making something that no one will see "look nice" My employer charges way too much for me to go around messing with code like that. And I don't code for "just because" either... I'm either working on code, or I'm not working at all...
    As for making code that "looks nice", that was never a goal for me at work. I never tried to find "opportunities" to use that type of code. But I "am" guilty of taking my work home with me. That's not a bad thing. It's just two ways of thinking and two preferences.

    and like all things art, beauty is in the eye of the beholder... some people like Picasso ... other don't ... And based on what I've seen around here at times, there are some people that code like Picasso....
    I love it. That's a fun way to look at it. I agree, beauty IS in the eye of the beholder. But there might not be two people who think the same way when it comes to code.

    One of the great things I have learned since coming here, is that it's important to have your code organized with a constant style that make's it easy for other people to read and understand your code. Every thing else I've learned is an attempt to improve my skills as a developer. Because I'm been retired for so long, it has made me lazy and because of that my code and style are not up to par with modern day principles. In other words, I'm playing catch up.

    tanks for your note. It is appreciated.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width