• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 03:25
CEST 09:25
KST 16:25
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Weekly Cups (June 30 - July 6): Classic Doubles0[BSL20] Non-Korean Championship 4x BSL + 4x China3Flash Announces Hiatus From ASL63Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event22
StarCraft 2
General
Weekly Cups (June 30 - July 6): Classic Doubles Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form?
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
SC uni coach streams logging into betting site Player “Jedi” cheat on CSL Flash Announces Hiatus From ASL BW General Discussion Practice Partners (Official)
Tourneys
CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China The Casual Games of the Week Thread [BSL20] Grand Finals - Sunday 20:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Stop Killing Games - European Citizens Initiative US Politics Mega-thread Summer Games Done Quick 2024! Summer Games Done Quick 2025! Russo-Ukrainian War Thread
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 669 users

The Big Programming Thread - Page 744

Forum Index > General Forum
Post a Reply
Prev 1 742 743 744 745 746 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
July 21 2016 20:10 GMT
#14861
On July 22 2016 01:56 Shield wrote:
Verbosity is good as long as it's not abused. You should really read Clean Code before you go further with this discussion.


I did read it. And I still think that "readAllLines" could as well be "getLines" without any detriment to readability...
Time is precious. Waste it wisely.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
July 21 2016 20:20 GMT
#14862
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:20:17
July 21 2016 21:15 GMT
#14863
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


Descriptive method name is like first impression from meeting someone. Do you want to impress them or do you want to disgust them?

On July 22 2016 05:10 Manit0u wrote:
Show nested quote +
On July 22 2016 01:56 Shield wrote:
Verbosity is good as long as it's not abused. You should really read Clean Code before you go further with this discussion.


I did read it. And I still think that "readAllLines" could as well be "getLines" without any detriment to readability...


"getLines"? Which lines? If you have N lines (N = 10), how many lines? From 1 to 5? From 1 to 6? From 1 to n? readAllLines is unambigious. There is no confusion at all.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:20:10
July 21 2016 21:19 GMT
#14864
second post by mistake
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2016-07-21 21:24:57
July 21 2016 21:21 GMT
#14865
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-07-21 21:30:07
July 21 2016 21:26 GMT
#14866
On July 22 2016 06:21 Prillan wrote:
Show nested quote +
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.


What about this one?


deserialiseResultAndRecordInDatabase(Json json)
{
SomeResult result = SomeResult::deserialise(json);
_database.recordResult(result);
}


It could be broken down into two separate methods. I agree with that, but it's not a complex method despite long name.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
July 21 2016 21:41 GMT
#14867
--- Nuked ---
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
July 21 2016 22:57 GMT
#14868
On July 22 2016 06:41 Nesserev wrote:
Show nested quote +
On July 22 2016 00:00 Manit0u wrote:
This thread is the best on TL

Clearly, you have never visited the 'Korean Music Discussion' thread.

All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.


Broken generics? What do you mean?
tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
July 21 2016 23:16 GMT
#14869
On July 22 2016 02:36 Doodsmack wrote:
Are Microsoft SQL Server skills (including T-SQL obv) valuable and future-secure?

no

Good to know, and there will always be MSSQL jobs, but Linux servers are like 98% of the internet
Liquipediaasante sana squash banana
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2016-07-21 23:24:48
July 21 2016 23:21 GMT
#14870
On July 22 2016 06:21 Prillan wrote:
Show nested quote +
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.

I like "readAllLines" better than "getAllLines" because in the first case the I/O process is clear (probably with side effects too), and "get" in general is a really vague method prefix. I know it's idiomatic Java, but you could just name the get method "allLines" instead, like we would do in Scala.

On July 22 2016 07:57 Shield wrote:
Show nested quote +
On July 22 2016 06:41 Nesserev wrote:
On July 22 2016 00:00 Manit0u wrote:
This thread is the best on TL

Clearly, you have never visited the 'Korean Music Discussion' thread.

All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.


Broken generics? What do you mean?

He probably means that they're just a patchwork solution and not actually designed into the JVM. Fucking casts from Object everywhere :D. Also, at the compiler level, the type system is really restrictive as far as generics go.
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
Last Edited: 2016-07-22 01:01:42
July 22 2016 00:37 GMT
#14871
On July 22 2016 08:21 ZenithM wrote:
Show nested quote +
On July 22 2016 06:21 Prillan wrote:
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.

