Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

08-24-2011 , 12:02 PM
Quote:
Originally Posted by gaming_mouse
Isn't that an argument in favor of it? Otherwise you are creating more and more static methods like the ones in question. One of the main points of OO is to keep data and the methods that operate on it together. Creating static methods like these is essentially doing procedural programming with global functions.

The refactoring I was referring to was creating a BasketList class, and then potentially changing other client code that uses the current static methods to use that class.
Ok, fair point.

Bigger picture, I'm not seeing the real need for the BasketList concept.

I'd rather that you construct a BasketItem from the parameters being passed in and use the already provided List contains function and BasketItem.equals function (whatever those are in this language). Then you don't need either of these functions anywhere.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:02 PM
gull, i think your "lambda" version is less readable than your first version and i don't understand your claim that there is "no repetition" when almost every character is repeated.

also i don't see how this is a lambda since there are no functions or function pointers anywhere. does 'linq' just mean 'treat objects like entries in a relational database'?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:03 PM
Quote:
Originally Posted by jjshabado
The downside of wrapping List<BasketItem> in a class is that now you have to pass all of the List functionality to BasketItem as you need it.
How so? Your new class will have a List<BasketItem> as one of its members. You will be delegating your list functionality to that member....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:06 PM
Quote:
Originally Posted by jjshabado
I'd rather that you construct a BasketItem from the parameters being passed in and use the already provided List contains function and BasketItem.equals function (whatever those are in this language). Then you don't need either of these functions anywhere.
Yeah this I like too. I'm not a C# guy so I wasn't aware what List facilities were available
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:06 PM
That's my point. You have a class full of

Code:
function x
    member.x

function y
   member.y

function bool z
   return member.z
Edit: Also a pain if you want to use functions that expect a list parameter.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:10 PM
Quote:
Originally Posted by tyler_cracker
gull, i think your "lambda" version is less readable than your first version and i don't understand how you can claim there is "no repetition" when almost every character is repeated.

also i don't see how this is a lambda since there are no functions or function pointers anywhere. does 'linq' just mean 'treat objects like entries in a relational database'?
I consider it non repetitive code because the repeating code are all things you would have to pass to a method anyway if you wanted to adopt another technique. I don't think it's possible this can be simplified, or broken up into a more simplified version any further:

Code:
return BasketItems.Where(c => c.GroupID == GroupID).SingleOrDefault() != null;
The c=> c.GroupID == GroupID is a lambda expression.

From Wikipedia:

Quote:
LINQ defines a set of method names (called standard query operators, or standard sequence operators), along with translation rules from so-called query expressions to expressions using these method names, lambda expressions and anonymous types. These can, for example, be used to project and filter data in arrays, enumerable classes, XML (LINQ to XML), relational databases, and third party data sources.
I've only really used linq/lambda for accessing data in my database, not applied it to objects like this before, although Jon Skeet someone I trust and read says once you get to grips with it it's exceptionally useful and powerful.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 12:11 PM
yeah if List already implements a search, that is the way to go.

btw from the looks of it, C# is like microsoft saw java and said, "Sweet, let's copy this ****, rename it, and sell it to people!"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 01:18 PM
There seem to be alot of folks around here that knows all the ins and outs of databases. What would be a good place to start learning about databases? what books and stuff. Would really appreciate some advice.

Mvh
Inga
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 01:19 PM
The claim was made in the OOT LC thread that there are no comparable laptops to the Macbook Air significantly cheaper than it.

I believe this, but just wondering what you guys think.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 01:26 PM
Quote:
Originally Posted by myNameIsInga
There seem to be alot of folks around here that knows all the ins and outs of databases. What would be a good place to start learning about databases? what books and stuff. Would really appreciate some advice.

Mvh
Inga
Why do you want to learn about them and what do you already know? It's a pretty big topic so it would probably help to know more details about what you want to get out of this.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 01:48 PM
Quote:
Originally Posted by jjshabado
Why do you want to learn about them and what do you already know? It's a pretty big topic so it would probably help to know more details about what you want to get out of this.
Thank you for replying!

I was looking to begin a course on database systems but unfortunately I applied to the course to late..

The course represents about 5 weeks of full time study.

This is from the course web page:


Lärandemål (efter fullgjord kurs ska studenten kunna) (goals)
By the end of the course the student should know how to design and use databases as an end user, as an application programmer and as a database administrator.


Innehåll (contents)
The course covers the basic principles of database systems as seen by users, application programmers and database administrators. A laboratory assignment develops these topics as a running example throughout the course. These include programming in SQL, as seen by a user querying or modifying an existing database, by a database designer, and by an application programmer invoking SQL from a host language.
Course contents include:
* Entity-Relationship modelling
* Functional Dependencies and Normalisation
* Database querying and manipulation through SQL
* Interfacing to a database from a host language (Java/JDBC)
* The semi-structured model, XML


Unfortunatly there is no litterature referred to on the site.

So since i cant take the course I still want to learn the things mentioned above. The course was using java but thats not necessary Any "C" dialect will do as well. Allthough I prefer C#

Sorry for the long post.

Mvh
Inga
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 02:01 PM
Quote:
Originally Posted by jjshabado
The claim was made in the OOT LC thread that there are no comparable laptops to the Macbook Air significantly cheaper than it.

