IT/Software career thread: Invert binary trees for dollars.

Cad

<Bronze Donator>
24,489
45,418
I pretty much never used complex data structures because 99% of the time apps are pulling straight from the database and into a list, that list is processed straight through.

Most application development is boring, efficiency work that tries to minimize database calls, memory leaks, and maintenance while adding features. the high performance data-structures/algorithm shit you learn in school is hardly ever used.
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,964
I pretty much never used complex data structures because 99% of the time apps are pulling straight from the database and into a list, that list is processed straight through.

Most application development is boring, efficiency work that tries to minimize database calls, memory leaks, and maintenance while adding features. the high performance data-structures/algorithm shit you learn in school is hardly ever used.
Sounds like balls. I am sure there are a few corps that are doing something a bit more computationally interesting than database calls.
 

ShakyJake

<Donor>
7,641
19,281
I regular use Arrays, HashSets, Dictionaries, and Queues. Of course, these classes are built into .NET so I'm not literally writing the insert, delete, and search algorithms.
 

Asshat wormie

2023 Asshat Award Winner
<Gold Donor>
16,820
30,964
I regular use Arrays, HashSets, Dictionaries, and Queues. Of course, these classes are built into .NET so I'm not literally writing the insert, delete, and search algorithms.
I was thinking of something a tad more exotic. Curious about anything outside the standard library really.
 

Khane

Got something right about marriage
19,838
13,355
I use collections on almost a daily basis but they are your stock, vanilla collections like Lists, Dictionaries and Queues like Jake mentioned.

I have never even once used a multi-dimensional array or the like.
 

Vinen

God is dead
2,783
490
I use collections on almost a daily basis but they are your stock, vanilla collections like Lists, Dictionaries and Queues like Jake mentioned.

I have never even once used a multi-dimensional array or the like.
I haven't written a line of code in a few years but up until then I can't think of a time where I onced used any of the complex knowledge I learned in college.

All this stuff is handled by frameworks behind the scenes now. Unless you are working directly on the .NET Framework or Java (or another language) there is very little reason to know the intricate details outside of which type of collection is best to use for your situation.
 

ShakyJake

<Donor>
7,641
19,281
I have never even once used a multi-dimensional array or the like.
I've been working on a personal project that uses a multi-dimensional array. Actually, I've been struggling to try and think of a better way to represent the data. And, hey, maybe you guys might have some ideas. In fact, I think someone here mentioned they work with or might pursue a job that deals with HL7 (Health-Level 7) messages. Doesn't matter, many data messages are structured similarly.

Okay, so here's the deal: HL7 messages look like this:

Each line represents a segment (MSH, PID, NK1, PV1). Within each segment are sequences (the pipe [ | ] delimiter). Within each sequence there are components (the caret [ ^ ]). There are also subcomponents ( & ) and repeats ( ~ ) but are rarely used in my experiences.

I am creating a parser utility for the guys at work that will break down the message into a HTML table so they can more easily examine the data. I have a working tool, so no problem there, but what I ended up doing is simply splitting off of the 3 delimiters - carriage returns (for segments), pipe, and then caret. So you end up with a multi-dimensional string array - string[][][]. However, it's very cumbersome to work with and the code is confusing. I really can't think of a way to represent this data via class structures. You would basically end up with something like an array: Message being a List of Segments, Segments being a list of Sequences, and Sequences a List of Components. It's like Russian dolls and it gets confusing fast. And, it can get deeper than that if one needs to deal with the above mentioned subcomponents and repeats.

Oh, and if anyone actually gives a shit, this is what the parsing tool outputs:

rrr_img_104483.jpg
 

Tuco

I got Tuco'd!
<Gold Donor>
45,451
73,541
Few of us will ever get paid to create a binary search tree. Even fewer will have good reason to create a binary search tree. You'd have to have a really good reason to need to implement a BST over the standard map in whatever language you're using.

However, every true CS person knows what a BST is and I don't need to explain the details to you. But If I tell you to make one, it's a non-trivial programming challenge problem and requires some abstract thought and may require dealing with pointers depending on your language. BST are so common though, you run the risk of someone having prepared for that test question and just reciting the solution from memory. Same with linked lists.

I prefer custom-making programming tests based on the candidate's strengths. If someone has experience with databases via PHP and they spent the last 3 years working with stock exchanges, I'd want them to write some PHP to create and edit a table with some basic trading data for the day. A huge part of my goal in interviewing is to see them at their best because they'll get comfortable at the job and start performing. We all know what it's like to get in the programming zone and do really well in a challenging environment, and while that's impossible to attain in an interview, the closer you get the better idea you get of a candidates skill.
 

Tuco

