• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 04:36
CET 10:36
KST 18:36
  • 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
TL.net Map Contest #21: Winners11Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation4Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
[TLMC] Fall/Winter 2025 Ladder Map Rotation Mech is the composition that needs teleportation t Weekly Cups (Nov 3-9): Clem Conquers in Canada Craziest Micro Moments Of All Time? SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Sparkling Tuna Cup - Weekly Open Tournament $5,000+ WardiTV 2025 Championship Merivale 8 Open - LAN - Stellar Fest
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
Rapidtags: The Ultimate Tool for Hashtag and Keywo Terran 1:35 12 Gas Optimization FlaSh on: Biggest Problem With SnOw's Playstyle BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET [ASL20] Grand Finals [Megathread] Daily Proleagues
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? Path of Exile Dawn of War IV
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread The Games Industry And ATVI
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1225 users

The Big Programming Thread - Page 744

Forum Index > General Forum
Post a Reply
Prev 1 742 743 744 745 746 1032 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
Poland17428 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
Hyrule19151 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
Poland17428 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
Hyrule19151 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
Poland17428 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 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 54m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 286
StarCraft: Brood War
Britney 49000
Rain 2987
Hyuk 2893
Soma 360
Backho 327
Rush 213
Pusan 117
JulyZerg 53
sSak 31
zelot 14
[ Show more ]
NaDa 12
Noble 11
ZerO 10
Hm[arnc] 8
Terrorterran 7
Dota 2
XaKoH 419
XcaliburYe139
Counter-Strike
fl0m1798
olofmeister680
shoxiejesuss411
oskar63
Super Smash Bros
Mew2King237
Other Games
ceh9502
Happy244
Pyrionflax116
ZerO(Twitch)4
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH257
• LUISG 21
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1347
• Stunt515
Upcoming Events
OSC
1h 54m
Kung Fu Cup
2h 24m
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
13h 24m
The PondCast
1d
RSL Revival
1d
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
1d 2h
WardiTV Korean Royale
1d 2h
PiGosaur Monday
1d 15h
RSL Revival
2 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
2 days
[ Show More ]
CranKy Ducklings
3 days
RSL Revival
3 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
3 days
IPSL
3 days
ZZZero vs rasowy
Napoleon vs KameZerg
BSL 21
3 days
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
4 days
RSL Revival
4 days
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
4 days
WardiTV Korean Royale
4 days
BSL 21
4 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
4 days
Dewalt vs WolFix
eOnzErG vs Bonyth
Wardi Open
5 days
Monday Night Weeklies
5 days
WardiTV Korean Royale
6 days
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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.