I believe this, but just wondering what you guys think.
i dunno, what are you comparing? if its just specs of some nature i am pretty sure i could find a PC for quite a bit less. usually mac users claim that battery life and "better UI" are the justification for the increased cost.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 02:35 PM
Quote:
Originally Posted by gaming_mouse
i dunno, what are you comparing? if its just specs of some nature i am pretty sure i could find a PC for quite a bit less. usually mac users claim that battery life and "better UI" are the justification for the increased cost.
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 02:43 PM
Quote:
Originally Posted by jjshabado
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
what are the specs?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 02:50 PM
http://www.apple.com/ca/macbookair/specs.html

* 11.6 inches, 2.38 lbs
* 64 GB Flash Drive
* 1.6GHz dual-core Intel Core i5 with 3MB shared L3 cache
* 2 GB Memory
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 03:06 PM
Quote:
Originally Posted by jjshabado
http://www.apple.com/ca/macbookair/specs.html

* 11.6 inches, 2.38 lbs
* 64 GB Flash Drive
* 1.6GHz dual-core Intel Core i5 with 3MB shared L3 cache
* 2 GB Memory
yeah just spent 5 mins looking around.... seems like you can reduce the cost and even gain RAM, but you give up the flash. asus is coming out with a direct competitor but looks like it will only save you $100 or so. and this is coming out soon:

http://www.slashgear.com/acer-aspire...eaks-09170469/

but again it doesnt look like you'll be getting a massive discount...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 04:34 PM
afaik most of what you're paying for when you buy an air is this:

Quote:
Originally Posted by lol apple.canadia
# Height: 0.3-1.7 cm (0.11-0.68 inch)
# Width: 32.5 cm (12.8 inches)
# Depth: 22.7 cm (8.94 inches)
# Weight: 1.35 kg (2.96 pounds)
fwiw, my bf had one of the older airs and loved it for browsing in bed and stuff like that but then he got an ipad so he sold the air.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 05:07 PM
@tyler_cracker - That's what most people claim (buying air for size/weight/name) - but looking at the specs the air is a pretty powerful machine and I don't think there are any laptops that beat the air's performance and price (at least not by very much).

I had a first generation Air and I loved it for the same things - but my understanding is that as of last year's update they became a solid laptop on top of being light.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 06:45 PM
Quote:
Originally Posted by jjshabado
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
Think outside the box. Most PC manufacturers mark up SSD about 200%-300%.

So take something like this:
http://www.newegg.com/Product/Produc...82E16834246147
6GB of ram vs 2GB of ram
more powerful GPU vs two generation old GPU.
2.3Ghz CPU vs 1.6Ghz CPU
Bluray optical vs no optical

Plus drop in a nice SSD from Intel
http://www.newegg.com/Product/Produc...82E16820167050
120GB vs 64GB
roughly double the capacity, double the throughput and an amazing 5 year warranty.

Combined price ~ $1000.

If you don't need bluray, can deal with smaller SSD, or live with a less powerful GPU you can easily shave $200 - $300 off the cost and still outspec the air.

For example if you wanted a larger (17") screen.
This http://www.newegg.com/Product/Produc...82E16834200306
plus this http://www.newegg.com/Product/Produc...82E16834215122 is under $850 shipped.


The air has one advantage and one advantage only. It is light, and thin, and small. Well I guess that is three advantages. However there is a $200 - $400 premium for those specs.

Last edited by DeathAndTaxes; 08-24-2011 at 06:56 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 06:53 PM
Quote:
Originally Posted by DeathAndTaxes
Think outside the box. Most PC manufacturers mark up SSD about 200%-300%.
Yeah I've been meaning to post this. also not to be worried if you haven't done it before, swapping out the HDD in a modern laptop (non-apple) is usually similar to changing games on a NES.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 06:55 PM
Quote:
Originally Posted by gaming_mouse
btw from the looks of it, C# is like microsoft saw java and said, "Sweet, let's copy this ****, rename it, and sell it to people!"
More like Microsoft said "wow Java is a great idea but Sun made some horrible horrible performance decisions (like everything but built-in types are reference types, can anyone say heap fragmentation and GC churn) and then lets Java fall behind other OOP languages".

C# takes the best of Java (just like Java took the best of OOP languages before it) and improves on it so much to say C# copied Java is silly and misses the point. C# language makes it "easy" to write solid, self documenting code without lots of excess boilerplate code. Properties, operating overloading, null operator, delegates, lambdas, (and likely I am forgetting a half dozen more) all make is easier to produce reusable code. Just my 2 cents and maybe it is because I am coming from a solid C++ background but I find C# takes the best of both Java and C++, leaves behind the things I hate the most with both, throws in a massive framework (stop reinventing the wheel) and some completely new stuff.

Last edited by DeathAndTaxes; 08-24-2011 at 07:04 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 07:10 PM
Inga,

It's good you want to learn! A great thing to start on, and this is crucial to learning things like this is Normalisation. It's a concept which I think is good to start on. I'd spend a lot of time studying this single concept if I was serious about learning this sort of thing.

Tom
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-24-2011 , 11:18 PM
how are you comparing a 17" laptop with the Air?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-25-2011 , 03:15 AM
The weight and form factor IS a spec. So please don't be comparing the MBA to some +5lb notebook that's cheaper and more powerful.

It maybe not be suitable for your needs but for many road warriors, it's a god send and well worth the money.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
08-25-2011 , 04:13 AM
I have a behemoth of a 17" Dell laptop from like 2005 (posting on it right now!) and I would trade it for a MacBook over my dead body
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m