I got Tuco'd!
<Gold Donor>
45,451
73,541
So first entry of my rebuttal against the Clean Coding book. I actually like the book so far and have little bad to say about it by page 40, but I do have a few things.

I'll start out with a practice I follow that I actually like, but can see others not liking:
Clean Coding_sl said:
Method Names
Methods should have verb or verb phrase names like postPayment, deletePage, or save.

Accessors, mutators, and predicates should be named for their value and prefixed with get, set, and is according to the javabean standard.

I find that functions perform some operation and should be describable as a verb. I think in C# (and other languages) this gets a little awkward because of the getter/setter property system making the verbs for the names impossible, but in C++ I like it.



And something I disagree with:
Clean Coding_sl said:
Member Prefixes
You also don't need to prefix member variables with m_ anymore. Your classes and functions should be small enough that you don't need them. And you should be using an editing environment that highlights or colorizes members to make them distinct.
Besides, people quickly learn to ignore the prefix (or suffix) to see the meaningful
part of the name. The more we read the code, the less we see the prefixes. Eventually the prefixes become unseen clutter and a marker of older code.

Interfaces and Implementations
These are sometimes a special case for encodings. For example, say you are building an ABSTRACT FACTORY for the creation of shapes. This factory will be an interface and will be implemented by a concrete class. What should you name them? IShapeFactory and ShapeFactory? I prefer to leave interfaces unadorned. The preceding I, so common in today's legacy wads, is a distraction at best and too much information at worst. I don't want my users knowing that I'm handing them an interface. I just want them to know that it's a ShapeFactory. So if I must encode either the interface or the implementation, I choose the implementation. Calling it ShapeFactoryImp, or even the hideous CShapeFactory, is preferable
to encoding the interface.
I've tried a handful of different prefix notations, including pSomePointer, bSomeBool, void someFunc(int _someParam). I've found that the two prefixing that have stuck are m_ for member variables and I for interfaces (Ex: IShapeFactory).

this.someMember is perfectly fine, but I find that using this. or this-> can be disruptive when used inconsistently and cluttered when used consistently Ex:

and

are both annoying compared to:

I also think the idea that the IDE will color your member variables making it so you don't need to worry about it a false assumption. I write a lot of different code on a large number of computers at work and I can't demand that all the languages I write on all the different platforms all be as good as Eclipse for java.

Again, this isn't a huge point to me, just the first thing I disagreed with.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
I've been working on a personal project that uses a multi-dimensional array. Actually, I've been struggling to try and think of a better way to represent the data. And, hey, maybe you guys might have some ideas. In fact, I think someone here mentioned they work with or might pursue a job that deals with HL7 (Health-Level 7) messages. Doesn't matter, many data messages are structured similarly.

Okay, so here's the deal: HL7 messages look like this:

Each line represents a segment (MSH, PID, NK1, PV1). Within each segment are sequences (the pipe [ | ] delimiter). Within each sequence there are components (the caret [ ^ ]). There are also subcomponents ( & ) and repeats ( ~ ) but are rarely used in my experiences.

I am creating a parser utility for the guys at work that will break down the message into a HTML table so they can more easily examine the data. I have a working tool, so no problem there, but what I ended up doing is simply splitting off of the 3 delimiters - carriage returns (for segments), pipe, and then caret. So you end up with a multi-dimensional string array - string[][][]. However, it's very cumbersome to work with and the code is confusing. I really can't think of a way to represent this data via class structures. You would basically end up with something like an array: Message being a List of Segments, Segments being a list of Sequences, and Sequences a List of Components. It's like Russian dolls and it gets confusing fast. And, it can get deeper than that if one needs to deal with the above mentioned subcomponents and repeats.

Oh, and if anyone actually gives a shit, this is what the parsing tool outputs:

rrr_img_104483.jpg
Nhapi

Disclaimer: I used nHapi to build and parse hl7 2.31 messages. I found it very easy to use.
 

Khane

Got something right about marriage
19,838
13,355
Nhapi

Disclaimer: I used nHapi to build and parse hl7 2.31 messages. I found it very easy to use.
Seconded. I work with HL7 data, either get your company to buy an HL7 engine, or just use nHapi.

By the way you may want to look at the new HL7 FHIR stuff and build whatever it is you're doing with that in mind.

But, if you don't want to do that, since each line has a tag identifier (MSH, PID, etc) and a distinct EOL character why not use that and just parse the data in a stream with that information rather than using multidimensional arrays to store it and then parse it out afterward?
 

Tenks

Bronze Knight of the Realm
14,163
606
So i am busy "working" right now while reading through this:

Why are programmers in the software engineering job interviews tested on skills similar to a Topcoder contest irrespective of the fact that the skills required in the industry are entirely different? - Quora