EDIT: readAllLines is a perfectly fine name. getAllLines would be fine too, but I don't particularly like getLines for the same reason as the previous poster.

I like "readAllLines" better than "getAllLines" because in the first case the I/O process is clear (probably with side effects too), and "get" in general is a really vague method prefix. I know it's idiomatic Java, but you could just name the get method "allLines" instead, like we would do in Scala.


Well, getLines is from Scala actually

http://www.scala-lang.org/api/current/index.html#scala.io.Source@getLines():Iterator[String]

Anyway, while I agree that unambiguous names are good, probably if your class/method name is long it's probably too complex or too descriptive (I find that programmers tend to be smart people and can infer quite a lot of information that isn't readily present).

I mean, let's just compare some simple stuff from commonly used applications (a simple controller in a web framework):

Java (Spring):

package hello;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class GreetingController {

@RequestMapping("/greeting")
public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) {
model.addAttribute("name", name);
return "greeting";
}

}


Ruby (Rails):

class GreetingController < ApplicationController
def greeting
defaults = {:name => 'World'}
params = defaults.merge(params)

@greeting.name = params[:name]
end
end


Python (Django):

// non-class based views
def greeting(request, name='World'):
return render_to_response('greeting.html', {'name': request.GET['name']})

// class based views
from django.views.generic import View

class GreetingView(View):
def get(self, request, name='World'):
return render_to_response('greeting.html', {'name': request.GET['name']})


I might be a bit off with Django, haven't done anything in it for a while.

As you can see, it's definitely possible to achieve the same thing without being too verbose and without losing too much clarity on the matter.

The biggest problem that Java's verbosity poses for me is not the fact that it's hard to understand but the fact that there's simply so much more to read, which significantly increases time required to assess the code and its function. I don't know about you but I read code way more often than I write it and making this process harder isn't good for me.

In this regard Ruby is pretty awesome. Just going back to our readAllLines examples:

File.open('my_file.txt').each_line

File.readlines('my_file.txt')

File.foreach('my_file.txt')


All of them will work.
Time is precious. Waste it wisely.
berated-
Profile Blog Joined February 2007
United States1134 Posts
July 22 2016 01:10 GMT
#14872
On July 22 2016 08:16 tofucake wrote:
Show nested quote +
On July 22 2016 02:36 Doodsmack wrote:
Are Microsoft SQL Server skills (including T-SQL obv) valuable and future-secure?

no

Good to know, and there will always be MSSQL jobs, but Linux servers are like 98% of the internet


Which is probably why MS SQL is coming to linux.
tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
July 22 2016 02:06 GMT
#14873
Yeah Microsoft realized they can't compete with php/js/mysql if their shit doesn't work on Linux, which is a big part of why they are open sourcing and porting everything.
Liquipediaasante sana squash banana
RoomOfMush
Profile Joined March 2015
1296 Posts
July 22 2016 07:02 GMT
#14874
On July 22 2016 06:41 Nesserev wrote:
All this talk about Java's (and C#) verbosity, while there are clearly bigger gripes to be had with Java; generics are fundamentally broken, lack of constness, equals() vs. ==, mandatory checked exceptions, horrible APIs, 'package' being the default access modifier, etc.

What is so bad about javas generics? I have much bigger problems with C#'s generics since they dont have the wildcard operator. I often find myself wishing I could write List<?> but that is not as easy as it is in Java. The only problem with Java generics I have is the fact you can not create generic arrays or call .class on generic type parameters (for obvious reasons).

What is the lack of "constness"?

And what is the problem of "equals() vs. =="? Do you mean you have a problem with both having a different meaning in java? Because I dont know why having more options is bad compared to having two ways to do the same thing.

Checked exceptions are not a bad thing either. It is bad that they are used within the JDK, but I am very happy that I can define my own checked exceptions and force myself to use them in my code with a compiler pointing out everytime I missed one.

The package access modifier is shit though. But its a relict of the very first versions of java. Its history and the java people dont ever want to break backwards compatibility (which you can like or dislike but at least they are consistent).
Prillan
Profile Joined August 2011
Sweden350 Posts
July 22 2016 11:20 GMT
#14875
On July 22 2016 06:26 Shield wrote:
Show nested quote +
On July 22 2016 06:21 Prillan wrote:
On July 22 2016 05:20 Birdie wrote:
Aren't reallyLongAndAwesomelyDescriptiveMethodNames good sometimes? If it's the most accurate way of describing the use of the function then it isn't unnecessary or useless, even if it's a bit long. Plus with autocomplete, it's not "expensive" for typing to have a longer method name.


In my opinion, if you need a whole sentence to name a method, it's probably the case that the method is way too complex and needs to be re-factored.


What about this one?


deserialiseResultAndRecordInDatabase(Json json)
{
SomeResult result = SomeResult::deserialise(json);
_database.recordResult(result);
}


It could be broken down into two separate methods. I agree with that, but it's not a complex method despite long name.

It's not always true of course, but in this case I don't see the need of an extra function at all. I'd just write

database.record_result(deserialize(data))

or if I had to name it, store_result would be enough.

Anyways, let's not get into too many examples because we could end up doing that forever otherwise, so let me rephrase it.

In my opinion, in general, if you need a whole sentence to name a method, you could probably refactor it or rename it.

I don't think that Java is overly verbose on this, but Swift on the other hand, just wow.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Manit0u
Profile Blog Joined August 2004
Poland17243 Posts
July 22 2016 11:42 GMT
#14876
Tried to update Apache Camel to newer version, including the dependencies. Upped the versions in pom.xml, mvn clean, mvn install and now the builds fail because fucking spring-test package is using juni4 packages instead of junit38 and every single test fails to compile since 90% of the imports are now obsolete or changed.

I hate my life right now.
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-07-22 11:55:07
July 22 2016 11:54 GMT
#14877
--- Nuked ---
RoomOfMush
Profile Joined March 2015
1296 Posts
July 22 2016 13:01 GMT
#14878
You have the "final" keyword in java which does just that. If a variable is declared final its value will never change. If a class is declared final it can not be extended anymore. If a method is final it can not be overwritten.
Its not exactly what you are describing though.

All these things you mention can be done in java with code but are special functions build into the core of the language instead. I can see how some people can like that, but I prefer less keywords and doing things on my own by writing good code. I mean I can see these things being useful, but I never actually needed them myself.
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
Last Edited: 2016-07-22 15:23:55
July 22 2016 13:14 GMT
#14879
On July 22 2016 22:01 RoomOfMush wrote:
You have the "final" keyword in java which does just that. If a variable is declared final its value will never change. If a class is declared final it can not be extended anymore. If a method is final it can not be overwritten.
Its not exactly what you are describing though.

All these things you mention can be done in java with code but are special functions build into the core of the language instead. I can see how some people can like that, but I prefer less keywords and doing things on my own by writing good code. I mean I can see these things being useful, but I never actually needed them myself.


Final and const are not equivalent at all. Setting a parameter to const says that the function will not change that value. Java's final makes it immutable so it can never be changed. For instance, I could have the following functions:

void printValue(const int value)
int addValue(int value)

Consider the situation where I pass value to printValue, addValue, and then printValue again. I can pass my int to each of these functions and const just guarantees that the value won't be changed.

If I made a final int in Java like you suggest then I wouldn't be able to call addValue. Const provides a completely different meaning.
I'll always be your shadow and veil your eyes from states of ain soph aur.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-07-22 13:30:01
July 22 2016 13:15 GMT
#14880
--- Nuked ---
Prev 1 742 743 744 745 746 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 3h 35m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Leta 218
Mong 206
Zeus 163
Mind 78
Shine 25
Sharp 21
Bale 11
yabsab 9
Barracks 0
Dota 2
XaKoH 524
Counter-Strike
shoxiejesuss98
Super Smash Bros
Mew2King154
Other Games
Stewie2K537
NeuroSwarm98
SortOf95
ProTech48
Organizations
Other Games
gamesdonequick32721
BasetradeTV7
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH382
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota2225
League of Legends
• Rush1665
• HappyZerGling177
Upcoming Events
Wardi Open
3h 35m
Replay Cast
16h 35m
Sparkling Tuna Cup
1d 2h
WardiTV European League
1d 8h
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
1d 16h
The PondCast
2 days
WardiTV European League
2 days
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
uThermal 2v2 Circuit
2 days
Replay Cast
2 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
[ Show More ]
Replay Cast
3 days
RSL Revival
4 days
Classic vs Cure
FEL
4 days
RSL Revival
5 days
FEL
5 days
FEL
5 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
FEL
6 days
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.