and I see that a lot of responses mention things like:

"you wont see a binary tree or linked lists often in industry"

and other similar responses. That seems crazy to me especially given the amount of interesting things that was pumped into my brain in my DS/Algo courses.

Was thinking maybe some of you industry guys can shed some light on what structures are used in your work, if any.
I was reading some Glassdoor reviews on Zillow and they do those stupid interview questions as well like how to insert/delete items into a ternery tree. You know how I do that? I find a third party ternery tree class and do ThatClass.add and ThatClass.remove. I use Lists, Sets, SortedLists and everything under the Java collection sun and know the entire collection library like the back of my hand but apparently real-life working knowledge of how to program is not what a bunch of companies are looking for in a programmer. They want someone who can jerk off intellectual with the best of them (look at Google here too.)

-edit-

The last time I used a multi-array was when I first got out of college and thought that is how programming in the real world actually operated. I probably could refactor it now down to a quarter of the lines of code using baked in Java stuff.
 

moontayle

Golden Squire
4,302
165
This is all relatively new to me since they really didn't teach using external libraries in school. One of the first problems I researched had a comment like, "Just use Apache Commons IO for this, so much easier." And it was. It opened my eyes to the work some people have done to simplify some of the convoluted shit that comes from Google and Oracle.
 

Khane

Got something right about marriage
19,838
13,355
This is all relatively new to me since they really didn't teach using external libraries in school. One of the first problems I researched had a comment like, "Just use Apache Commons IO for this, so much easier." And it was. It opened my eyes to the work some people have done to simplify some of the convoluted shit that comes from Google and Oracle.
Good programming involves a lot of Google searching. The people who think they are the rockstars of the coding world and never experiment or look to the community for different ideas are the worst kind of people to work with.
 

Tenks

Bronze Knight of the Realm
14,163
606
This is all relatively new to me since they really didn't teach using external libraries in school. One of the first problems I researched had a comment like, "Just use Apache Commons IO for this, so much easier." And it was. It opened my eyes to the work some people have done to simplify some of the convoluted shit that comes from Google and Oracle.
Yeah which is a problem with education. They hammer in the theory so hard but it doesn't prepare you at all for 90%+ of the actual programmer positions out in the real world. Things like Spring, Maven, Apache libraries are foreign concepts. Even though I deal with all those far more than I deal with computer science problems. The most important skill I have in my tool belt is knowing the correct words to plug into google and reading stack overflow. After that is knowing how to research and quickly learn an API for a 3rd party no one in my company has knowledge of using. Turns out I don't need to write some Calculus 3 algorithms on a daily.
 

Tenks

Bronze Knight of the Realm
14,163
606
Good programming involves a lot of Google searching. The people who think they are the rockstars of the coding world and never experiment or look to the community for different ideas are the worst kind of people to work with.
The highest level and highest paid engineer at my company is one of those people. We want to replace our custom search engine he wrote (and got bastardized over the years) 10 years ago. He wants to replace it with ANOTHER custom search engine this time as a triple store. Its like ... no. We're either using SolrLucene or Elastic. We're not dealing with this shit again. When something breaks we don't want an engineer requiring intimate knowledge of the inner plumbing. When a new feature request comes down the line we don't want an engineer having to write it himself. Just the other month we got a feature request to put in fuzzy searching (which btw doesn't work and the guy who wrote it left the company.) We had to write it ourselves. It would have been 1 line of XML configuration in Solr. Its maddening.
 

Vinen

God is dead
2,783
490
Yeah which is a problem with education. They hammer in the theory so hard but it doesn't prepare you at all for 90%+ of the actual programmer positions out in the real world. Things like Spring, Maven, Apache libraries are foreign concepts. Even though I deal with all those far more than I deal with computer science problems. The most important skill I have in my tool belt is knowing the correct words to plug into google and reading stack overflow. After that is knowing how to research and quickly learn an API for a 3rd party no one in my company has knowledge of using. Turns out I don't need to write some Calculus 3 algorithms on a daily.
The point of College isn't to provide job training. It's to teach you how to teach yourself.
 

Noodleface

A Mod Real Quick
37,961
14,508
I think I'm the exception working in BIOS.

It's so low-level that most of my schooling lines up with it pretty well. The only difference is we use EDK so we follow the UEFI standards and it's really amazing.
 

Tenks

Bronze Knight of the Realm
14,163
606
The point of College isn't to provide job training. It's to teach you how to teach yourself.
I'm well aware the idea behind college. I'm also aware it is to show you can start something and see it through the end. I'm just saying having a degree in computer science seems to ill prepare students for day 1 on the job as a business developer. Where my brother's MBA seemed to show him pretty much what he'll be MBA'ing on a daily basis.